From 39f801e21a700bbf289a1da5fa8d68bd0141b7a8 Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Fri, 17 Jul 2026 16:48:34 -0700 Subject: [PATCH 1/7] Native modular agent skills: per-session worktree install + orx skill modules (v0.1.62) - Factor the 66KB SKILL.md into 10 embedded modules under agent-skills/ - Write the Local set as native SKILL.md skills into each orx up session worktree (harness-specific dir), fresh every turn beside the playbook - Slim the playbook: compute/k8s/report detail moves to skills, generated skills index added; cardinal rules and command surface stay inline - orx skill serves bundled modules (API fallback unchanged); no-arg prints the slim root + module index - orx install-skills --full writes the Full set globally (cloud box); Codex shim migrates to ~/.agents/skills (native, model-discoverable), legacy prompt kept --- Cargo.lock | 2 +- Cargo.toml | 2 +- SKILL.md | 1080 ++----------------------------- agent-skills/compute-k8s.md | 65 ++ agent-skills/compute.md | 284 ++++++++ agent-skills/create.md | 133 ++++ agent-skills/evidence-cloud.md | 167 +++++ agent-skills/evidence-local.md | 35 + agent-skills/experiment-tree.md | 186 ++++++ agent-skills/git-editing.md | 82 +++ agent-skills/lit.md | 55 ++ agent-skills/reports-cloud.md | 33 + agent-skills/reports-local.md | 21 + src/commands/install_skills.rs | 153 ++++- src/commands/skill.rs | 24 +- src/local/agent_skills.rs | 340 ++++++++++ src/local/harness/claude.rs | 9 +- src/local/harness/codex.rs | 41 +- src/local/harness/mod.rs | 56 +- src/local/harness/opencode.rs | 4 + src/local/mod.rs | 1 + src/local/opencode.rs | 232 ++++--- src/main.rs | 8 + 23 files changed, 1852 insertions(+), 1161 deletions(-) create mode 100644 agent-skills/compute-k8s.md create mode 100644 agent-skills/compute.md create mode 100644 agent-skills/create.md create mode 100644 agent-skills/evidence-cloud.md create mode 100644 agent-skills/evidence-local.md create mode 100644 agent-skills/experiment-tree.md create mode 100644 agent-skills/git-editing.md create mode 100644 agent-skills/lit.md create mode 100644 agent-skills/reports-cloud.md create mode 100644 agent-skills/reports-local.md create mode 100644 src/local/agent_skills.rs diff --git a/Cargo.lock b/Cargo.lock index 7a73c71..f40cc43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -928,7 +928,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openresearch-cli" -version = "0.1.61" +version = "0.1.62" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 93ad78a..c06888f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openresearch-cli" -version = "0.1.61" +version = "0.1.62" edition = "2021" description = "OpenResearch CLI (orx) — Rust port" repository = "https://github.com/alphaXiv/openresearch-cli" diff --git a/SKILL.md b/SKILL.md index 1e3d3d1..bd6e04d 100644 --- a/SKILL.md +++ b/SKILL.md @@ -11,21 +11,26 @@ tree, runs, logs, artifacts, evidence database) and **write actions** (create experiments, launch/cancel runs on GPU compute). Code is the one thing `orx` does not serve: every experiment is a git branch on the project's GitHub repo, and the **local clone in `~/.cache/openresearch/repos//` is -the standard way to read, diff, and edit it** (see "Reading & editing a node's -code"). Use `orx` when you need to inspect or drive project state from a shell -instead of the web UI. +the standard way to read, diff, and edit it** (see the `orx-git` module). Use +`orx` when you need to inspect or drive project state from a shell instead of the +web UI. + +This overview is deliberately short: it carries the cardinal rules and a command +quick-reference, then points at focused **modules** for everything else. Load a +module with `orx skill ` (the live index is printed at the end of `orx +skill` output). ## Cardinal rules — read before doing anything else These four govern everything below. Breaking any one silently invalidates your -results — they are not style preferences. The detailed "experiment-tree model" -section expands on the why; these are the non-negotiables. +results — they are not style preferences. The `orx-experiment-tree` module +expands on the why; these are the non-negotiables. 1. **Never edit a baseline (root) once it holds real code.** A root is the control its variants are measured against. Projects start with an empty tree — **you create the baseline** (the first `orx create-experiment`, no `--parent`) and, on a blank repo, seed it with starting code before its first - run (see "Seeding an empty baseline"). That setup window is the one + run (see the `orx-create` module). That setup window is the one exception, like rule 2's single legitimate `--set`. From the moment a root holds real code this rule is absolute: to try an idea, **branch a child** and edit the child. Editing a root moves the goalposts and destroys every @@ -44,7 +49,7 @@ section expands on the why; these are the non-negotiables. 4. **Grow the tree downward, not sideways.** Fan a little *within* a round (the options of one decision), then **descend onto that round's winner** for the next round. A root with a long row of direct children and no grandchildren is - the failure mode. See "Shape the tree" below. + the failure mode. See "Shape the tree" in the `orx-experiment-tree` module. If you're ever tempted to change the command, pass an env var, or pile another node onto the root instead of branching a child, editing its branch, and @@ -61,7 +66,12 @@ orx logout # remove the stored token default. Set `OPENRESEARCH_API_URL` for non-local use. - Every command except `login`, `lit`, and `paper` needs a token; if you see `Not logged in`, run `orx login`. (`lit` and `paper` hit alphaXiv's public hosts and work without one.) -## Commands +## Command quick-reference + +Project-scoped commands take a **project id**; experiment-scoped commands take an +**experiment id**; run-scoped commands take a **run id**. Don't mix them — get +ids from `orx projects`, `orx experiments`, and `orx runs` respectively. Each +group below has a module (`orx skill `) with the full flags and rules. ### Auth | Command | What it does | @@ -72,1027 +82,66 @@ orx logout # remove the stored token ### Discover (project- and experiment-scoped) | Command | What it does | |---|---| -| `orx projects [--all] [--json]` | List your projects (id + name + GitHub `owner/repo`), grouped by org (name + org id). `--all` includes archived; `--json` emits a flat array (incl. each project's `paperId`) for scripts. **Project ids, org ids, and the repo to clone come from here.** | -| `orx explore [--json]` | List the **public** project directory (id + name + repo) — projects anyone can view, not just yours. Use it to discover others' work; then drill in with `orx project view`, `orx experiments`, `orx runs`, `orx report show` on the id. | -| `orx project view ` | Overview of one project: details (incl. public/private), its experiment tree, and its reports — a single-screen jumping-off point. Works on any public project or any private one in your orgs. | -| `orx experiments ` | Print the project's experiments as an indented tree (nested by parent). **Experiment ids come from here.** | -| `orx runs [--experiment ]` | List runs as a table (status, experiment, commit, updated), newest first. `--experiment` filters to one experiment. **Run ids come from here.** | -| `orx env ` | List the **names** of the environment variables a run in this project will see (merged org + project vars plus your own per-user vars), each tagged with its source. **Names only — values are never returned.** Use this to check whether a secret a run needs (e.g. `WANDB_API_KEY`) is set, without ever seeing its value. | - -### Run evidence (run-scoped) +| `orx projects [--all] [--json]` | List your projects (id + name + GitHub `owner/repo`), grouped by org. `--all` includes archived; `--json` emits a flat array (incl. each project's `paperId`) for scripts. **Project ids, org ids, and the repo to clone come from here.** | +| `orx explore [--json]` | List the **public** project directory (id + name + repo) — projects anyone can view. Drill in with `orx project view` / `orx experiments` / `orx runs`. | +| `orx project view ` | Overview of one project: details, its experiment tree, and its reports. Works on any public project or any private one in your orgs. | +| `orx experiments ` | Print the project's experiments as an indented tree. **Experiment ids come from here.** | +| `orx runs [--experiment ]` | List runs as a table, newest first. **Run ids come from here.** | +| `orx env ` | List the **names** of the env vars a run will see (merged org + project + per-user), each tagged with its source. **Names only — values never returned.** | + +### Run evidence (run-scoped) — module `orx-evidence` | Command | What it does | |---|---| -| `orx logs [--head] [--bytes ] [--range :]` | Read a run's terminal log. See below. | -| `orx search-logs "" (--run \| --experiment ) [--max ]` | Grep run logs for a literal pattern. See below. | -| `orx artifacts ` | List the text artifacts a run produced (key + size). | -| `orx artifact [--head] [--bytes ]` | Read a run's text artifact (tail by default). Also caches it for `orx query` SQL search. | -| `orx wandb ` | List the W&B runs linked to a run (with dashboard URLs). | -| `orx chart wandb --metric "" --run [:label] ...` | Render a W&B metric across runs to a PNG line chart. See below. | -| `orx query ""` | Run **one read-only DuckDB SQL statement** against the project's evidence schema. See below. | - -### Create and run experiments (write) +| `orx logs [--head] [--bytes ] [--range :]` | Read a run's terminal log. | +| `orx search-logs "" (--run \| --experiment ) [--max ]` | Grep run logs for a literal pattern. | +| `orx artifacts ` / `orx artifact [--head] [--bytes ]` | List / read a run's text artifacts. | +| `orx wandb ` | List the W&B runs linked to a run. | +| `orx chart wandb --metric "" --run [:label] ...` | Render a W&B metric across runs to a PNG. | +| `orx query ""` | Run one read-only DuckDB SQL statement against the evidence schema. | + +### Create and run experiments (write) — modules `orx-create`, `orx-compute`, `orx-git` | Command | What it does | |---|---| -| `orx create-project --name "" [--repo ]` | Create a project bound to a GitHub repo (or a fresh blank repo when `--repo` is omitted). Starts with an **empty experiment tree** — create the baseline next. See below. | -| `orx project edit [--name ""] [--description "" \| --description-stdin]` | Edit a project's name and/or description (pass at least one). `--description-stdin` overwrites the description from stdin (long markdown). | -| `orx create-experiment --title "" [...]` | Add an experiment node; prints its git branch. See below. | -| `orx compute [--gpu ] [--count ] [--provider ] \| --cpu]` | List the GPU compute catalog across all providers, or CPU-only offers with `--cpu` (price-sorted). See below. | -| `orx instance create (--gpu [--count ] [--disk ] [--provider ] \| --cpu [--vcpus ])` | Spin up a standalone instance in an org (not tied to an experiment), like the dashboard's "Spin up". See below. | -| `orx exp status/cmd/run/cancel/wait ` | Inspect, run, cancel, and wait on a single experiment node. `status` prints the node's branch, its parent's branch, the latest run's full commit SHA, and a ready-to-paste local `git diff` recipe. See below. | -| `orx exp desc [--set "" \| --stdin]` | Read or overwrite the experiment's description (free-form notes). See below. | -| `orx report upload [--title ""]` | Upload a report folder (`report.md` + `images/`) to the project. Appears on the project page and its public view. `orx report list ` lists them; `orx report show ` prints a report's markdown to stdout (works on any public project); `orx report download ` writes `report.md` + referenced images back to a local folder (the inverse of `upload`). See below. | +| `orx create-project --name "" [--repo ]` | Create a project bound to a GitHub repo (or a fresh blank repo). | +| `orx project edit [--name ""] [--description "" \| --description-stdin]` | Edit a project's name and/or description (pass at least one); `--description-stdin` overwrites the description from stdin (long markdown). | +| `orx create-experiment --title "" [...]` | Add an experiment node; prints its git branch. | +| `orx compute [--gpu ] [--count ] [--provider ] \| --cpu]` | List the GPU/CPU compute catalog. | +| `orx instance create (--gpu … \| --cpu …)` | Spin up a standalone instance in an org. | +| `orx exp status/cmd/run/cancel/wait ` | Inspect, run, cancel, and wait on a single experiment node. | +| `orx exp desc [--set "" \| --stdin]` | Read or overwrite the experiment's description. | +| `orx report upload/list/show/download …` | Publish and read project reports (module `orx-reports`). | To **read or edit** a node's code — including diffing what a run changed — use -plain git in the cache-dir clone; there is no `orx` code command. See "Reading & -editing a node's code" below. +plain git in the cache-dir clone; there is no `orx` code command. See the +`orx-git` module. -### Literature & papers — alphaXiv (no login required) +### Literature & papers — alphaXiv (no login required) — module `orx-lit` | Command | What it does | |---|---| -| `orx lit "" [--limit ] [--json]` | Full-text search alphaXiv's paper corpus; returns ranked hits (id, title, date, votes, abstract). See below. | -| `orx paper ` | Fetch a paper's **machine-readable report** (structured LLM-oriented analysis). Prints the paper's linked **GitHub repo** at the top when one exists. See below. | -| `orx paper --full` | Fetch the paper's **full extracted text** instead — fallback when the report lacks a specific detail. | +| `orx lit "" [--limit ] [--json]` | Full-text search alphaXiv's paper corpus. | +| `orx paper [--full]` | Fetch a paper's machine-readable report (or full text with `--full`). | ### Meta | Command | What it does | |---|---| -| `orx skill [path]` | Print this overview (no args), or fetch a deeper skill/reference doc by path. | - -Project-scoped commands take a **project id**; experiment-scoped commands take an -**experiment id**; run-scoped commands take a **run id**. Don't mix them — get -ids from `orx projects`, `orx experiments`, and `orx runs` respectively. - -## The experiment-tree model — read this before driving a project - -A project is a **tree of experiment nodes**. The root (**baseline**) holds the -starting code and a **run command** — the single shell command that trains or -evaluates the node and writes an `EVAL.md` with its results. Every other node is a -**child** branched off a parent, inheriting its code and its run command. The two -rules this depends on — **never edit the baseline** and **the run command + env is -a fixed contract** — are the cardinal rules at the top of this skill; everything -below assumes them. - -### Shape the tree — stacked bushes, not a flat fan or a noodle - -The single most common way to drive a project badly is to get the **shape** wrong. -There are two opposite failures, and the right shape sits between them: - -``` -FLAT FAN (wrong) NOODLE (wrong) STACKED BUSHES (right) -root root root -├ a ├ b ├ c ... ├ n └ a └ lr-head ┐ round 1: - └ b ├ lr 2e-5 │ a small fan of - └ c └ lr 3e-5 ┘ co-equal options - └ d ... └ winner ── arch-head ┐ round 2 - ├ arch-A │ descends onto - └ arch-B ┘ round 1's winner -``` - -- **Flat fan** (your whole sweep hanging off the root): every result is measured - against the *start*, so wins never accumulate and the tree never makes progress. -- **Noodle** (a long single-child chain): depth manufactured for its own sake — - each step doesn't actually build on the one above it. -- **Stacked bushes** (correct): a *small fan within a round* (the options of one - decision), then **descend onto that round's winner** for the next round. - -**The one rule that produces this shape.** Before you make X a child of Y, name -what Y established that X builds on: - -- **You can name it** ("Y is the LR winner; X keeps that LR and changes the - architecture") → real depth. X is a **child** of Y. Descend. -- **You can't — X and Y are co-equal options you're trying at the same time** - (lr 2e-5 vs lr 3e-5) → they don't build on each other. They're **siblings** in - the same bush. Fan, don't chain. - -So: **width = the open options of one decision** (fan freely — a 3-way LR sweep -*should* be three siblings under a common head); **depth = decisions already -resolved, stacked** (one level down per winner kept). A new *round* never hangs off -the root — it hangs off the previous round's winner. That keeps the tree moving -**downward** as research progresses, without stringing unrelated nodes into a line. - -Re-read `orx experiments` each round and check the shape: a wide row of direct -children off the root with no grandchildren means you're fanning when you should be -descending; a long depth-N chain with no branching means you're chaining co-equal -variants that should have been siblings. - -### The auto-research loop - -To drive a project toward a goal (e.g. "best convergence for d=8") under a fixed -GPU budget, this is the intended flow — do **not** edit the baseline or rewrite the -run command: - -1. **Read the baseline's code.** Clone the project's repo into the cache dir and - read it with your normal tools (see "Reading & editing a node's code" for the path). - See its run command with `orx exp cmd ` and find where the knobs live - (config files, hyperparameters, model defs). -2. **Form one round's worth of hypotheses** — the co-equal options of a *single* - decision (which LR? which schedule? which init?), each a concrete change you can - make and measure against the others in this round. Don't mix decisions from - different rounds into one batch — that's what produces the flat fan. -3. **Create the round as a bush, and pick its parent deliberately.** All of this - round's options are **siblings under one parent** — the title is the idea, the - description is the concrete change you'll make on that node's branch. The parent is: - - the **baseline**, only for the very first round (nothing has been won yet); or - - the **previous round's confirmed winner**, for every round after — so this - round's changes build *on top of* the last gain instead of resetting to the - start. This is what walks the tree downward (see "Shape the tree" above). - - ```sh - # Round 1 — one decision (the LR), its options fanned off the baseline: - orx create-experiment --parent --title "LR 2e-5" \ - --description "Set the LR in config.yaml to 2e-5; change nothing else." - orx create-experiment --parent --title "LR 3e-5" \ - --description "Set the LR in config.yaml to 3e-5; change nothing else." - - # Round 2 — LR 3e-5 won → the next decision (architecture) descends onto it: - orx create-experiment --parent --title "Wider MLP" \ - --description "On top of the LR-3e-5 winner, widen the MLP hidden dim 1024→2048 in model.py." - ``` - The child inherits its parent's run command automatically — you don't set it, - and you never give siblings different commands or env vars (cardinal rule 2). -4. **Implement each child's change on its git branch** — `orx create-experiment` - prints the child's branch (`orx/`); sync the project's clone (in the - openresearch cache dir — see "Reading & editing a node's code"), check the branch out, - edit only the files that idea touches, commit, and push. **Leave the run - command alone:** - ```sh - DIR=~/.cache/openresearch/repos// # owner/repo from `orx projects` - [ -d "$DIR" ] || git clone https://github.com// "$DIR" - git -C "$DIR" fetch origin && git -C "$DIR" checkout -B orx/ origin/orx/ - # …edit config.yaml under "$DIR": schedule: constant → cosine … - git -C "$DIR" commit -am "cosine LR + warmup" && git -C "$DIR" push - ``` - While you're in the code, **make the run emit the evidence you'll need to judge - it.** Have it write rollout transcripts, per-sample eval breakdowns, generated - text, or summary tables to `.openresearch/artifacts/` (as text — JSONL/CSV/md) — - a directory at the **repo root**, where the run command's working dir points, so - `.openresearch/artifacts/foo.jsonl` is a plain relative path (if your code `cd`s - into a subdir or writes to `/tmp` first, resolve it from the repo root instead). - Those files sync to storage and become readable in step 7 via `orx artifacts` / - `orx artifact`. A run you can only read the tail-log of is far weaker evidence - than one that dumped its rollouts. See "Run artifacts" below. -5. **Launch up to your GPU budget** — one run per ready child, in parallel: - ```sh - orx exp run --gpu H100_SXM --count 1 - ``` -6. **Keep the budget saturated — drive a per-completion loop, not a wait-for-all - barrier.** With a cap of N concurrent runs, you want control back the moment - *any one* run finishes so you can analyze the state of experiments and either refill its slot or stop if no experiment further is needed — not after the whole batch - drains. `orx exp wait --project ` is built for exactly this: it - returns on the **first** completion. Treat it as one **tick** of a loop, where - *you* are the loop body: - - ``` - # after launching your runs, loop until the project is drained: - loop: - orx exp wait --project # sleeps; returns on the first completion - orx runs # SOURCE OF TRUTH: re-read all run states - # for each run now terminal that you haven't handled yet: - # - read its results (step 7) and decide: launch a refill? promote it? stop? - # - launch the next queued child to refill the freed slot (step 5) - # if `exp wait` printed "drained: no runs in flight" → batch is done, break - ``` - - Three things make this robust — follow all of them: - - **`exp wait --project` is a sleep-until-change signal, not the source of - truth.** It only reports completions it observed *during that one call*. A - run that finishes while you're analyzing the previous one is already terminal - by the next call and **won't be reported**. So on every wake, re-read - `orx runs ` and reconcile against the set of runs you've already - handled — act on *every* newly-terminal run, not just the line `exp wait` - printed. (This is the one time you do look at `orx runs` in a loop — as the - reconcile after each wake, **not** as a tight poll in place of `exp wait`.) - - **Re-issue `exp wait` each tick.** One completion → one return → you decide → - you call it again. Don't expect a single `exp wait` to block until everything - is done; that's the failure mode this loop avoids. - - **Terminate on drained.** When no runs are in flight, `exp wait --project` - returns immediately printing `drained: no runs in flight`. That — or seeing - every run terminal in `orx runs` with no more children to launch — is your - exit condition. Don't keep calling it into a timeout. -7. **Analyze each finish as it lands, then iterate.** Do the per-completion read - *inside the loop above*, not deferred to the end — when a run finishes, - **actually read its results** before deciding: `orx artifact EVAL.md`, - `orx chart wandb …`, `orx query …`. To see exactly what a finished node - changed, use the local git diff recipe `orx exp status ` prints (see - "Code diffs — local git"). Don't infer from status alone. Each - completion is a decision point with three moves: - - **Refill** — result is mediocre or inconclusive: launch the next queued child to - keep the GPU budget saturated (step 5). - - **Promote** — result is a clear win: this node becomes the **parent for the next - round**. The next batch of children branch off *it*, not the baseline, so the win - carries forward and the next ideas stack on top of it. This is the move that makes - the tree grow deeper; skipping it is what produces a flat, sweep-only tree. - - **Stop** — goal met, or the branch is exhausted. - - The baseline stays untouched throughout — promotion moves the *focal parent* down the - tree, it never edits the root. - -Stop when the goal is met, or after ~3 consecutive failed or regressed runs. -When you stop, consider writing up the tree as a local markdown report — -fetch `orx skill report` for the folder layout and section structure. Once -written, publish it with `orx report upload ` so it -shows up on the project page (and its public view) with images inline. The -folder should hold `report.md` plus an `images/` subfolder; the markdown -references images by relative path (`![](images/foo.png)`). - -## `orx create-project` — start a new project - -Creates a project in an organization (org ids are printed next to the org names -in `orx projects`), bound to a git repo. The project starts with an **empty -experiment tree** — no baseline yet. Every project is backed by exactly one git -repo; `--repo` picks where that repo comes from: - -```sh -# From an existing repo — yours (bound directly) or any readable repo -# (copied into a fresh repo the platform can write to): -orx create-project --name "NanoGPT speedrun" --repo karpathy/nanoGPT - -# From scratch — a fresh blank repo (just a stub root commit on main): -orx create-project --name "My new idea" -``` - -- `--repo` takes `owner/repo` or a github.com URL. `--branch` (only with - `--repo`) binds a non-default branch — the baseline will branch off it. - `--description` is optional. -- The command prints the project id + repo. **Next step: create the baseline** - (the root node, the control every variant is measured against): - `orx create-experiment --title "Baseline"` (no `--parent`). - Run it once for reference numbers, then hang children off it with - `orx create-experiment --title "" --parent `. -- For a **blank** project the baseline you create starts empty (a stub README): - seed it from existing code before launching runs — for a paper or a known idea - there is almost always a repo that implements it, and starting from that is - faster and a far better control than code written from scratch. See "Seeding - an empty baseline" below. - -## Seeding an empty baseline — start from existing code, not from scratch - -On a **blank** project, the baseline you create (`orx create-experiment`, no -`--parent`) starts as an empty stub (just a `README.md`) — there's no code to -run yet. The right move is almost never to **write the implementation by -hand.** For nearly any paper or idea there is already a repo that implements it, -and seeding the baseline from that repo is faster, more faithful, and a far -better control than something typed from memory. Reproductions should start from -the authors' (or a strong community) implementation, not a blank file. - -This is the one legitimate time you put code *on the baseline itself* (cardinal -rule 1's only exception): it applies **only while the baseline is still the empty -stub.** Once it holds real code, the baseline is frozen — vary code on children -from then on. - -**Find the code to seed from, in priority order:** - -1. **The paper's own repo.** If the project has a paper (`orx project view` shows - it, or you were given an arXiv id), run `orx paper ` — when alphaXiv has a - repo linked it prints `GitHub: ` as the first line. That repo is the - default seed. (Sanity-check the name: the linked repo is the most-starred one - and is occasionally a big framework rather than the paper's own code.) -2. **No repo line, or the wrong repo? Search for one** — a missing `GitHub:` line - means alphaXiv didn't have one indexed, *not* that none exists. Before falling - back to scratch: - - skim the paper's full text for a code/project URL: `orx paper --full` - (authors often link a repo or project page in the body or a footnote); - - search the literature for the method and check related papers' repos: - `orx lit ""` → `orx paper ` on the strongest hits and read - their `GitHub:` lines. -3. **No paper at all (a free-form idea project)?** Treat the idea as the query: - `orx lit ""`, read the most relevant report with `orx paper`, and - seed from the best implementation it points to. Only if a genuine search turns - up nothing usable do you start from a minimal scaffold of your own — and say so - in the baseline's description. - -**Seed the baseline branch from the chosen repo.** Work in the cache-dir clone -(see "Reading & editing a node's code"); replace the stub with the source's code -as one squashed commit, so the baseline keeps clean provenance and stays rooted -on the project repo: - -```sh -DIR=~/.cache/openresearch/repos// # the PROJECT's repo, from `orx projects` -[ -d "$DIR" ] || git clone https://github.com// "$DIR" -git -C "$DIR" fetch origin -git -C "$DIR" checkout -B orx/ origin/orx/ # the baseline's branch - -src=$(mktemp -d) && git clone --depth 1 https://github.com// "$src" -SHA=$(git -C "$src" rev-parse --short HEAD) && rm -rf "$src/.git" -find "$DIR" -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} + # drop the stub -cp -a "$src/." "$DIR/" # lay down the source tree -git -C "$DIR" add -A -git -C "$DIR" commit -m "Seed baseline from /@$SHA" -git -C "$DIR" push -``` - -Then make the baseline runnable and proceed normally: - -- read the seeded code, find its entry point, and set the run command **once**: - `orx exp cmd --set "bash run.sh"` (rule 2's one legitimate `--set`); -- run the baseline first for a control `EVAL.md`, then branch children and vary - code per the auto-research loop. The baseline is **frozen** the moment it holds - real code — shrink to the smallest config that still shows the paper's claim by - editing a **child**, never by trimming the root. +| `orx skill [name]` | Print this overview + the live module index (no args), or print one module / fetch a deeper reference doc by name. | -## `orx create-experiment` — add a node to the tree +## Modules -Adds a node to the experiment tree. `--title` is always required. The node shape -is chosen by flags: - -```sh -# Child node, branched off an existing experiment: -orx create-experiment --title "Larger batch size" --parent - -# Baseline (root) node on the project's bound repo: -orx create-experiment --title "Baseline" - -# Additional baseline (another root) when the project already has one: -orx create-experiment --title "Baseline v2" --baseline -``` - -- `--parent` selects the shape: with `--parent` ⇒ child; without it, on an - **empty project**, ⇒ the baseline (root) on the repo the project is already - bound to. Once a root exists, a parentless create attaches under the oldest - root on local projects (server projects create another baseline); pass - `--baseline` to explicitly add another root — projects may hold multiple - baselines, each the control for its own subtree. The repo a project works - on is chosen when the **project** is created (`orx create-project` or the - web), so there is no `--repo` flag here. -- **A `--parent` child inherits the parent's run command** (and branches off its - code). You do **not** set a run command on the child — keep it and vary the code - on the child's git branch (see "the experiment-tree model" above). -- **Choose the parent to keep the tree descending, not the root.** Before you pass - `--parent`, name what that parent established that this node builds on. The root - is the right parent only for the *first* round; every later round's siblings hang - off the **previous round's winner** (`orx experiments` shows the current shape). - Piling round after round of children onto the root is the flat-fan failure (see - "Shape the tree"). Co-equal options of the same decision are siblings under one - parent — don't chain them into a line either. -- `--description` is optional but **strongly recommended for children**: use it to - record the hypothesis / the concrete change this node makes. It's the node's - free-form notes field (the same one `orx exp desc` reads/writes), and it's how - you and the analysis tools tell sibling variants apart. - -## Running an experiment — `orx exp` + `orx compute` - -Each experiment node has a **run command** (the shell command that trains/evaluates -it) and is launched on **compute** you choose at run time. Compute is *not* stored -on the node — you pick a GPU, a CPU-only instance, or an existing sandbox each time -you launch (local projects may instead carry a default target — see "The default -compute target" below). - -```sh -orx exp status # status, branch, parent, run command, latest run + commit, local diff recipe -orx exp cmd # print the current run command -orx exp cmd --set "bash run.sh" # set it ONCE on the baseline; children inherit it -orx compute # browse GPU offers across all providers (price-sorted) -orx compute --gpu H100_SXM --count 1 # filter by gpu / count -orx compute --provider vast # filter by provider -orx compute --cpu # browse CPU-only offers (price-sorted) -orx exp run --gpu H100_SXM --count 1 [--disk 100] # launch on a NEW GPU instance (RunPod) -orx exp run --gpu H100_SXM --provider vast # launch on another provider's GPU -orx exp run --cpu cpu5c --vcpus 8 # launch on a NEW CPU-only instance -orx exp run --sandbox # launch on an EXISTING node -orx exp cancel # cancel the in-flight run -``` - -Rules and notes: -- **The run command is a fixed contract — set it once on the baseline, then leave - it alone.** Children inherit it (see "the experiment-tree model" above). Don't - `--set` a different command per child, and don't bake swept hyperparameters into - it — vary the **code/config** on a child's git branch instead, so every variant - runs the same command and their `EVAL.md`s stay comparable. The normal reason to - touch a command is the baseline having none yet. -- **Set a run command before launching.** `orx exp run` fails with a pointer to - `orx exp cmd --set` if the node has none. -- **Push your edits before launching.** A run trains the branch's tip **as it is - on GitHub** — so commit and push first (see "Reading & editing a node's code"). As a - safety net, `orx exp run` refuses a child whose branch has **no changes over its - parent** (the tell-tale of "queued before pushing") — push and retry, or pass - `--force` to run the unchanged code deliberately. -- **Pick compute with exactly one of `--gpu`, `--cpu`, or `--sandbox`.** With - `--gpu`, `--count` defaults to `1` and `--disk` to `100` (GB). A new GPU - instance defaults to **RunPod** (the cheapest matching RunPod offer for the - chosen gpu/count); pass `--provider ` to launch from another provider - shown in `orx compute` (e.g. `vast`, `lambda`). New CPU instances are - RunPod-only. Browse valid gpu ids, providers, and prices with `orx compute`. -- **GPU ids are exact enum strings, not family names.** `--gpu H100` is invalid — - the variant suffix is part of the id (`H100_SXM`, `H100_PCIE`, `A100_SXM_80GB`, - `RTX_4090`, …). Use the exact `GPU` column value from `orx compute`; run it - first if unsure. -- **Use `--cpu` for GPU-less work** (data prep, eval harnesses, CPU-bound papers). - The flavor is one of `cpu5c` (compute), `cpu5g` (general), or `cpu5m` (memory); - `--vcpus` is one of `2`, `8`, `32` (default `8`). Browse offers with - `orx compute --cpu`. CPU instances size their disk from the vCPU count, so there - is no `--disk` knob. -- `orx exp run` **queues** the run and returns immediately — it does not wait. - Follow progress with `orx runs ` and `orx logs `, or block - with `orx exp wait` (below). - -### The default compute target (local projects) - -The user may set a **default compute target** in the `orx up` dashboard -(Settings → Compute → Make default); it is machine-wide and applies to every -local project. When one is set, `orx exp run ` with no `--backend` -launches there, with the saved default flavor — omitting the flag is how you -use it (flavor-required backends still need `--flavor` if no default flavor -is saved). When none is set, local launches require an explicit `--backend`; the -compute choice is the user's, so ask. Server projects are unaffected: managed -compute (`--gpu`/`--cpu`/`--sandbox`) stays their default. - -### Running on Hugging Face Jobs — `--backend hf` - -**Managed compute (`--gpu`/`--cpu`/`--sandbox`) is the default. Use -`--backend hf` ONLY when the user explicitly asks for Hugging Face Jobs** -(e.g. "run this on HF", "use my huggingface account"), it is the configured -default target (orx up Settings → Compute), or the project context says to -prefer it. A connected HF token by itself is NOT a signal to switch — it just -means the option exists. When in doubt, launch on managed compute. - -With `--backend hf`, the job runs on the user's own HF account (requires -`HF_TOKEN` in the environment — orgs that connect their HF account in compute -settings get it synced automatically) and is billed there per minute; no -OpenResearch balance is spent. - -```sh -orx exp run --backend hf --flavor a10g-small # one GPU job -orx exp run --backend hf --flavor a100-large --timeout 8h -orx exp run --backend hf --flavor cpu-upgrade --image python:3.12 -``` - -Rules and notes: -- **`--flavor` is required** and replaces `--gpu`/`--cpu`/`--sandbox`. Common - flavors: `t4-small`, `a10g-small`, `a10g-large`, `l4x1`, `l40sx1`, - `a100-large`, `h200` (and `x2/x4/x8` multiples); CPU: `cpu-basic`, - `cpu-upgrade`. Prefer the smallest flavor that fits — same sizing discipline - as managed GPUs. -- **Set `--timeout` to cover the whole run** (default `4h`). HF kills the job - at the timeout; a killed job reads as a failed run. -- The job clones the experiment branch's **GitHub tip** and runs the fixed run - command, same contract as managed runs — commit and push first. Private - repos work automatically: the platform mints a repo-scoped clone token from - the project's connected GitHub app and passes it to the job as a secret. - Never ask the user to provision a `GITHUB_TOKEN`; setting one (env or - project env var) is only an override for repos outside the connected app. -- `--image` overrides the container (default: a CUDA pytorch image on GPU - flavors, `python:3.12` on cpu flavors). Pick an image with your deps baked - in when pip-install time dominates the run. -- Everything downstream is identical: the run appears in the tree, `orx exp - wait` / `orx runs` / `orx logs` work unchanged, and cancel from the web or - `orx exp cancel` reaches the job within a few seconds. A detached - `orx supervise` process mirrors status and logs; don't kill it. - -### Running on Modal — `--backend modal` - -**Same rule as HF: managed compute is the default. Use `--backend modal` ONLY -when the user explicitly asks for Modal** ("run this on Modal", "use my Modal -account") or it is the configured default target. Modal runs on the user's -own Modal account, billed there per second; no OpenResearch balance is spent. -It runs the job in a Modal **Sandbox** (an ephemeral container that scales to -zero when the run ends). - -orx auto-provisions a managed `modal` environment on the first Modal launch (no -pip-install needed). You only need a Modal token — `MODAL_TOKEN_ID` + -`MODAL_TOKEN_SECRET` in the environment (set them as org or project env vars and -they sync to the box automatically), or `modal token new`. - -```sh -orx exp run --backend modal --flavor a10g # one GPU sandbox -orx exp run --backend modal --flavor a100-80gb --timeout 8h -orx exp run --backend modal --flavor h100:2 # 2× H100 -orx exp run --backend modal --flavor cpu --image python:3.12 -``` - -Rules and notes: -- **`--flavor` is required** and replaces `--gpu`/`--cpu`/`--sandbox`. It's a - Modal GPU: `t4`, `l4`, `a10g`, `a100`, `a100-80gb`, `l40s`, `h100`, `h200` - (append `:N` for a count, e.g. `h100:2`); or `cpu` / `cpu-large` for CPU-only. - Prefer the smallest flavor that fits. -- **Set `--timeout` to cover the whole run** (default `4h`). Modal kills the - sandbox at the timeout; a killed sandbox reads as a failed run. -- Same clone contract as HF/managed: the sandbox clones the experiment branch's - **GitHub tip** and runs the fixed command — commit and push first. Private - repos work automatically via the platform's repo-scoped clone token. -- `--image` overrides the container (default: a CUDA pytorch image on GPU - flavors, `python:3.12` on cpu). Pick one with your deps baked in when - pip-install time dominates. -- Everything downstream is identical (`orx exp wait` / `orx runs` / `orx logs`, - cancel from web or `orx exp cancel`). A detached `orx supervise` mirrors - status and logs; don't kill it. - -### Running on your Kubernetes cluster — `--backend k8s` - -**Same rule: use `--backend k8s` ONLY when the user explicitly asks to run on -their cluster** ("run this on k8s", "use our cluster") or it is the -configured default target. Local projects (`orx up`) only for now. Auth -comes from the local kubeconfig — orx never stores cluster credentials; the -context/namespace live in `orx up` Settings → Compute. - -**There are no flavors: the run's shape is a Kubernetes manifest you commit -on the experiment branch** (default `.orx/k8s.yaml`, or `--manifest `). -Inspect the cluster yourself (`kubectl get nodes`) and write whatever the run -needs — a single-pod GPU Job, an Indexed Job spanning nodes with a headless -Service, an auxiliary inference Deployment. The manifest inherits through the -experiment tree like all code; changing it is a commit, visible in the diff. - -```sh -orx exp run --backend k8s # runs .orx/k8s.yaml from the branch tip -orx exp run --backend k8s --manifest infra/run.yaml --timeout 8h -``` - -A minimal manifest: - -```yaml -apiVersion: batch/v1 -kind: Job -metadata: - name: train-{{ORX_RUN}} -spec: - template: - spec: - restartPolicy: Never - containers: - - name: run - image: pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime - command: ["bash", "-c", "$ORX_SCRIPT"] - resources: - requests: { nvidia.com/gpu: "4", cpu: "32", memory: "128Gi" } - limits: { nvidia.com/gpu: "4" } -``` - -The contract orx enforces at submit (loud, before anything runs): -- **Exactly one Job** — its completion/failure is the run's outcome. With - several Jobs, label the primary `orx-primary: "true"`. Other resources - (Services, Deployments, ConfigMaps) ride along; cancel deletes exactly what - the manifest created. -- **Some container of that Job must run `$ORX_SCRIPT`** — the env var orx - injects with the clone-and-run script (branch tip + the experiment's fixed - run command). The manifest shapes *where* the command runs, never *what* - runs. -- Every resource needs `metadata.name` (no `generateName`) and no foreign - `metadata.namespace`. Use `{{ORX_RUN}}` in names — orx substitutes a - run-unique token so re-runs don't collide. -- orx injects run labels, the `orx-env` Secret (synced env + `HF_TOKEN` / - `GITHUB_TOKEN`) on the primary Job's containers, and defaults for - `activeDeadlineSeconds` (from `--timeout`, default 4h; a manifest-set value - wins), `ttlSecondsAfterFinished`, and `backoffLimit: 0`. Auxiliary - resources that need the env reference the `orx-env` Secret themselves. -- The run log follows the primary Job's **leader pod** (completion index 0 - for Indexed Jobs, else its sole pod) — make it print the evidence; other - pods stay reachable via `kubectl logs`. -- Everything downstream is identical (`orx exp wait` / `orx runs` / - `orx logs`, cancel via `orx exp cancel`). A detached `orx supervise` - watches the Job via kubectl; don't kill it. - -### Running on your own box — `--backend ssh` - -**Same rule: use `--backend ssh` ONLY when the user explicitly asks to run on -their own machine/server** ("run this on my box", "use my GPU server") or it -is the configured default target (`--host ` is still required per -launch). Local projects (`orx up`) only for now. It runs the experiment as a -detached background process on a host from your `~/.ssh/config`, over `ssh` — -no scheduler, no container, the host's own environment. - -```sh -orx exp run --backend ssh --host my-gpu-box # ~/.ssh/config alias -``` - -Rules and notes: -- **`--host` is the ssh host alias** (from `~/.ssh/config`) — a machine, not a - hardware shape, so there is no `--flavor` here. See `orx up` Settings → - Compute → SSH (each host has a "Test" button that checks reachability + git). -- Auth is your ssh keys/agent — orx never reads a key, it just shells out to - `ssh `. The host needs `git` and `bash`; it clones the experiment - branch's GitHub tip (private repos via the `GITHUB_TOKEN` passed in the run's - env) and runs the fixed command. Commit and push first, same as the others. -- No `--image` (the host's environment is used as-is) and no `--timeout` (the - process runs until it exits or you cancel). -- The run lives under `~/.orx/runs//` on the host (`run.sh`, `log`, - `pid`, `exit_code`). Cancel from the web or `orx exp cancel` kills the remote - process group. Everything downstream (`orx exp wait` / `runs` / `logs`) is - identical; a detached `orx supervise` polls it over ssh — don't kill it. - -### Running on this machine — `--backend local` - -**Same rule: use `--backend local` ONLY when the user explicitly asks to run -locally** ("run it on this machine", "just run it here") or it is the -configured default target. Local projects (`orx up`) only. It runs the -experiment as a detached background process on the machine running orx — no -scheduler, no container, this machine's own environment. - -```sh -orx exp run --backend local -``` +The detail lives in focused modules — load one with `orx skill ` (the live +list, with one-line descriptions, is printed at the end of `orx skill` output): -Rules and notes: -- **Nothing to pick** — no `--flavor`, `--host`, `--image`, or `--timeout` - (the process runs until it exits or you cancel). The hardware is whatever - this machine has; prefer it for small or CPU-scale runs and use a remote - backend for anything heavy — it shares CPU/RAM/GPU with everything else on - the machine. -- Same clone contract as every backend: the run clones the experiment - branch's GitHub tip into its own run dir (never your checkout) and runs the - fixed command — commit and push first. Never run training directly in your - shell instead: that would be unsupervised and invisible to the dashboard. -- The run lives under `/local-runs//` (`run.sh`, `log`, - `pid`, `exit_code`). Cancel from the web or `orx exp cancel` TERMs the - process group. Everything downstream (`orx exp wait` / `runs` / `logs`) is - identical; a detached `orx supervise` watches it — don't kill it. - -## Spinning up a standalone instance — `orx instance create` - -Provision a persistent instance in an **organization**, not tied to any -experiment — the CLI equivalent of the dashboard's org "Spin up" panel. Use this -for ad-hoc/manual compute (you SSH in yourself); experiment runs use `orx exp run` -instead. - -```sh -orx instance create --gpu H100_SXM --count 1 [--disk 100] # GPU box (cheapest provider) -orx instance create --gpu H100_SXM --provider runpod # pin a provider -orx instance create --cpu cpu5g --vcpus 8 # CPU-only box -``` - -- `` comes from `orx projects` (the `org:` line). The flags mirror - `orx exp run`: exactly one of `--gpu` or `--cpu`; `--count`/`--disk` apply to - `--gpu`, `--vcpus` to `--cpu`. -- Unlike `orx exp run`, omitting `--provider` picks the **cheapest** matching - offer across all providers; pass `--provider ` to pin one. -- The box provisions asynchronously — the command prints its id and current - status; its SSH host appears once it's online. - -## Waiting on runs — `orx exp wait` - -Block until a run changes state — useful when driving a research loop and you want -to act as soon as a run finishes. Two modes, picked by argument: - -```sh -orx exp wait # level trigger: poll this experiment's latest run - # until it reaches a terminal state (done/failed/cancelled) -orx exp wait --project # edge trigger: return when the FIRST run in the - # project COMPLETES (transitions into done/failed/cancelled) -orx exp wait --interval 10 --timeout 3600 # tune polling -``` - -- Pass **exactly one** of `` or `--project` (not both, not neither). -- `--project` is the **budget-loop** primitive: it wakes only on a **completion** - (a run reaching `done`/`failed`/`cancelled`) — i.e. a freed slot. Run *starts*, - new queued runs, and `queued→running` transitions are intentionally ignored, so - it won't wake you on non-events. It returns on the **first** completion — call - it in a loop, one return per tick, and you (not the CLI) decide what to do with - each freed slot. See the per-completion loop under "the experiment-tree model". -- **It's a sleep-until-change signal, not the source of truth.** It reports only - completions it saw *during that one call*; a run that finishes between calls is - already terminal next time and won't be reported. On every return, re-read - `orx runs ` and act on *all* newly-terminal runs — don't treat the - printed line as the complete set, and don't replace `exp wait` with a tight - `orx runs` poll either (use `exp wait` to sleep, `orx runs` to reconcile). -- Call `--project` **while runs are in flight** (right after launching). If every - run is already terminal, there's nothing left to complete, so it returns - immediately printing `drained: no runs in flight` (exit 0) — your loop's - termination signal. -- `--interval` is seconds between polls (default `5`); `--timeout` gives up after - N seconds (default `1800`) and exits **non-zero** so callers can branch on it. - For long training runs, raise `--timeout` (or treat a timeout exit as "nothing - changed yet, loop again") so a wait that simply outlasts the interval isn't - mistaken for an error. -- Progress lines go to **stderr**; the final completion line(s) go to **stdout**, - each as ` -> ` (or ` (new)`), or the - single line `drained: no runs in flight` when nothing was in flight. -- **When a run is `failed`, a `reason:` line follows it.** Compute spin-up - failures (no GPU capacity, provider quota/limit hit, transient provider error) - carry the provider's own message here — the same text the website shows as a - toast. These are usually **transient and retryable**: wait and re-launch the - same run, or pick a different GPU/provider, rather than treating the experiment - as a dead end. If the run instead failed *after* the box came up, the `reason:` - line points at `orx logs `, where the traceback/OOM/setup error lives. - The same `reason:` line appears under `orx exp status ` and beneath the - `orx runs ` table. - -## Experiment description / notes — `orx exp desc` - -Each experiment node carries a free-form **description** (markdown) — the same -field set by `create-experiment --description`. Use it for notes: observations, -hypotheses, or a running summary. It is a whole-document field: writing -overwrites whatever was there. - -```sh -orx exp desc # print the description to stdout (empty → hint on stderr) -orx exp desc --set "tried lr=3e-4, diverged at step 4k" # overwrite with a short note -cat notes.md | orx exp desc --stdin # overwrite from stdin (long markdown) -``` - -- **Read** prints the text to **stdout** (pipe/redirect-friendly); when empty, a - hint is printed to **stderr** and stdout stays empty. -- **Write** with exactly one of `--set` (inline) or `--stdin` (whole of stdin). - Passing both is an error. Writing **replaces** the entire description — to - append, read first, edit, and write back. -- `` comes from `orx experiments ` (the experiment id, not a run - or project id). - -## Reading & editing a node's code — plain git in the cache-dir clone - -Every experiment node **is a git branch** (`orx/`) on the project's GitHub -repo — `orx create-experiment` prints it. There is no dev box and no `orx` code -command: the **local clone in the cache dir is the standard way to interface -with code** — reading a node's files, diffing what a run changed, and editing — -all with plain git and your own tools. - -**Clone into the openresearch cache dir, not your cwd.** The canonical location, -keyed by repo so the same clone is reused across all of a project's experiments: - -``` -~/.cache/openresearch/repos// -``` - -`/` comes from `orx projects`. **Never** clone into your current -directory or the user's project folders — clones accreting in `~/projects` is the -failure mode this avoids. - -This is how you **realize a child's hypothesis**: after `create-experiment ---parent`, check out the child's branch and make the specific code/config edits -its description calls for — then commit, push, and run. Edit only the files that -idea touches, and **don't touch the run command** (it's inherited; see "the -experiment-tree model" above). Edit children, never the baseline. - -The sync recipe is **idempotent** — run it verbatim whether or not the clone -already exists from a previous session. Always fetch + reset before editing, so a -reused clone is never stale (and the experiment's branch, created server-side, is -fetched even when it's brand-new and not in your local clone yet): - -```sh -DIR=~/.cache/openresearch/repos// - -# Clone once (skips if it already exists), then ALWAYS sync before touching a branch: -[ -d "$DIR" ] || git clone https://github.com// "$DIR" -git -C "$DIR" fetch origin -git -C "$DIR" checkout -B orx/ origin/orx/ # create, or reset to origin if it exists - -# …edit files under "$DIR" with your normal tools… -git -C "$DIR" commit -am "tune lr" # one or more commits — your call -git -C "$DIR" push # push so runs and the tree see the change -``` - -Rules and notes: -- **Always sync first.** `git -C "$DIR" fetch origin && git -C "$DIR" checkout -B - orx/ origin/orx/` is mandatory every time — `-B …origin` creates the - branch or resets an existing local one to the GitHub tip, so a persistent clone - never edits a stale base. It discards uncommitted/unpushed local work on that - branch, which is exactly what you don't want to carry across sessions (the - contract is commit + push before moving on). -- **Auth is your own git.** Clone/push use whatever GitHub credentials your `git` - already has — the repo lives under your account or your org, so access is the - same as any of your repos. If a clone or push fails on auth, authenticate git - for github.com (e.g. `gh auth login` or an SSH key) and retry. -- **Push before you run.** `orx exp run` launches from the branch's pushed tip on - GitHub — uncommitted or unpushed edits won't be in the run. Commit and push - first. -- **Reading another node's code** without disturbing your checkout: that branch is - already in the clone after a fetch — `git -C "$DIR" show origin/orx/:`. - -### Code diffs — local git - -What did a run change vs. its parent experiment? `orx exp status ` prints -the parent's branch, the latest run's full commit SHA, and this exact recipe — -compute the diff locally in the same clone: - -```sh -DIR=~/.cache/openresearch/repos// # owner/repo from `orx projects` -[ -d "$DIR" ] || git clone https://github.com// "$DIR" # cold cache → clone first -git -C "$DIR" fetch origin # ALWAYS fetch first — the commit and parent tip live on GitHub -git -C "$DIR" diff origin/... -``` - -- The **three-dot** form diffs from the merge-base — what the run's branch - changed, not what the parent gained since the fork. That's the cumulative - "what this experiment did to the code" view. -- Fetch first is mandatory: the run's commit and the parent's tip exist on - GitHub and may not be in your clone yet. -- Root experiments have no parent — there is no diff base, by definition. - -## Reading & searching run logs — `orx logs` / `orx search-logs` - -A run's terminal output (the PTY stream) is captured live while it runs and -persisted afterwards. These two commands read and grep it the same way the -OpenResearch assistant's "Read run log" / "Search run log" tools do — byte-range -reads against the persisted log, the live buffer for an in-flight run. - -```sh -orx logs # tail (the end — usually what you want) -orx logs --head # read from the start instead -orx logs --bytes 200000 # raise the byte cap (default 64 KB, max 1 MB) -orx logs --range 4096:8192 # exact byte window [start, end) -``` - -- The log goes to **stdout** (pipe/redirect-friendly); a `[source] bytes a–b of N` - status line goes to **stderr**, noting if content was truncated above/below. -- `` comes from `orx runs ` (the run id, not the experiment id). - -```sh -# Grep a single run, or every run in an experiment: -orx search-logs "CUDA out of memory" --run -orx search-logs "Traceback" --experiment -orx search-logs "loss=nan" --experiment --max 5000 -``` - -- Search is **literal and case-sensitive**. One of `--run` / `--experiment` is required. -- Each hit prints as `:: :`. Feed those - byte offsets straight into `orx logs --range :` to pull the - surrounding context. Results are capped (raise with `--max`). -- **For training metrics, check W&B first.** If the run has a linked W&B run - (`orx wandb `), `orx chart wandb` is usually a better metrics read than - grepping the log (complete history, exact stats, visible trajectory). Logs - remain the right tool for debugging — tracebacks, OOMs, setup failures — and a - fine metrics fallback when W&B isn't linked or doesn't have the key you need. - -## Run artifacts — `orx artifacts` / `orx artifact` - -Beyond the terminal log, a run uploads **text artifacts** (eval outputs, reports, -generated files). - -**Where artifacts come from — you control this.** Every run has a -`.openresearch/artifacts/` directory **at the root of the repo** (the run command -executes with its working dir set to the repo root, so `.openresearch/artifacts/` -is a plain relative path from there — the same tree you cloned and edited in step -4; don't hardcode an absolute `$HOME`-based path). **Anything the run writes there -is synced to cloud storage (~every 10s, plus a final flush when the run ends) and -becomes readable later via `orx artifacts` / `orx artifact`.** Artifacts aren't -magic — they're whatever your experiment code chose to drop in that directory. -`EVAL.md` is just the conventional one (the run command writes it there); the same -mechanism is yours to use for anything you'll want to examine after the fact: -rollout transcripts, per-sample eval breakdowns, generated text, prompt/response -dumps, plots' underlying data, summary tables. When you implement a node's change -(step 4 of the loop), have the code save these to `.openresearch/artifacts/` — -that's how you turn a run into inspectable evidence instead of a one-shot log. - -- **Keep things you'll re-read as text.** The CLI read commands surface **text - artifacts** (JSON, JSONL, CSV, logs, markdown). Binary blobs — checkpoints, model - weights, `.npy`, images — still persist to storage, but you won't be able to read - them back through `orx artifact`, so dump a text-readable companion (e.g. a JSONL - of rollouts alongside the checkpoint) for anything you intend to analyze via CLI. - -```sh -orx artifacts # discover what a run uploaded (KEY + SIZE table) -orx artifact # read one artifact (tail by default) -orx artifact --head --bytes 200000 # from the start, raise the cap -``` - -- Start with `orx artifacts` to list keys, then `orx artifact ` to - read one. Reading an artifact also **caches it for `orx query`** so you can grep - artifact text via SQL. -- `orx artifact` content goes to **stdout**; byte-range and truncation metadata - go to **stderr**. -- For the run's **code diff**, use local git — see "Code diffs — local git" above. - -## Charting W&B metrics — `orx chart wandb` - -Renders a single W&B history metric across one or more linked runs as a PNG line -chart — the same renderer the OpenResearch assistant uses. The server fetches the -W&B history, draws the chart, and the CLI **downloads the PNG to a local file and -prints its path**. Because the output is an image, the intended flow is: run the -command, then **`Read` the printed PNG path to view the chart** with your vision. - -```sh -# One metric, two runs overlaid (label after a colon, optional): -orx chart wandb --metric "train/loss" \ - --run :experiment --run :baseline - -orx chart wandb --metric "train/reward" --run --smoothing 0.9 -orx chart wandb --metric "val/acc" --run --out ./charts -``` - -- `wandb` is a required first positional (the chart kind; only `wandb` is supported today). -- **`--metric`** is one W&B history key (e.g. `train/loss`). List available keys - first via `orx query "select distinct key from wandb_history_keys"`, - or find linked W&B runs with `orx wandb `. -- **`--run`** is repeatable — pass every run you want on the chart in one call - (up to 6). Append `:label` to set the legend label (defaults to the W&B run id). - The run id comes from `orx runs ` (the run id, not the experiment id). -- **`--smoothing`** is an EMA factor `0`–`0.99` (default `0.6`). If a chart looks - too noisy to read, re-run with a higher value (e.g. `0.9`) — don't switch metrics. -- **`--out`** sets the output directory (default `~/.cache/openresearch/charts/`). -- Per-run summary stats (`n`, `min`, `max`, `last`) print to **stdout** alongside - the file path, so you can cite exact numbers without opening the image. Runs - that produced no data are listed under `Skipped:`. -- Requires `WANDB_API_KEY` set in the project or org env vars; otherwise the - command reports that and exits non-zero. Run `orx env ` first to - confirm the key is present (it lists names only, never values). - -## Literature search & paper content — `orx lit` / `orx paper` - -These tap **alphaXiv's public corpus** (2.5M+ arXiv papers: CS, math, physics, -stats, q-bio/fin, EE — not PubMed/biomed). They need **no `orx login`** and hit -alphaXiv hosts, not the OpenResearch API. Use them to ground research in real -literature: find related work, pull a paper's structured report, and only drop to -its full text when you need a specific equation/table/section. - -```sh -orx lit "speculative decoding for LLMs" # ranked hits (id, title, date, votes, abstract) -orx lit "rotary position embeddings" --limit 10 # widen the result set (default 5) -orx lit "kv cache compression" --json # raw JSON for programmatic use -orx paper 2401.12345 # machine-readable report (the default) -orx paper https://arxiv.org/abs/2401.12345 # any arXiv/alphaXiv URL works too -orx paper 2401.12345v2 --full # full extracted text (fallback) -``` - -- **`orx lit`** prints, per hit: ` `, then `<date> · <votes> votes`, - then a truncated abstract. The **`paperId`** is what you feed to `orx paper`. - Results are relevance-ranked, capped at `--limit` (default 5). `--json` emits the - raw hit objects (incl. matched `snippets`) for piping. -- **`orx paper <id>`** writes the report markdown to **stdout** (pipe/redirect-friendly). - The id can be a bare id (`2401.12345`), a versioned id (`2401.12345v2`), or an - arXiv / alphaXiv URL — the CLI normalizes it. -- **The paper's code: `GitHub: <url>` line.** When alphaXiv has a GitHub repo linked - to the paper, `orx paper` prints it as the first line (with `--full` too). If the - report leaves you with questions about *how* something was actually implemented — - exact hyperparameters, training loop details, a trick the paper glosses over — - clone the repo into a temp dir and read the code: - - ```sh - dir=$(mktemp -d) && git clone --depth 1 <githubUrl> "$dir" - ``` - - Inspect it there (grep for the model/optimizer setup, read the configs), and rely - on it as the ground truth for reproducing the paper. No line means no repo is - linked. Note the linked repo is the most-starred one associated with the paper — - occasionally a big framework rather than the paper's own code; sanity-check the - repo name before leaning on it. -- **Report first, full text only when needed.** The default report is a compact - (~10 KB) structured analysis and is enough for most questions. Reach for `--full` - only when the report is missing a specific detail — it returns the entire paper. -- **404s are normal answers, not errors of yours.** A paper whose report hasn't been - generated yet exits non-zero with a hint to try `--full`; one with no extracted - text yet points you at the arXiv PDF. Try `--full`, then the PDF, before giving up. -- Override hosts with `ALPHAXIV_API_URL` (search) and `ALPHAXIV_WEB_URL` (paper docs) - if you ever need to point elsewhere. - -**Grounding a research loop in literature.** Before forming hypotheses for a project -(step 2 of the auto-research loop), search the literature for prior art on the knob -you're about to vary, pull the most relevant report, and let it inform the change you -write into a child's description: - -```sh -orx lit "learning rate warmup schedules transformers" --limit 5 -orx paper <bestPaperId> # read its report; cite the idea in the child's --description -``` - -## `orx query` — important - -The query runs against a **DuckDB "evidence" schema**, which is NOT the same -shape as the REST objects returned by `orx experiments` / `orx runs`. Don't -guess column names from what the other commands display — write queries against -the exact columns below. - -The two tables you'll hit first, with their **full** column lists: - -``` -experiments(id, project_id, parent_experiment_id, slug, title, description, - analysis, run_command, sandbox_id, updated_at) -runs(id, experiment_id, command, status, commit_sha, log_key, sandbox_id, - result_markdown, updated_at) -``` - -The guesses that look right but aren't: - -- **Experiments have no `status` — anywhere.** Status is a *run* property - (`runs.status`). To get "the experiment's status", join its runs: - ```sh - orx query <projectId> "select e.title, r.status, r.updated_at from experiments e left join runs r on r.experiment_id = e.id order by e.title, r.updated_at desc" - ``` -- The parent column is **`parent_experiment_id`**, not `parent_id`. -- There is **no `branch` column** — the git branch is derived from the slug - (`orx/<slug>`). - -There is also a unified **`entities` view** (projects, experiments, runs, and -sandboxes as one table) — handy for tree/graph questions: - -``` -entities(id, type, entity_id, entity_type, project_id, parent_id, parent_type, - parent_entity_id, parent_entity_type, title, name, slug, status, - description, analysis, run_command, updated_at) -``` - -Caveat: its `status` column is populated **only for run and sandbox rows** — -it's NULL for experiments (see above), so don't read it off experiment rows. -For an experiment row, `parent_id` is the parent experiment (or the project, -for the baseline). - -For any table not listed here, discover the real schema before writing queries: - -```sh -orx query <projectId> "select table_name, column_name from information_schema.columns order by 1, 2" -``` - -The full schema, table-by-table guidance, and worked examples live in the -canonical project-query skill — fetch it before doing anything non-trivial: - -```sh -orx skill project-query # the schema + workflow guide -orx skill project-query/references/runs-and-results # runs, metrics, results -orx skill project-query/references/run-diffs # code diffs per run -orx skill project-query/references/text-evidence # logs, artifacts, files -orx skill project-query/references/project-overview # high-level project shape -orx skill report # write a local markdown research report (with charts) -``` +- **orx-experiment-tree** — the experiment-tree model, the auto-research loop, and `orx exp desc`. +- **orx-create** — create a project, seed an empty baseline, add experiment nodes. +- **orx-compute** / **orx-compute-k8s** — launch runs on compute; the k8s manifest contract. +- **orx-git** — read, edit, and diff a node's code with plain git. +- **orx-evidence** — logs, search-logs, artifacts, W&B charts, and the `orx query` evidence DB. +- **orx-reports** — write and publish research reports. +- **orx-lit** — literature search and paper content. -These are the same skill docs the OpenResearch assistant reads. Run -`orx skill` with no path to re-print this overview; the list of fetchable skills -is also shown there when the API is reachable. +Deeper API-served references (the project-query schema and worked examples, the +report writing guide) are fetchable too — `orx skill` lists them at the end when +the API is reachable. ## Typical workflow @@ -1101,12 +150,11 @@ Orienting in a project (read-only discovery): ```sh orx projects # find the project id orx experiments <projectId> # see the tree, pick an experiment id -orx skill project-query # learn the evidence schema -orx query <projectId> "select title from experiments limit 10" +orx skill experiment-tree # the model + the auto-research loop orx runs <projectId> # find a run id orx logs <runId> # read its output ``` To actually **drive** a project toward a goal — branch children off the baseline, -edit each child's code on its git branch, and keep the GPU budget saturated — follow -the auto-research loop in "the experiment-tree model" above. +edit each child's code on its git branch, and keep the GPU budget saturated — +follow the auto-research loop in the `orx-experiment-tree` module. diff --git a/agent-skills/compute-k8s.md b/agent-skills/compute-k8s.md new file mode 100644 index 0000000..66cc3e7 --- /dev/null +++ b/agent-skills/compute-k8s.md @@ -0,0 +1,65 @@ +**Use `--backend k8s` ONLY when the user explicitly asks to run on their +cluster** ("run this on k8s", "use our cluster") or it is the configured +default target. Local projects (`orx up`) only for now. Auth comes from the +local kubeconfig — orx never stores cluster credentials; the context/namespace +live in `orx up` Settings → Compute. + +**There are no flavors: the run's shape is a Kubernetes manifest you commit +on the experiment branch** (default `.orx/k8s.yaml`, or `--manifest <path>`). +Inspect the cluster yourself (`kubectl get nodes`, allocatable resources, GPU +products) and write whatever the run needs — a single-pod GPU Job, an Indexed +Job spanning nodes with a headless Service, an auxiliary inference Deployment. +The manifest inherits through the experiment tree like all code; changing it is +a commit, visible in the diff like any experimental variable. + +```sh +orx exp run <expId> --backend k8s # runs .orx/k8s.yaml from the branch tip +orx exp run <expId> --backend k8s --manifest infra/run.yaml --timeout 8h +``` + +A minimal manifest: + +```yaml +apiVersion: batch/v1 +kind: Job +metadata: + name: train-{{ORX_RUN}} +spec: + template: + spec: + restartPolicy: Never + containers: + - name: run + image: pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime + command: ["bash", "-c", "$ORX_SCRIPT"] + resources: + requests: { nvidia.com/gpu: "4", cpu: "32", memory: "128Gi" } + limits: { nvidia.com/gpu: "4" } +``` + +The contract orx enforces at submit (loud, before anything runs): +- **Exactly one Job** — its completion/failure is the run's outcome. With + several Jobs, label the primary `orx-primary: "true"`. Other resources + (Services, Deployments, ConfigMaps) ride along; cancel deletes exactly what + the manifest created. +- **Some container of that Job must run `$ORX_SCRIPT`** — the env var orx + injects with the clone-and-run script (branch tip + the experiment's fixed + run command). Set `command: ["bash", "-c", "$ORX_SCRIPT"]`. The manifest + shapes *where* the command runs, never *what* runs. +- Every resource needs `metadata.name` (no `generateName`) and no foreign + `metadata.namespace`. Use `{{ORX_RUN}}` in names — orx substitutes a + run-unique token so re-runs don't collide. +- orx injects run labels, the `orx-env` Secret (synced env + `HF_TOKEN` / + `GITHUB_TOKEN`) on the primary Job's containers, and defaults for + `activeDeadlineSeconds` (from `--timeout`, default 4h; a manifest-set value + wins), `ttlSecondsAfterFinished`, and `backoffLimit: 0`. Auxiliary + resources that need the env reference the `orx-env` Secret themselves. +- The run log follows the primary Job's **leader pod** (completion index 0 + for Indexed Jobs, else its sole pod) — make it print the evidence; other + pods stay reachable via `kubectl logs`. Cross-node traffic rides the pod + network — fine for loosely-coupled work (async RL, parameter-server); + tightly-coupled per-step all-reduce wants a fast fabric the cluster may not + have. +- Everything downstream is identical (`orx exp wait` / `orx runs` / + `orx logs`, cancel via `orx exp cancel`). A detached `orx supervise` + watches the Job via kubectl; don't kill it. diff --git a/agent-skills/compute.md b/agent-skills/compute.md new file mode 100644 index 0000000..dad047a --- /dev/null +++ b/agent-skills/compute.md @@ -0,0 +1,284 @@ +Each experiment node has a **run command** (the shell command that trains/evaluates +it) and is launched on **compute** you choose at run time. Compute is *not* stored +on the node — you pick a GPU, a CPU-only instance, or an existing sandbox each time +you launch (local projects may instead carry a default target — see "The default +compute target" below). + +```sh +orx exp status <expId> # status, branch, parent, run command, latest run + commit, local diff recipe +orx exp cmd <expId> # print the current run command +orx exp cmd <baseId> --set "bash run.sh" # set it ONCE on the baseline; children inherit it +orx compute # browse GPU offers across all providers (price-sorted) +orx compute --gpu H100_SXM --count 1 # filter by gpu / count +orx compute --provider vast # filter by provider +orx compute --cpu # browse CPU-only offers (price-sorted) +orx exp run <expId> --gpu H100_SXM --count 1 [--disk 100] # launch on a NEW GPU instance (RunPod) +orx exp run <expId> --gpu H100_SXM --provider vast # launch on another provider's GPU +orx exp run <expId> --cpu cpu5c --vcpus 8 # launch on a NEW CPU-only instance +orx exp run <expId> --sandbox <sandboxId> # launch on an EXISTING node +orx exp cancel <expId> # cancel the in-flight run +``` + +Rules and notes: +- **The run command is a fixed contract — set it once on the baseline, then leave + it alone.** Children inherit it (see the `orx-experiment-tree` skill). Don't + `--set` a different command per child, and don't bake swept hyperparameters into + it — vary the **code/config** on a child's git branch instead, so every variant + runs the same command and their `EVAL.md`s stay comparable. The normal reason to + touch a command is the baseline having none yet. +- **Set a run command before launching.** `orx exp run` fails with a pointer to + `orx exp cmd --set` if the node has none. +- **Push your edits before launching.** A run trains the branch's tip **as it is + on GitHub** — so commit and push first (see the `orx-git` skill). As a + safety net, `orx exp run` refuses a child whose branch has **no changes over its + parent** (the tell-tale of "queued before pushing") — push and retry, or pass + `--force` to run the unchanged code deliberately. +- **Pick compute with exactly one of `--gpu`, `--cpu`, or `--sandbox`.** With + `--gpu`, `--count` defaults to `1` and `--disk` to `100` (GB). A new GPU + instance defaults to **RunPod** (the cheapest matching RunPod offer for the + chosen gpu/count); pass `--provider <name>` to launch from another provider + shown in `orx compute` (e.g. `vast`, `lambda`). New CPU instances are + RunPod-only. Browse valid gpu ids, providers, and prices with `orx compute`. +- **GPU ids are exact enum strings, not family names.** `--gpu H100` is invalid — + the variant suffix is part of the id (`H100_SXM`, `H100_PCIE`, `A100_SXM_80GB`, + `RTX_4090`, …). Use the exact `GPU` column value from `orx compute`; run it + first if unsure. +- **Use `--cpu` for GPU-less work** (data prep, eval harnesses, CPU-bound papers). + The flavor is one of `cpu5c` (compute), `cpu5g` (general), or `cpu5m` (memory); + `--vcpus` is one of `2`, `8`, `32` (default `8`). Browse offers with + `orx compute --cpu`. CPU instances size their disk from the vCPU count, so there + is no `--disk` knob. +- `orx exp run` **queues** the run and returns immediately — it does not wait. + Follow progress with `orx runs <projectId>` and `orx logs <runId>`, or block + with `orx exp wait` (below). + +## The default compute target (local projects) + +The user may set a **default compute target** in the `orx up` dashboard +(Settings → Compute → Make default); it is machine-wide and applies to every +local project. When one is set, `orx exp run <expId>` with no `--backend` +launches there, with the saved default flavor — omitting the flag is how you +use it (flavor-required backends still need `--flavor` if no default flavor +is saved). When none is set, local launches require an explicit `--backend`; the +compute choice is the user's, so ask. Server projects are unaffected: managed +compute (`--gpu`/`--cpu`/`--sandbox`) stays their default. + +## Running on Hugging Face Jobs — `--backend hf` + +**Managed compute (`--gpu`/`--cpu`/`--sandbox`) is the default. Use +`--backend hf` ONLY when the user explicitly asks for Hugging Face Jobs** +(e.g. "run this on HF", "use my huggingface account"), it is the configured +default target (orx up Settings → Compute), or the project context says to +prefer it. A connected HF token by itself is NOT a signal to switch — it just +means the option exists. When in doubt, launch on managed compute. + +With `--backend hf`, the job runs on the user's own HF account (requires +`HF_TOKEN` in the environment — orgs that connect their HF account in compute +settings get it synced automatically) and is billed there per minute; no +OpenResearch balance is spent. + +```sh +orx exp run <expId> --backend hf --flavor a10g-small # one GPU job +orx exp run <expId> --backend hf --flavor a100-large --timeout 8h +orx exp run <expId> --backend hf --flavor cpu-upgrade --image python:3.12 +``` + +Rules and notes: +- **`--flavor` is required** and replaces `--gpu`/`--cpu`/`--sandbox`. Common + flavors: `t4-small`, `a10g-small`, `a10g-large`, `l4x1`, `l40sx1`, + `a100-large`, `h200` (and `x2/x4/x8` multiples); CPU: `cpu-basic`, + `cpu-upgrade`. Prefer the smallest flavor that fits — same sizing discipline + as managed GPUs. +- **Set `--timeout` to cover the whole run** (default `4h`). HF kills the job + at the timeout; a killed job reads as a failed run. +- The job clones the experiment branch's **GitHub tip** and runs the fixed run + command, same contract as managed runs — commit and push first. Private + repos work automatically: the platform mints a repo-scoped clone token from + the project's connected GitHub app and passes it to the job as a secret. + Never ask the user to provision a `GITHUB_TOKEN`; setting one (env or + project env var) is only an override for repos outside the connected app. +- `--image` overrides the container (default: a CUDA pytorch image on GPU + flavors, `python:3.12` on cpu flavors). Pick an image with your deps baked + in when pip-install time dominates the run. +- Everything downstream is identical: the run appears in the tree, `orx exp + wait` / `orx runs` / `orx logs` work unchanged, and cancel from the web or + `orx exp cancel` reaches the job within a few seconds. A detached + `orx supervise` process mirrors status and logs; don't kill it. + +## Running on Modal — `--backend modal` + +**Same rule as HF: managed compute is the default. Use `--backend modal` ONLY +when the user explicitly asks for Modal** ("run this on Modal", "use my Modal +account") or it is the configured default target. Modal runs on the user's +own Modal account, billed there per second; no OpenResearch balance is spent. +It runs the job in a Modal **Sandbox** (an ephemeral container that scales to +zero when the run ends). + +orx auto-provisions a managed `modal` environment on the first Modal launch (no +pip-install needed). You only need a Modal token — `MODAL_TOKEN_ID` + +`MODAL_TOKEN_SECRET` in the environment (set them as org or project env vars and +they sync to the box automatically), or `modal token new`. + +```sh +orx exp run <expId> --backend modal --flavor a10g # one GPU sandbox +orx exp run <expId> --backend modal --flavor a100-80gb --timeout 8h +orx exp run <expId> --backend modal --flavor h100:2 # 2× H100 +orx exp run <expId> --backend modal --flavor cpu --image python:3.12 +``` + +Rules and notes: +- **`--flavor` is required** and replaces `--gpu`/`--cpu`/`--sandbox`. It's a + Modal GPU: `t4`, `l4`, `a10g`, `a100`, `a100-80gb`, `l40s`, `h100`, `h200` + (append `:N` for a count, e.g. `h100:2`); or `cpu` / `cpu-large` for CPU-only. + Prefer the smallest flavor that fits. +- **Set `--timeout` to cover the whole run** (default `4h`). Modal kills the + sandbox at the timeout; a killed sandbox reads as a failed run. +- Same clone contract as HF/managed: the sandbox clones the experiment branch's + **GitHub tip** and runs the fixed command — commit and push first. Private + repos work automatically via the platform's repo-scoped clone token. +- `--image` overrides the container (default: a CUDA pytorch image on GPU + flavors, `python:3.12` on cpu). Pick one with your deps baked in when + pip-install time dominates. +- Everything downstream is identical (`orx exp wait` / `orx runs` / `orx logs`, + cancel from web or `orx exp cancel`). A detached `orx supervise` mirrors + status and logs; don't kill it. + +## Running on your Kubernetes cluster — `--backend k8s` + +Runs the experiment on your own Kubernetes cluster from a manifest committed on +the experiment branch. The full manifest contract lives in the `orx-compute-k8s` +skill — fetch it (`orx skill compute-k8s`) before your first k8s launch. + +## Running on your own box — `--backend ssh` + +**Same rule: use `--backend ssh` ONLY when the user explicitly asks to run on +their own machine/server** ("run this on my box", "use my GPU server") or it +is the configured default target (`--host <alias>` is still required per +launch). Local projects (`orx up`) only for now. It runs the experiment as a +detached background process on a host from your `~/.ssh/config`, over `ssh` — +no scheduler, no container, the host's own environment. + +```sh +orx exp run <expId> --backend ssh --host my-gpu-box # ~/.ssh/config alias +``` + +Rules and notes: +- **`--host` is the ssh host alias** (from `~/.ssh/config`) — a machine, not a + hardware shape, so there is no `--flavor` here. See `orx up` Settings → + Compute → SSH (each host has a "Test" button that checks reachability + git). +- Auth is your ssh keys/agent — orx never reads a key, it just shells out to + `ssh <alias>`. The host needs `git` and `bash`; it clones the experiment + branch's GitHub tip (private repos via the `GITHUB_TOKEN` passed in the run's + env) and runs the fixed command. Commit and push first, same as the others. +- No `--image` (the host's environment is used as-is) and no `--timeout` (the + process runs until it exits or you cancel). +- The run lives under `~/.orx/runs/<runId>/` on the host (`run.sh`, `log`, + `pid`, `exit_code`). Cancel from the web or `orx exp cancel` kills the remote + process group. Everything downstream (`orx exp wait` / `runs` / `logs`) is + identical; a detached `orx supervise` polls it over ssh — don't kill it. + +## Running on this machine — `--backend local` + +**Same rule: use `--backend local` ONLY when the user explicitly asks to run +locally** ("run it on this machine", "just run it here") or it is the +configured default target. Local projects (`orx up`) only. It runs the +experiment as a detached background process on the machine running orx — no +scheduler, no container, this machine's own environment. + +```sh +orx exp run <expId> --backend local +``` + +Rules and notes: +- **Nothing to pick** — no `--flavor`, `--host`, `--image`, or `--timeout` + (the process runs until it exits or you cancel). The hardware is whatever + this machine has; prefer it for small or CPU-scale runs and use a remote + backend for anything heavy — it shares CPU/RAM/GPU with everything else on + the machine. +- Same clone contract as every backend: the run clones the experiment + branch's GitHub tip into its own run dir (never your checkout) and runs the + fixed command — commit and push first. Never run training directly in your + shell instead: that would be unsupervised and invisible to the dashboard. +- The run lives under `<orx data dir>/local-runs/<runId>/` (`run.sh`, `log`, + `pid`, `exit_code`). Cancel from the web or `orx exp cancel` TERMs the + process group. Everything downstream (`orx exp wait` / `orx runs` / `orx logs`) is + identical; a detached `orx supervise` watches it — don't kill it. + +## Spinning up a standalone instance — `orx instance create` + +Provision a persistent instance in an **organization**, not tied to any +experiment — the CLI equivalent of the dashboard's org "Spin up" panel. Use this +for ad-hoc/manual compute (you SSH in yourself); experiment runs use `orx exp run` +instead. + +```sh +orx instance create <orgId> --gpu H100_SXM --count 1 [--disk 100] # GPU box (cheapest provider) +orx instance create <orgId> --gpu H100_SXM --provider runpod # pin a provider +orx instance create <orgId> --cpu cpu5g --vcpus 8 # CPU-only box +``` + +- `<orgId>` comes from `orx projects` (the `org:` line). The flags mirror + `orx exp run`: exactly one of `--gpu` or `--cpu`; `--count`/`--disk` apply to + `--gpu`, `--vcpus` to `--cpu`. +- Unlike `orx exp run`, omitting `--provider` picks the **cheapest** matching + offer across all providers; pass `--provider <name>` to pin one. +- The box provisions asynchronously — the command prints its id and current + status; its SSH host appears once it's online. + +## Waiting on runs — `orx exp wait` + +Block until a run changes state — useful when driving a research loop and you want +to act as soon as a run finishes. Two modes, picked by argument: + +```sh +orx exp wait <expId> # level trigger: poll this experiment's latest run + # until it reaches a terminal state (done/failed/cancelled) +orx exp wait --project <projectId> # edge trigger: return when the FIRST run in the + # project COMPLETES (transitions into done/failed/cancelled) +orx exp wait <expId> --interval 10 --timeout 3600 # tune polling +``` + +- Pass **exactly one** of `<expId>` or `--project` (not both, not neither). +- `--project` is the **budget-loop** primitive: it wakes only on a **completion** + (a run reaching `done`/`failed`/`cancelled`) — i.e. a freed slot. Run *starts*, + new queued runs, and `queued→running` transitions are intentionally ignored, so + it won't wake you on non-events. It returns on the **first** completion — call + it in a loop, one return per tick, and you (not the CLI) decide what to do with + each freed slot. See the per-completion loop in the `orx-experiment-tree` skill. +- **It's a sleep-until-change signal, not the source of truth.** It reports only + completions it saw *during that one call*; a run that finishes between calls is + already terminal next time and won't be reported. On every return, re-read + `orx runs <projectId>` and act on *all* newly-terminal runs — don't treat the + printed line as the complete set, and don't replace `exp wait` with a tight + `orx runs` poll either (use `exp wait` to sleep, `orx runs` to reconcile). +- Call `--project` **while runs are in flight** (right after launching). If every + run is already terminal, there's nothing left to complete, so it returns + immediately printing `drained: no runs in flight` (exit 0) — your loop's + termination signal. +- `--interval` is seconds between polls (default `5`); `--timeout` gives up after + N seconds (default `1800`) and exits **non-zero** so callers can branch on it. + For long training runs, raise `--timeout` (or treat a timeout exit as "nothing + changed yet, loop again") so a wait that simply outlasts the interval isn't + mistaken for an error. +- Progress lines go to **stderr**; the final completion line(s) go to **stdout**, + each as `<runId> <prev> -> <status>` (or `<runId> <status> (new)`), or the + single line `drained: no runs in flight` when nothing was in flight. +- **When a run is `failed`, a `reason:` line follows it.** Compute spin-up + failures (no GPU capacity, provider quota/limit hit, transient provider error) + carry the provider's own message here — the same text the website shows as a + toast. These are usually **transient and retryable**: wait and re-launch the + same run, or pick a different GPU/provider, rather than treating the experiment + as a dead end. If the run instead failed *after* the box came up, the `reason:` + line points at `orx logs <runId>`, where the traceback/OOM/setup error lives. + The same `reason:` line appears under `orx exp status <expId>` and beneath the + `orx runs <projectId>` table. + +## Sizing compute + +- **Decide GPU vs CPU first.** API-driven evals, data prep, and CPU-bound + papers run fine (and far cheaper) on a CPU flavor. +- **Pick the smallest flavor that fits** the model and a minimal batch; don't + reflexively grab the biggest. +- **Let a real failure escalate you.** OOM or hopelessly-slow → move up a + tier. That's expected, not a mistake. +- Raise `--timeout` (`--timeout 1d`) only for genuinely long runs. diff --git a/agent-skills/create.md b/agent-skills/create.md new file mode 100644 index 0000000..33d2e06 --- /dev/null +++ b/agent-skills/create.md @@ -0,0 +1,133 @@ +## `orx create-project` — start a new project + +Creates a project in an organization (org ids are printed next to the org names +in `orx projects`), bound to a git repo. The project starts with an **empty +experiment tree** — no baseline yet. Every project is backed by exactly one git +repo; `--repo` picks where that repo comes from: + +```sh +# From an existing repo — yours (bound directly) or any readable repo +# (copied into a fresh repo the platform can write to): +orx create-project <orgId> --name "NanoGPT speedrun" --repo karpathy/nanoGPT + +# From scratch — a fresh blank repo (just a stub root commit on main): +orx create-project <orgId> --name "My new idea" +``` + +- `--repo` takes `owner/repo` or a github.com URL. `--branch` (only with + `--repo`) binds a non-default branch — the baseline will branch off it. + `--description` is optional. +- The command prints the project id + repo. **Next step: create the baseline** + (the root node, the control every variant is measured against): + `orx create-experiment <projectId> --title "Baseline"` (no `--parent`). + Run it once for reference numbers, then hang children off it with + `orx create-experiment <projectId> --title "<t>" --parent <baselineId>`. +- For a **blank** project the baseline you create starts empty (a stub README): + seed it from existing code before launching runs — for a paper or a known idea + there is almost always a repo that implements it, and starting from that is + faster and a far better control than code written from scratch. See "Seeding + an empty baseline" below. + +## Seeding an empty baseline — start from existing code, not from scratch + +On a **blank** project, the baseline you create (`orx create-experiment`, no +`--parent`) starts as an empty stub (just a `README.md`) — there's no code to +run yet. The right move is almost never to **write the implementation by +hand.** For nearly any paper or idea there is already a repo that implements it, +and seeding the baseline from that repo is faster, more faithful, and a far +better control than something typed from memory. Reproductions should start from +the authors' (or a strong community) implementation, not a blank file. + +This is the one legitimate time you put code *on the baseline itself* (cardinal +rule 1's only exception): it applies **only while the baseline is still the empty +stub.** Once it holds real code, the baseline is frozen — vary code on children +from then on. + +**Find the code to seed from, in priority order:** + +1. **The paper's own repo.** If the project has a paper (`orx project view` shows + it, or you were given an arXiv id), run `orx paper <id>` — when alphaXiv has a + repo linked it prints `GitHub: <url>` as the first line. That repo is the + default seed. (Sanity-check the name: the linked repo is the most-starred one + and is occasionally a big framework rather than the paper's own code.) +2. **No repo line, or the wrong repo? Search for one** — a missing `GitHub:` line + means alphaXiv didn't have one indexed, *not* that none exists. Before falling + back to scratch: + - skim the paper's full text for a code/project URL: `orx paper <id> --full` + (authors often link a repo or project page in the body or a footnote); + - search the literature for the method and check related papers' repos: + `orx lit "<the method>"` → `orx paper <hitId>` on the strongest hits and read + their `GitHub:` lines. +3. **No paper at all (a free-form idea project)?** Treat the idea as the query: + `orx lit "<the idea>"`, read the most relevant report with `orx paper`, and + seed from the best implementation it points to. Only if a genuine search turns + up nothing usable do you start from a minimal scaffold of your own — and say so + in the baseline's description. + +**Seed the baseline branch from the chosen repo.** Work in the cache-dir clone +(see the `orx-git` skill); replace the stub with the source's code +as one squashed commit, so the baseline keeps clean provenance and stays rooted +on the project repo: + +```sh +DIR=~/.cache/openresearch/repos/<owner>/<repo> # the PROJECT's repo, from `orx projects` +[ -d "$DIR" ] || git clone https://github.com/<owner>/<repo> "$DIR" +git -C "$DIR" fetch origin +git -C "$DIR" checkout -B orx/<baseline-slug> origin/orx/<baseline-slug> # the baseline's branch + +src=$(mktemp -d) && git clone --depth 1 https://github.com/<srcOwner>/<srcRepo> "$src" +SHA=$(git -C "$src" rev-parse --short HEAD) && rm -rf "$src/.git" +find "$DIR" -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} + # drop the stub +cp -a "$src/." "$DIR/" # lay down the source tree +git -C "$DIR" add -A +git -C "$DIR" commit -m "Seed baseline from <srcOwner>/<srcRepo>@$SHA" +git -C "$DIR" push +``` + +Then make the baseline runnable and proceed normally: + +- read the seeded code, find its entry point, and set the run command **once**: + `orx exp cmd <baselineId> --set "bash run.sh"` (rule 2's one legitimate `--set`); +- run the baseline first for a control `EVAL.md`, then branch children and vary + code per the auto-research loop. The baseline is **frozen** the moment it holds + real code — shrink to the smallest config that still shows the paper's claim by + editing a **child**, never by trimming the root. + +## `orx create-experiment` — add a node to the tree + +Adds a node to the experiment tree. `--title` is always required. The node shape +is chosen by flags: + +```sh +# Child node, branched off an existing experiment: +orx create-experiment <projectId> --title "Larger batch size" --parent <experimentId> + +# Baseline (root) node on the project's bound repo: +orx create-experiment <projectId> --title "Baseline" + +# Additional baseline (another root) when the project already has one: +orx create-experiment <projectId> --title "Baseline v2" --baseline +``` + +- `--parent` selects the shape: with `--parent` ⇒ child; without it, on an + **empty project**, ⇒ the baseline (root) on the repo the project is already + bound to. Once a root exists, a parentless create attaches under the oldest + root on local projects (server projects create another baseline); pass + `--baseline` to explicitly add another root — projects may hold multiple + baselines, each the control for its own subtree. The repo a project works + on is chosen when the **project** is created (`orx create-project` or the + web), so there is no `--repo` flag here. +- **A `--parent` child inherits the parent's run command** (and branches off its + code). You do **not** set a run command on the child — keep it and vary the code + on the child's git branch (see the `orx-experiment-tree` skill). +- **Choose the parent to keep the tree descending, not the root.** Before you pass + `--parent`, name what that parent established that this node builds on. The root + is the right parent only for the *first* round; every later round's siblings hang + off the **previous round's winner** (`orx experiments` shows the current shape). + Piling round after round of children onto the root is the flat-fan failure (see + "Shape the tree" in the `orx-experiment-tree` skill). Co-equal options of the + same decision are siblings under one parent — don't chain them into a line either. +- `--description` is optional but **strongly recommended for children**: use it to + record the hypothesis / the concrete change this node makes. It's the node's + free-form notes field (the same one `orx exp desc` reads/writes), and it's how + you and the analysis tools tell sibling variants apart. diff --git a/agent-skills/evidence-cloud.md b/agent-skills/evidence-cloud.md new file mode 100644 index 0000000..332a1aa --- /dev/null +++ b/agent-skills/evidence-cloud.md @@ -0,0 +1,167 @@ +## Reading & searching run logs — `orx logs` / `orx search-logs` + +A run's terminal output (the PTY stream) is captured live while it runs and +persisted afterwards. These two commands read and grep it the same way the +OpenResearch assistant's "Read run log" / "Search run log" tools do — byte-range +reads against the persisted log, the live buffer for an in-flight run. + +```sh +orx logs <runId> # tail (the end — usually what you want) +orx logs <runId> --head # read from the start instead +orx logs <runId> --bytes 200000 # raise the byte cap (default 64 KB, max 1 MB) +orx logs <runId> --range 4096:8192 # exact byte window [start, end) +``` + +- The log goes to **stdout** (pipe/redirect-friendly); a `[source] bytes a–b of N` + status line goes to **stderr**, noting if content was truncated above/below. +- `<runId>` comes from `orx runs <projectId>` (the run id, not the experiment id). + +```sh +# Grep a single run, or every run in an experiment: +orx search-logs <projectId> "CUDA out of memory" --run <runId> +orx search-logs <projectId> "Traceback" --experiment <experimentId> +orx search-logs <projectId> "loss=nan" --experiment <id> --max 5000 +``` + +- Search is **literal and case-sensitive**. One of `--run` / `--experiment` is required. +- Each hit prints as `<run8>:<line>: <text> ← <startByte>:<endByte>`. Feed those + byte offsets straight into `orx logs <runId> --range <start>:<end>` to pull the + surrounding context. Results are capped (raise with `--max`). +- **For training metrics, check W&B first.** If the run has a linked W&B run + (`orx wandb <runId>`), `orx chart wandb` is usually a better metrics read than + grepping the log (complete history, exact stats, visible trajectory). Logs + remain the right tool for debugging — tracebacks, OOMs, setup failures — and a + fine metrics fallback when W&B isn't linked or doesn't have the key you need. + +## Run artifacts — `orx artifacts` / `orx artifact` + +Beyond the terminal log, a run uploads **text artifacts** (eval outputs, reports, +generated files). + +**Where artifacts come from — you control this.** Every run has a +`.openresearch/artifacts/` directory **at the root of the repo** (the run command +executes with its working dir set to the repo root, so `.openresearch/artifacts/` +is a plain relative path from there — the same tree you cloned and edited in step +4; don't hardcode an absolute `$HOME`-based path). **Anything the run writes there +is synced to cloud storage (~every 10s, plus a final flush when the run ends) and +becomes readable later via `orx artifacts` / `orx artifact`.** Artifacts aren't +magic — they're whatever your experiment code chose to drop in that directory. +`EVAL.md` is just the conventional one (the run command writes it there); the same +mechanism is yours to use for anything you'll want to examine after the fact: +rollout transcripts, per-sample eval breakdowns, generated text, prompt/response +dumps, plots' underlying data, summary tables. When you implement a node's change +(step 4 of the loop), have the code save these to `.openresearch/artifacts/` — +that's how you turn a run into inspectable evidence instead of a one-shot log. + +- **Keep things you'll re-read as text.** The CLI read commands surface **text + artifacts** (JSON, JSONL, CSV, logs, markdown). Binary blobs — checkpoints, model + weights, `.npy`, images — still persist to storage, but you won't be able to read + them back through `orx artifact`, so dump a text-readable companion (e.g. a JSONL + of rollouts alongside the checkpoint) for anything you intend to analyze via CLI. + +```sh +orx artifacts <runId> # discover what a run uploaded (KEY + SIZE table) +orx artifact <runId> <key> # read one artifact (tail by default) +orx artifact <runId> <key> --head --bytes 200000 # from the start, raise the cap +``` + +- Start with `orx artifacts` to list keys, then `orx artifact <runId> <key>` to + read one. Reading an artifact also **caches it for `orx query`** so you can grep + artifact text via SQL. +- `orx artifact` content goes to **stdout**; byte-range and truncation metadata + go to **stderr**. +- For the run's **code diff**, use local git — see the `orx-git` skill. + +## Charting W&B metrics — `orx chart wandb` + +Renders a single W&B history metric across one or more linked runs as a PNG line +chart — the same renderer the OpenResearch assistant uses. The server fetches the +W&B history, draws the chart, and the CLI **downloads the PNG to a local file and +prints its path**. Because the output is an image, the intended flow is: run the +command, then **`Read` the printed PNG path to view the chart** with your vision. + +```sh +# One metric, two runs overlaid (label after a colon, optional): +orx chart wandb <projectId> --metric "train/loss" \ + --run <runId>:experiment --run <baselineRunId>:baseline + +orx chart wandb <projectId> --metric "train/reward" --run <runId> --smoothing 0.9 +orx chart wandb <projectId> --metric "val/acc" --run <runId> --out ./charts +``` + +- `wandb` is a required first positional (the chart kind; only `wandb` is supported today). +- **`--metric`** is one W&B history key (e.g. `train/loss`). List available keys + first via `orx query <projectId> "select distinct key from wandb_history_keys"`, + or find linked W&B runs with `orx wandb <runId>`. +- **`--run`** is repeatable — pass every run you want on the chart in one call + (up to 6). Append `:label` to set the legend label (defaults to the W&B run id). + The run id comes from `orx runs <projectId>` (the run id, not the experiment id). +- **`--smoothing`** is an EMA factor `0`–`0.99` (default `0.6`). If a chart looks + too noisy to read, re-run with a higher value (e.g. `0.9`) — don't switch metrics. +- **`--out`** sets the output directory (default `~/.cache/openresearch/charts/`). +- Per-run summary stats (`n`, `min`, `max`, `last`) print to **stdout** alongside + the file path, so you can cite exact numbers without opening the image. Runs + that produced no data are listed under `Skipped:`. +- Requires `WANDB_API_KEY` set in the project or org env vars; otherwise the + command reports that and exits non-zero. Run `orx env <projectId>` first to + confirm the key is present (it lists names only, never values). + +## `orx query` — the evidence DB + +The query runs against a **DuckDB "evidence" schema**, which is NOT the same +shape as the REST objects returned by `orx experiments` / `orx runs`. Don't +guess column names from what the other commands display — write queries against +the exact columns below. + +The two tables you'll hit first, with their **full** column lists: + +``` +experiments(id, project_id, parent_experiment_id, slug, title, description, + analysis, run_command, sandbox_id, updated_at) +runs(id, experiment_id, command, status, commit_sha, log_key, sandbox_id, + result_markdown, updated_at) +``` + +The guesses that look right but aren't: + +- **Experiments have no `status` — anywhere.** Status is a *run* property + (`runs.status`). To get "the experiment's status", join its runs: + ```sh + orx query <projectId> "select e.title, r.status, r.updated_at from experiments e left join runs r on r.experiment_id = e.id order by e.title, r.updated_at desc" + ``` +- The parent column is **`parent_experiment_id`**, not `parent_id`. +- There is **no `branch` column** — the git branch is derived from the slug + (`orx/<slug>`). + +There is also a unified **`entities` view** (projects, experiments, runs, and +sandboxes as one table) — handy for tree/graph questions: + +``` +entities(id, type, entity_id, entity_type, project_id, parent_id, parent_type, + parent_entity_id, parent_entity_type, title, name, slug, status, + description, analysis, run_command, updated_at) +``` + +Caveat: its `status` column is populated **only for run and sandbox rows** — +it's NULL for experiments (see above), so don't read it off experiment rows. +For an experiment row, `parent_id` is the parent experiment (or the project, +for the baseline). + +For any table not listed here, discover the real schema before writing queries: + +```sh +orx query <projectId> "select table_name, column_name from information_schema.columns order by 1, 2" +``` + +The full schema, table-by-table guidance, and worked examples live in the +canonical project-query skill — fetch it before doing anything non-trivial: + +```sh +orx skill project-query # the schema + workflow guide +orx skill project-query/references/runs-and-results # runs, metrics, results +orx skill project-query/references/run-diffs # code diffs per run +orx skill project-query/references/text-evidence # logs, artifacts, files +orx skill project-query/references/project-overview # high-level project shape +``` + +These are the same skill docs the OpenResearch assistant reads. diff --git a/agent-skills/evidence-local.md b/agent-skills/evidence-local.md new file mode 100644 index 0000000..7d1c297 --- /dev/null +++ b/agent-skills/evidence-local.md @@ -0,0 +1,35 @@ +In local mode (`orx up`) run **logs are the only evidence channel** — there is no +`artifacts`, `artifact`, `query`, `chart`, `search-logs`, or `wandb`. Make the run +command print everything you'll need to judge the result, then read it back with +`orx logs`. + +## Reading run logs — `orx logs` + +A run's terminal output (the PTY stream) is captured live while it runs and +persisted afterwards. + +```sh +orx logs <runId> # tail (the end — usually what you want) +orx logs <runId> --head # read from the start instead +orx logs <runId> --bytes 200000 # raise the byte cap (default 64 KB, max 1 MB) +orx logs <runId> --range 4096:8192 # exact byte window [start, end) +``` + +- The log goes to **stdout** (pipe/redirect-friendly); a `[source] bytes a–b of N` + status line goes to **stderr**, noting if content was truncated above/below. +- `<runId>` comes from `orx runs <projectId>` (the run id, not the experiment id). + +## Make the run print its own evidence + +Run logs are the only evidence channel in local mode. Make the run command +print everything you'll need to stdout — final metrics, an `EVAL.md`-style +summary, key config — and read it back with `orx logs <runId>` (use `--head` / +`--range` for long logs). **If a run's output isn't in its log, it's lost.** + +- Print final metrics and a compact summary block at the end of the run, not just + scattered mid-training lines — that's what you'll tail to compare siblings. +- Echo the key config the run actually used (LR, batch size, seed) so a log alone + tells you which variant it was. +- For a long run, a periodic one-line-per-step metric print keeps the trajectory + visible via `orx logs --range`; a run that only prints a final number hides + whether it was converging or diverging. diff --git a/agent-skills/experiment-tree.md b/agent-skills/experiment-tree.md new file mode 100644 index 0000000..de59223 --- /dev/null +++ b/agent-skills/experiment-tree.md @@ -0,0 +1,186 @@ +A project is a **tree of experiment nodes**. The root (**baseline**) holds the +starting code and a **run command** — the single shell command that trains or +evaluates the node and writes an `EVAL.md` with its results. Every other node is a +**child** branched off a parent, inheriting its code and its run command. The two +rules this depends on — **never edit the baseline** and **the run command + env is +a fixed contract** — are the cardinal rules; everything below assumes them. + +## Shape the tree — stacked bushes, not a flat fan or a noodle + +The single most common way to drive a project badly is to get the **shape** wrong. +There are two opposite failures, and the right shape sits between them: + +``` +FLAT FAN (wrong) NOODLE (wrong) STACKED BUSHES (right) +root root root +├ a ├ b ├ c ... ├ n └ a └ lr-head ┐ round 1: + └ b ├ lr 2e-5 │ a small fan of + └ c └ lr 3e-5 ┘ co-equal options + └ d ... └ winner ── arch-head ┐ round 2 + ├ arch-A │ descends onto + └ arch-B ┘ round 1's winner +``` + +- **Flat fan** (your whole sweep hanging off the root): every result is measured + against the *start*, so wins never accumulate and the tree never makes progress. +- **Noodle** (a long single-child chain): depth manufactured for its own sake — + each step doesn't actually build on the one above it. +- **Stacked bushes** (correct): a *small fan within a round* (the options of one + decision), then **descend onto that round's winner** for the next round. + +**The one rule that produces this shape.** Before you make X a child of Y, name +what Y established that X builds on: + +- **You can name it** ("Y is the LR winner; X keeps that LR and changes the + architecture") → real depth. X is a **child** of Y. Descend. +- **You can't — X and Y are co-equal options you're trying at the same time** + (lr 2e-5 vs lr 3e-5) → they don't build on each other. They're **siblings** in + the same bush. Fan, don't chain. + +So: **width = the open options of one decision** (fan freely — a 3-way LR sweep +*should* be three siblings under a common head); **depth = decisions already +resolved, stacked** (one level down per winner kept). A new *round* never hangs off +the root — it hangs off the previous round's winner. That keeps the tree moving +**downward** as research progresses, without stringing unrelated nodes into a line. + +Re-read `orx experiments` each round and check the shape: a wide row of direct +children off the root with no grandchildren means you're fanning when you should be +descending; a long depth-N chain with no branching means you're chaining co-equal +variants that should have been siblings. + +## The auto-research loop + +To drive a project toward a goal (e.g. "best convergence for d=8") under a fixed +GPU budget, this is the intended flow — do **not** edit the baseline or rewrite the +run command: + +1. **Read the baseline's code.** Clone the project's repo into the cache dir and + read it with your normal tools (see the `orx-git` skill for the path). + See its run command with `orx exp cmd <baseId>` and find where the knobs live + (config files, hyperparameters, model defs). +2. **Form one round's worth of hypotheses** — the co-equal options of a *single* + decision (which LR? which schedule? which init?), each a concrete change you can + make and measure against the others in this round. Don't mix decisions from + different rounds into one batch — that's what produces the flat fan. +3. **Create the round as a bush, and pick its parent deliberately.** All of this + round's options are **siblings under one parent** — the title is the idea, the + description is the concrete change you'll make on that node's branch. The parent is: + - the **baseline**, only for the very first round (nothing has been won yet); or + - the **previous round's confirmed winner**, for every round after — so this + round's changes build *on top of* the last gain instead of resetting to the + start. This is what walks the tree downward (see "Shape the tree" above). + + ```sh + # Round 1 — one decision (the LR), its options fanned off the baseline: + orx create-experiment <projectId> --parent <baseId> --title "LR 2e-5" \ + --description "Set the LR in config.yaml to 2e-5; change nothing else." + orx create-experiment <projectId> --parent <baseId> --title "LR 3e-5" \ + --description "Set the LR in config.yaml to 3e-5; change nothing else." + + # Round 2 — LR 3e-5 won → the next decision (architecture) descends onto it: + orx create-experiment <projectId> --parent <lr3e5WinnerId> --title "Wider MLP" \ + --description "On top of the LR-3e-5 winner, widen the MLP hidden dim 1024→2048 in model.py." + ``` + The child inherits its parent's run command automatically — you don't set it, + and you never give siblings different commands or env vars (cardinal rule 2). +4. **Implement each child's change on its git branch** — `orx create-experiment` + prints the child's branch (`orx/<slug>`); sync the project's clone (in the + openresearch cache dir — see the `orx-git` skill), check the branch out, + edit only the files that idea touches, commit, and push. **Leave the run + command alone:** + ```sh + DIR=~/.cache/openresearch/repos/<owner>/<repo> # owner/repo from `orx projects` + [ -d "$DIR" ] || git clone https://github.com/<owner>/<repo> "$DIR" + git -C "$DIR" fetch origin && git -C "$DIR" checkout -B orx/<child-slug> origin/orx/<child-slug> + # …edit config.yaml under "$DIR": schedule: constant → cosine … + git -C "$DIR" commit -am "cosine LR + warmup" && git -C "$DIR" push + ``` + While you're in the code, **make the run emit the evidence you'll need to judge + it.** Have it write rollout transcripts, per-sample eval breakdowns, generated + text, or summary tables to `.openresearch/artifacts/` (as text — JSONL/CSV/md) — + a directory at the **repo root**, where the run command's working dir points, so + `.openresearch/artifacts/foo.jsonl` is a plain relative path (if your code `cd`s + into a subdir or writes to `/tmp` first, resolve it from the repo root instead). + Those files sync to storage and become readable in step 7 via `orx artifacts` / + `orx artifact`. A run you can only read the tail-log of is far weaker evidence + than one that dumped its rollouts. See the `orx-evidence` skill. +5. **Launch up to your GPU budget** — one run per ready child, in parallel: + ```sh + orx exp run <childId> --gpu H100_SXM --count 1 + ``` +6. **Keep the budget saturated — drive a per-completion loop, not a wait-for-all + barrier.** With a cap of N concurrent runs, you want control back the moment + *any one* run finishes so you can analyze the state of experiments and either refill its slot or stop if no experiment further is needed — not after the whole batch + drains. `orx exp wait --project <projectId>` is built for exactly this: it + returns on the **first** completion. Treat it as one **tick** of a loop, where + *you* are the loop body: + + ``` + # after launching your runs, loop until the project is drained: + loop: + orx exp wait --project <projectId> # sleeps; returns on the first completion + orx runs <projectId> # SOURCE OF TRUTH: re-read all run states + # for each run now terminal that you haven't handled yet: + # - read its results (step 7) and decide: launch a refill? promote it? stop? + # - launch the next queued child to refill the freed slot (step 5) + # if `exp wait` printed "drained: no runs in flight" → batch is done, break + ``` + + Three things make this robust — follow all of them: + - **`exp wait --project` is a sleep-until-change signal, not the source of + truth.** It only reports completions it observed *during that one call*. A + run that finishes while you're analyzing the previous one is already terminal + by the next call and **won't be reported**. So on every wake, re-read + `orx runs <projectId>` and reconcile against the set of runs you've already + handled — act on *every* newly-terminal run, not just the line `exp wait` + printed. (This is the one time you do look at `orx runs` in a loop — as the + reconcile after each wake, **not** as a tight poll in place of `exp wait`.) + - **Re-issue `exp wait` each tick.** One completion → one return → you decide → + you call it again. Don't expect a single `exp wait` to block until everything + is done; that's the failure mode this loop avoids. + - **Terminate on drained.** When no runs are in flight, `exp wait --project` + returns immediately printing `drained: no runs in flight`. That — or seeing + every run terminal in `orx runs` with no more children to launch — is your + exit condition. Don't keep calling it into a timeout. +7. **Analyze each finish as it lands, then iterate.** Do the per-completion read + *inside the loop above*, not deferred to the end — when a run finishes, + **actually read its results** before deciding: `orx artifact <runId> EVAL.md`, + `orx chart wandb …`, `orx query …`. To see exactly what a finished node + changed, use the local git diff recipe `orx exp status <expId>` prints (see + the `orx-git` skill). Don't infer from status alone. Each + completion is a decision point with three moves: + - **Refill** — result is mediocre or inconclusive: launch the next queued child to + keep the GPU budget saturated (step 5). + - **Promote** — result is a clear win: this node becomes the **parent for the next + round**. The next batch of children branch off *it*, not the baseline, so the win + carries forward and the next ideas stack on top of it. This is the move that makes + the tree grow deeper; skipping it is what produces a flat, sweep-only tree. + - **Stop** — goal met, or the branch is exhausted. + + The baseline stays untouched throughout — promotion moves the *focal parent* down the + tree, it never edits the root. + +Stop when the goal is met, or after ~3 consecutive failed or regressed runs. +When you stop, consider writing up the tree as a local markdown report — see the +`orx-reports` skill for the folder layout and section structure. + +## Experiment description / notes — `orx exp desc` + +Each experiment node carries a free-form **description** (markdown) — the same +field set by `create-experiment --description`. Use it for notes: observations, +hypotheses, or a running summary. It is a whole-document field: writing +overwrites whatever was there. + +```sh +orx exp desc <expId> # print the description to stdout (empty → hint on stderr) +orx exp desc <expId> --set "tried lr=3e-4, diverged at step 4k" # overwrite with a short note +cat notes.md | orx exp desc <expId> --stdin # overwrite from stdin (long markdown) +``` + +- **Read** prints the text to **stdout** (pipe/redirect-friendly); when empty, a + hint is printed to **stderr** and stdout stays empty. +- **Write** with exactly one of `--set` (inline) or `--stdin` (whole of stdin). + Passing both is an error. Writing **replaces** the entire description — to + append, read first, edit, and write back. +- `<expId>` comes from `orx experiments <projectId>` (the experiment id, not a run + or project id). diff --git a/agent-skills/git-editing.md b/agent-skills/git-editing.md new file mode 100644 index 0000000..285c861 --- /dev/null +++ b/agent-skills/git-editing.md @@ -0,0 +1,82 @@ +Every experiment node **is a git branch** (`orx/<slug>`) on the project's GitHub +repo — `orx create-experiment` prints it. There is no dev box and no `orx` code +command: the **local clone in the cache dir is the standard way to interface +with code** — reading a node's files, diffing what a run changed, and editing — +all with plain git and your own tools. + +(In a local `orx up` session you already sit in a private git worktree of the +project repo, so you can edit the checked-out branch in place — `git fetch origin +&& git checkout <branch>`, edit, commit, push. The cache-dir clone below is the +flow for everything outside a live session, and for cloud/full-set contexts.) + +**Clone into the openresearch cache dir, not your cwd.** The canonical location, +keyed by repo so the same clone is reused across all of a project's experiments: + +``` +~/.cache/openresearch/repos/<owner>/<repo> +``` + +`<owner>/<repo>` comes from `orx projects`. **Never** clone into your current +directory or the user's project folders — clones accreting in `~/projects` is the +failure mode this avoids. + +This is how you **realize a child's hypothesis**: after `create-experiment +--parent`, check out the child's branch and make the specific code/config edits +its description calls for — then commit, push, and run. Edit only the files that +idea touches, and **don't touch the run command** (it's inherited; see the +`orx-experiment-tree` skill). Edit children, never the baseline. + +The sync recipe is **idempotent** — run it verbatim whether or not the clone +already exists from a previous session. Always fetch + reset before editing, so a +reused clone is never stale (and the experiment's branch, created server-side, is +fetched even when it's brand-new and not in your local clone yet): + +```sh +DIR=~/.cache/openresearch/repos/<owner>/<repo> + +# Clone once (skips if it already exists), then ALWAYS sync before touching a branch: +[ -d "$DIR" ] || git clone https://github.com/<owner>/<repo> "$DIR" +git -C "$DIR" fetch origin +git -C "$DIR" checkout -B orx/<slug> origin/orx/<slug> # create, or reset to origin if it exists + +# …edit files under "$DIR" with your normal tools… +git -C "$DIR" commit -am "tune lr" # one or more commits — your call +git -C "$DIR" push # push so runs and the tree see the change +``` + +Rules and notes: +- **Always sync first.** `git -C "$DIR" fetch origin && git -C "$DIR" checkout -B + orx/<slug> origin/orx/<slug>` is mandatory every time — `-B …origin` creates the + branch or resets an existing local one to the GitHub tip, so a persistent clone + never edits a stale base. It discards uncommitted/unpushed local work on that + branch, which is exactly what you don't want to carry across sessions (the + contract is commit + push before moving on). +- **Auth is your own git.** Clone/push use whatever GitHub credentials your `git` + already has — the repo lives under your account or your org, so access is the + same as any of your repos. If a clone or push fails on auth, authenticate git + for github.com (e.g. `gh auth login` or an SSH key) and retry. +- **Push before you run.** `orx exp run` launches from the branch's pushed tip on + GitHub — uncommitted or unpushed edits won't be in the run. Commit and push + first. +- **Reading another node's code** without disturbing your checkout: that branch is + already in the clone after a fetch — `git -C "$DIR" show origin/orx/<slug>:<path>`. + +## Code diffs — local git + +What did a run change vs. its parent experiment? `orx exp status <expId>` prints +the parent's branch, the latest run's full commit SHA, and this exact recipe — +compute the diff locally in the same clone: + +```sh +DIR=~/.cache/openresearch/repos/<owner>/<repo> # owner/repo from `orx projects` +[ -d "$DIR" ] || git clone https://github.com/<owner>/<repo> "$DIR" # cold cache → clone first +git -C "$DIR" fetch origin # ALWAYS fetch first — the commit and parent tip live on GitHub +git -C "$DIR" diff origin/<parent-branch>...<full-commit-sha> +``` + +- The **three-dot** form diffs from the merge-base — what the run's branch + changed, not what the parent gained since the fork. That's the cumulative + "what this experiment did to the code" view. +- Fetch first is mandatory: the run's commit and the parent's tip exist on + GitHub and may not be in your clone yet. +- Root experiments have no parent — there is no diff base, by definition. diff --git a/agent-skills/lit.md b/agent-skills/lit.md new file mode 100644 index 0000000..5cd7f2a --- /dev/null +++ b/agent-skills/lit.md @@ -0,0 +1,55 @@ +These tap **alphaXiv's public corpus** (2.5M+ arXiv papers: CS, math, physics, +stats, q-bio/fin, EE — not PubMed/biomed). They need **no `orx login`** and hit +alphaXiv hosts, not the OpenResearch API. Use them to ground research in real +literature: find related work, pull a paper's structured report, and only drop to +its full text when you need a specific equation/table/section. + +```sh +orx lit "speculative decoding for LLMs" # ranked hits (id, title, date, votes, abstract) +orx lit "rotary position embeddings" --limit 10 # widen the result set (default 5) +orx lit "kv cache compression" --json # raw JSON for programmatic use +orx paper 2401.12345 # machine-readable report (the default) +orx paper https://arxiv.org/abs/2401.12345 # any arXiv/alphaXiv URL works too +orx paper 2401.12345v2 --full # full extracted text (fallback) +``` + +- **`orx lit`** prints, per hit: `<paperId> <title>`, then `<date> · <votes> votes`, + then a truncated abstract. The **`paperId`** is what you feed to `orx paper`. + Results are relevance-ranked, capped at `--limit` (default 5). `--json` emits the + raw hit objects (incl. matched `snippets`) for piping. +- **`orx paper <id>`** writes the report markdown to **stdout** (pipe/redirect-friendly). + The id can be a bare id (`2401.12345`), a versioned id (`2401.12345v2`), or an + arXiv / alphaXiv URL — the CLI normalizes it. +- **The paper's code: `GitHub: <url>` line.** When alphaXiv has a GitHub repo linked + to the paper, `orx paper` prints it as the first line (with `--full` too). If the + report leaves you with questions about *how* something was actually implemented — + exact hyperparameters, training loop details, a trick the paper glosses over — + clone the repo into a temp dir and read the code: + + ```sh + dir=$(mktemp -d) && git clone --depth 1 <githubUrl> "$dir" + ``` + + Inspect it there (grep for the model/optimizer setup, read the configs), and rely + on it as the ground truth for reproducing the paper. No line means no repo is + linked. Note the linked repo is the most-starred one associated with the paper — + occasionally a big framework rather than the paper's own code; sanity-check the + repo name before leaning on it. +- **Report first, full text only when needed.** The default report is a compact + (~10 KB) structured analysis and is enough for most questions. Reach for `--full` + only when the report is missing a specific detail — it returns the entire paper. +- **404s are normal answers, not errors of yours.** A paper whose report hasn't been + generated yet exits non-zero with a hint to try `--full`; one with no extracted + text yet points you at the arXiv PDF. Try `--full`, then the PDF, before giving up. +- Override hosts with `ALPHAXIV_API_URL` (search) and `ALPHAXIV_WEB_URL` (paper docs) + if you ever need to point elsewhere. + +**Grounding a research loop in literature.** Before forming hypotheses for a project +(step 2 of the auto-research loop), search the literature for prior art on the knob +you're about to vary, pull the most relevant report, and let it inform the change you +write into a child's description: + +```sh +orx lit "learning rate warmup schedules transformers" --limit 5 +orx paper <bestPaperId> # read its report; cite the idea in the child's --description +``` diff --git a/agent-skills/reports-cloud.md b/agent-skills/reports-cloud.md new file mode 100644 index 0000000..5466781 --- /dev/null +++ b/agent-skills/reports-cloud.md @@ -0,0 +1,33 @@ +When a line of work concludes, write up the experiment tree as a local markdown +report and publish it to the project with `orx report upload` — it then shows up +on the project page (and its public view) with images inline. + +## Report folder layout + +The folder holds `report.md` plus an `images/` subfolder; the markdown references +images by relative path (`![](images/foo.png)`). A report's first `# ` heading +becomes its title. + +For the canonical section structure and worked layout, fetch the report skill: + +```sh +orx skill report # write a local markdown research report (with charts) +``` + +## Publishing and reading reports — `orx report` + +```sh +orx report upload <projectId> <folder> [--title "<t>"] # upload report.md + images/ +orx report list <projectId> # list the project's reports +orx report show <projectId> <reportId|slug> # print a report's markdown to stdout +orx report download <projectId> <reportId|slug> <dir> # write report.md + images back locally +``` + +- **`upload`** takes a folder (`report.md` + `images/`); the report appears on the + project page and its public view. `--title` overrides the title (otherwise the + first `# ` heading is used). +- **`list`** shows the project's reports. +- **`show`** prints a report's markdown to **stdout** and works on any public + project — handy for reading others' write-ups. +- **`download`** is the inverse of `upload`: it writes `report.md` plus the + referenced images back into a local folder. diff --git a/agent-skills/reports-local.md b/agent-skills/reports-local.md new file mode 100644 index 0000000..cafffb0 --- /dev/null +++ b/agent-skills/reports-local.md @@ -0,0 +1,21 @@ +In local mode (`orx up`), reports are written **directly into the project's files +dir** — there is no upload step. Anything under the files dir (reports, figures, +data files) appears in the dashboard's Files tab immediately, grouped by +experiment. The files dir path is shown in your session playbook (the "Files dir:" +line at the top). + +When a line of work concludes (or the user asks for a write-up), write a report +whose layout mirrors the experiment tree — every top-level folder is named for an +experiment slug: + +- **Per-experiment output** goes in the folder named for its slug: + `<files-dir>/<experiment-slug>/report.md`, plus an `images/` subfolder for any + figures it references by relative path. One experiment, one folder — its + `report.md` is that experiment's findings. +- **Cross-experiment syntheses** and anything not tied to one node (comparisons, + lit reviews) go under the reserved `project/` namespace as their own report + folders: `<files-dir>/project/<topic>/report.md`. + +A report's first `# ` heading becomes its title. The markdown references images by +relative path (`![](images/foo.png)`). There is no upload step — save the files and +they show up in the Files tab, grouped by experiment. diff --git a/src/commands/install_skills.rs b/src/commands/install_skills.rs index d0c8ded..484d035 100644 --- a/src/commands/install_skills.rs +++ b/src/commands/install_skills.rs @@ -28,25 +28,31 @@ fn installable() -> Vec<Box<dyn Harness>> { .collect() } -/// Write (or overwrite) one harness's shim, creating parent dirs as needed. -/// Overwriting is intentional: re-running keeps the shim current. -async fn write_shim(harness: &dyn Harness) -> Result<PathBuf> { - let path = harness +/// Write (or overwrite) one harness's shim files, creating parent dirs as +/// needed. Overwriting is intentional: re-running keeps the shim current. A +/// harness may write more than one file (Codex: the native skill + a legacy +/// prompt); the primary target is returned first, extras after. +async fn write_shim(harness: &dyn Harness) -> Result<Vec<PathBuf>> { + let primary = harness .skill_target() .ok_or_else(|| anyhow!("{} has no installable skill", harness.name()))?; let shim = harness .skill_shim() .ok_or_else(|| anyhow!("{} has no skill shim", harness.name()))?; - if let Some(parent) = path.parent() { - fs::create_dir_all(parent).await?; + let mut written = Vec::new(); + for (path, contents) in std::iter::once((primary, shim)).chain(harness.extra_skill_targets()) { + if let Some(parent) = path.parent() { + fs::create_dir_all(parent).await?; + } + fs::write(&path, contents).await?; + written.push(path); } - fs::write(&path, shim).await?; - Ok(path) + Ok(written) } /// Non-interactive OpenCode install, for the `orx up` agent bootstrap: the /// spawned opencode discovers `orx` via its skill tool. -pub(crate) async fn install_opencode_shim() -> Result<PathBuf> { +pub(crate) async fn install_opencode_shim() -> Result<Vec<PathBuf>> { let harness = registry() .into_iter() .find(|h| h.id() == "opencode") @@ -88,17 +94,54 @@ pub async fn run(args: crate::InstallSkillsArgs) -> Result<()> { }; for harness in targets { - let path = write_shim(harness).await?; - println!( - "\u{2713} Installed {} skill \u{2192} {}", - harness.name(), - path.display() - ); + for path in write_shim(harness).await? { + println!( + "\u{2713} Installed {} skill \u{2192} {}", + harness.name(), + path.display() + ); + } + if args.full { + for path in write_full_skills(harness).await? { + println!( + "\u{2713} Installed {} skill \u{2192} {}", + harness.name(), + path.display() + ); + } + } } println!("\nYour agent will auto-load it, or you can invoke it with /orx."); Ok(()) } +/// The agent's **global** skills directory — where a native `SKILL.md` skill +/// dir per module goes. Derived from the primary shim target +/// (`<skills-dir>/orx/SKILL.md`), so it tracks each harness's real layout +/// (`~/.claude/skills`, `~/.agents/skills` for Codex, `$XDG/opencode/skills`, +/// `~/.cursor/skills`). +fn global_skills_dir(harness: &dyn Harness) -> Option<PathBuf> { + Some(harness.skill_target()?.parent()?.parent()?.to_path_buf()) +} + +/// Write the full set of modular `orx` skills into the harness's global skills +/// dir (`--full`). Overwrites in place; returns the `SKILL.md` paths written. +async fn write_full_skills(harness: &dyn Harness) -> Result<Vec<PathBuf>> { + use crate::local::agent_skills::{render, skills, SkillSet}; + + let base = global_skills_dir(harness) + .ok_or_else(|| anyhow!("{} has no global skills dir", harness.name()))?; + let mut written = Vec::new(); + for skill in skills(SkillSet::Full) { + let dir = base.join(skill.name); + fs::create_dir_all(&dir).await?; + let path = dir.join("SKILL.md"); + fs::write(&path, render(skill)).await?; + written.push(path); + } + Ok(written) +} + /// The CLI `--agent` alias for a harness. The chat id (`claude-code`) differs /// from the historical CLI word (`claude`), so accept both. fn matches_agent(harness: &dyn Harness, name: &str) -> bool { @@ -120,18 +163,19 @@ fn tilde(path: &Path) -> String { } } -/// The consent prompt's body: one line per detected agent, name → target file. +/// The consent prompt's body: one line per detected agent target file (a +/// harness with more than one — Codex — gets one line per file). fn describe_targets(harnesses: &[&dyn Harness]) -> String { let width = harnesses.iter().map(|h| h.name().len()).max().unwrap_or(0); harnesses .iter() - .filter_map(|h| { - let target = h.skill_target()?; - Some(format!( - " {:<width$} \u{2192} {}", - h.name(), - tilde(&target) - )) + .flat_map(|h| { + let primary = h.skill_target(); + let extras = h.extra_skill_targets(); + primary + .into_iter() + .chain(extras.into_iter().map(|(p, _)| p)) + .map(move |target| format!(" {:<width$} \u{2192} {}", h.name(), tilde(&target))) }) .collect::<Vec<_>>() .join("\n") @@ -173,12 +217,14 @@ pub async fn offer_install_after_login() { } if matches!(answer.trim().to_lowercase().as_str(), "" | "y" | "yes") { for harness in present { - if let Ok(path) = write_shim(harness).await { - println!( - "\u{2713} Installed {} skill \u{2192} {}", - harness.name(), - tilde(&path) - ); + if let Ok(paths) = write_shim(harness).await { + for path in paths { + println!( + "\u{2713} Installed {} skill \u{2192} {}", + harness.name(), + tilde(&path) + ); + } } } } else { @@ -222,4 +268,53 @@ mod tests { assert!(h.config_home().is_some(), "{} missing config home", h.id()); } } + + /// Codex migrated to a native SKILL.md (`~/.agents/skills/orx/SKILL.md`) but + /// still writes the legacy `/orx` prompt alongside — two targets, listed in + /// the consent prompt. + #[test] + fn codex_writes_native_skill_and_legacy_prompt() { + let all = installable(); + let codex = all.iter().find(|h| h.id() == "codex").unwrap().as_ref(); + + let primary = codex.skill_target().unwrap(); + assert!( + primary.ends_with(".agents/skills/orx/SKILL.md"), + "primary target is the native skill, got {}", + primary.display() + ); + let extras = codex.extra_skill_targets(); + assert_eq!(extras.len(), 1, "one legacy prompt"); + assert!( + extras[0].0.ends_with(".codex/prompts/orx.md"), + "legacy prompt path, got {}", + extras[0].0.display() + ); + + let body = describe_targets(&[codex]); + assert_eq!(body.lines().count(), 2, "both codex targets listed"); + } + + /// The `--full` global skills dir is the parent of the harness's skill dir + /// (`~/.claude/skills`, `~/.agents/skills` for codex, `$XDG/opencode/skills`). + #[test] + fn global_skills_dir_is_the_skills_parent() { + let all = installable(); + for h in all.iter().map(Box::as_ref) { + let dir = global_skills_dir(h).unwrap(); + // The primary shim target sits at <dir>/orx/SKILL.md. + assert_eq!( + h.skill_target().unwrap(), + dir.join("orx").join("SKILL.md"), + "{} global skills dir mismatch", + h.id() + ); + assert!( + dir.ends_with("skills"), + "{} global skills dir should end in `skills`, got {}", + h.id(), + dir.display() + ); + } + } } diff --git a/src/commands/skill.rs b/src/commands/skill.rs index c2b9ecb..346ec71 100644 --- a/src/commands/skill.rs +++ b/src/commands/skill.rs @@ -1,5 +1,6 @@ use crate::config; use crate::error::{require_credentials, Result}; +use crate::local::agent_skills::{self, SkillSet}; // Bundled top-level overview, shipped with the CLI so `orx skill` works without // a round-trip. Deeper references are fetched live from the API. Embedded at @@ -7,28 +8,39 @@ use crate::error::{require_credentials, Result}; const SKILL_MD: &str = include_str!("../../SKILL.md"); pub async fn run(args: crate::SkillArgs) -> Result<()> { - // With a path: fetch the canonical doc from the API (same docs the assistant - // reads), so the schema never drifts from a hand-maintained copy. if let Some(path) = args.path { + // First: a bundled module (with or without the `orx-` prefix). These + // ship in the binary, so they resolve offline and never drift. + if let Some(skill) = agent_skills::find(&path) { + println!("{}", agent_skills::render(skill)); + return Ok(()); + } + // Otherwise fetch the canonical doc from the API (same docs the assistant + // reads), so the schema never drifts from a hand-maintained copy. let creds = require_credentials().await; let content = crate::client::read_skill(&creds, &path).await?; println!("{}", content.content); return Ok(()); } - // No path: print the bundled overview, then list fetchable skills (best - // effort — skip the index if we can't reach the API). + // No path: print the bundled overview, then the bundled module index, then + // list API-fetchable deep references (best effort — skip if unreachable). println!("{}", SKILL_MD); + println!("\nBundled modules (orx skill <name>):"); + for s in agent_skills::skills(SkillSet::Full) { + println!(" {:<20} {}", s.name, s.description); + } + let creds = match config::load_credentials().await? { Some(c) => c, None => return Ok(()), }; - // API unreachable — the bundled overview is enough on its own, so ignore Err. + // API unreachable — the bundled overview + modules are enough, so ignore Err. if let Ok(list) = crate::client::list_skills(&creds).await { if !list.skills.is_empty() { - println!("\nFetchable skills (orx skill <path>):"); + println!("\nFetchable references (orx skill <path>):"); for s in &list.skills { println!(" {}", s.path); } diff --git a/src/local/agent_skills.rs b/src/local/agent_skills.rs new file mode 100644 index 0000000..e5eb324 --- /dev/null +++ b/src/local/agent_skills.rs @@ -0,0 +1,340 @@ +//! Native modular agent skills for `orx`. +//! +//! The monolithic `orx skill` overview (repo-root `SKILL.md`) is factored into a +//! handful of focused modules whose bodies live in the repo `agent-skills/` +//! directory and are embedded in the binary at compile time. Two consumers use +//! them: +//! +//! * **Local `orx up` sessions** get the [`SkillSet::Local`] modules written as +//! native `SKILL.md` skill dirs *into the session worktree* — fresh on every +//! turn, right beside the playbook (see [`ensure_session_skills`]). The harness +//! picks the skills subdir (`.claude/skills`, `.opencode/skills`, +//! `.agents/skills`), so the session's own agent auto-discovers them and never +//! sees drift. +//! * **`orx skill <name>`** resolves a bundled module (with or without the +//! `orx-` prefix) and prints it; the no-arg overview lists the +//! [`SkillSet::Full`] set. `orx install-skills --full` writes the Full set into +//! an agent's global skills dir (the dedicated cloud box). +//! +//! The two sets share the same public skill *names* so docs and references stay +//! stable; a few modules swap their **body** between a local-mode form +//! (logs-only evidence, files-dir reports) and a full/cloud form (artifacts + +//! query + chart; `orx report` upload). The `orx-` prefix on every dir name +//! makes them unmistakable in an agent's skill listing. + +use std::path::Path; + +use crate::error::{anyhow, Result}; + +/// One embedded skill module: its public name (== skill dir name == the `name:` +/// frontmatter field), a one-line description, and the markdown body (no +/// frontmatter — [`render`] generates it). +pub struct AgentSkill { + pub name: &'static str, + pub description: &'static str, + pub body: &'static str, +} + +/// Which set of module bodies to serve. The two sets carry the same public skill +/// names; only a few bodies differ (see the module docs). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum SkillSet { + /// `orx up` local mode: logs-only evidence, files-dir reports, no `create`. + Local, + /// Full/cloud surface: artifacts + query + chart evidence, `orx report` + /// upload, and the project/experiment creation module. + Full, +} + +// --- Module bodies (embedded from the repo `agent-skills/` dir) -------------- + +const COMPUTE: &str = include_str!("../../agent-skills/compute.md"); +const COMPUTE_K8S: &str = include_str!("../../agent-skills/compute-k8s.md"); +const EXPERIMENT_TREE: &str = include_str!("../../agent-skills/experiment-tree.md"); +const GIT_EDITING: &str = include_str!("../../agent-skills/git-editing.md"); +const LIT: &str = include_str!("../../agent-skills/lit.md"); +const CREATE: &str = include_str!("../../agent-skills/create.md"); +const REPORTS_LOCAL: &str = include_str!("../../agent-skills/reports-local.md"); +const REPORTS_CLOUD: &str = include_str!("../../agent-skills/reports-cloud.md"); +const EVIDENCE_LOCAL: &str = include_str!("../../agent-skills/evidence-local.md"); +const EVIDENCE_CLOUD: &str = include_str!("../../agent-skills/evidence-cloud.md"); + +// Descriptions are ≤150 chars (Codex's ambient skill budget is tight): one line, +// no leading `orx-`, phrased so an agent knows when to load the module. + +const S_COMPUTE: AgentSkill = AgentSkill { + name: "orx-compute", + description: "Launch experiment runs on compute with `orx exp run`: managed GPU/CPU, hf/modal/ssh/local backends, sizing, and waiting on runs.", + body: COMPUTE, +}; +const S_COMPUTE_K8S: AgentSkill = AgentSkill { + name: "orx-compute-k8s", + description: "Run an experiment on your Kubernetes cluster (`orx exp run --backend k8s`): the manifest contract orx enforces at submit.", + body: COMPUTE_K8S, +}; +const S_EXPERIMENT_TREE: AgentSkill = AgentSkill { + name: "orx-experiment-tree", + description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc`.", + body: EXPERIMENT_TREE, +}; +const S_GIT: AgentSkill = AgentSkill { + name: "orx-git", + description: "Read, edit, and diff a node's code with plain git in the cache-dir clone (or your session worktree): sync, commit, push before running.", + body: GIT_EDITING, +}; +const S_LIT: AgentSkill = AgentSkill { + name: "orx-lit", + description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`) — ground hypotheses and find code to seed a baseline from.", + body: LIT, +}; +const S_CREATE: AgentSkill = AgentSkill { + name: "orx-create", + description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`).", + body: CREATE, +}; +const S_REPORTS_LOCAL: AgentSkill = AgentSkill { + name: "orx-reports", + description: "Write research reports into the local project's files dir (tree-mirroring folder layout) — they appear in the dashboard's Files tab.", + body: REPORTS_LOCAL, +}; +const S_REPORTS_CLOUD: AgentSkill = AgentSkill { + name: "orx-reports", + description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page.", + body: REPORTS_CLOUD, +}; +const S_EVIDENCE_LOCAL: AgentSkill = AgentSkill { + name: "orx-evidence", + description: "Analyze results in local mode: run logs are the only channel (`orx logs`) — make the run print the evidence you'll need.", + body: EVIDENCE_LOCAL, +}; +const S_EVIDENCE_CLOUD: AgentSkill = AgentSkill { + name: "orx-evidence", + description: "Analyze results: run logs, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB.", + body: EVIDENCE_CLOUD, +}; + +/// The modules for a given set, in a stable order. Local and Full share names; +/// `reports`/`evidence` swap bodies, and `create` is Full-only. +pub fn skills(set: SkillSet) -> Vec<&'static AgentSkill> { + match set { + SkillSet::Local => vec![ + &S_EXPERIMENT_TREE, + &S_GIT, + &S_COMPUTE, + &S_COMPUTE_K8S, + &S_EVIDENCE_LOCAL, + &S_REPORTS_LOCAL, + &S_LIT, + ], + SkillSet::Full => vec![ + &S_CREATE, + &S_EXPERIMENT_TREE, + &S_GIT, + &S_COMPUTE, + &S_COMPUTE_K8S, + &S_EVIDENCE_CLOUD, + &S_REPORTS_CLOUD, + &S_LIT, + ], + } +} + +/// Resolve a bundled Full-set skill by name, accepting both the public name +/// (`orx-compute`) and the bare form (`compute`). `None` for an unknown name — +/// the caller falls back to the live API fetch. +pub fn find(name: &str) -> Option<&'static AgentSkill> { + let want = name.trim(); + skills(SkillSet::Full) + .into_iter() + .find(|s| s.name == want || s.name.strip_prefix("orx-") == Some(want)) +} + +/// Render a skill to a full `SKILL.md`: generated frontmatter + body. The +/// frontmatter `name` matches the dir name; `description` is the module's line. +/// +/// The `description` is emitted as a **JSON-quoted** scalar. Descriptions +/// contain colon-space (`orx exp run`: managed …) and backticks, which are +/// invalid in an unquoted YAML plain scalar — a strict frontmatter parser (the +/// Claude/Codex/OpenCode skill loaders) would error or truncate the value. A +/// JSON string is always a valid YAML flow scalar, so quoting keeps every +/// present and future description safe regardless of punctuation. +pub fn render(skill: &AgentSkill) -> String { + let description = serde_json::to_string(skill.description) + .unwrap_or_else(|_| format!("{:?}", skill.description)); + format!( + "---\nname: {}\ndescription: {}\n---\n\n{}", + skill.name, + description, + skill.body.trim_end(), + ) +} + +/// Write the [`SkillSet::Local`] modules as `<worktree>/<skills_dir_rel>/<name>/SKILL.md`, +/// overwriting every file on every call (same freshness semantics as the +/// playbook — zero drift). Returns `Err` on the first write failure; the caller +/// treats it like a playbook-write error. +pub fn ensure_session_skills(worktree: &Path, skills_dir_rel: &str) -> Result<()> { + let base = worktree.join(skills_dir_rel); + for skill in skills(SkillSet::Local) { + let dir = base.join(skill.name); + std::fs::create_dir_all(&dir) + .map_err(|e| anyhow!("Could not create {}: {}", dir.display(), e))?; + let path = dir.join("SKILL.md"); + std::fs::write(&path, render(skill)) + .map_err(|e| anyhow!("Could not write {}: {}", path.display(), e))?; + } + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::HashSet; + + fn is_valid_name(name: &str) -> bool { + // ^[a-z0-9]+(-[a-z0-9]+)*$ + !name.is_empty() + && name.split('-').all(|seg| { + !seg.is_empty() + && seg + .chars() + .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit()) + }) + } + + #[test] + fn names_are_valid_unique_and_prefixed() { + for set in [SkillSet::Local, SkillSet::Full] { + let mut seen = HashSet::new(); + for s in skills(set) { + assert!( + is_valid_name(s.name), + "{:?}: invalid name {:?}", + set, + s.name + ); + assert!( + s.name.starts_with("orx-"), + "{:?}: name {:?} not orx- prefixed", + set, + s.name + ); + assert!( + seen.insert(s.name), + "{:?}: duplicate name {:?}", + set, + s.name + ); + } + } + } + + #[test] + fn descriptions_are_within_bounds() { + for set in [SkillSet::Local, SkillSet::Full] { + for s in skills(set) { + let len = s.description.chars().count(); + assert!( + (1..=150).contains(&len), + "{:?}: {} description is {} chars (want 1..=150)", + set, + s.name, + len + ); + } + } + } + + #[test] + fn rendered_frontmatter_is_valid_yaml() { + for set in [SkillSet::Local, SkillSet::Full] { + for s in skills(set) { + let rendered = render(s); + let mut lines = rendered.lines(); + assert_eq!(lines.next(), Some("---"), "{} missing opening ---", s.name); + let name_line = lines.next().unwrap_or_default(); + let desc_line = lines.next().unwrap_or_default(); + assert_eq!( + name_line, + format!("name: {}", s.name), + "{} name frontmatter", + s.name + ); + + // The description value must be YAML-safe. `render` emits it as a + // JSON-quoted scalar; strip `description: ` and JSON-decode it — + // this round-trip both proves the quoting is well-formed and + // recovers the exact description. A bare (unquoted) value + // containing `: ` — the bug this guards — would not JSON-decode. + let value = desc_line + .strip_prefix("description: ") + .unwrap_or_else(|| panic!("{} description frontmatter shape", s.name)); + let decoded: String = serde_json::from_str(value).unwrap_or_else(|e| { + panic!("{} description is not a quoted scalar: {e}", s.name) + }); + assert_eq!(decoded, s.description, "{} description round-trip", s.name); + // A quoted scalar is a single physical line — no embedded newline. + assert!( + !s.description.contains('\n'), + "{} description has a newline", + s.name + ); + + assert_eq!(lines.next(), Some("---"), "{} missing closing ---", s.name); + // A non-empty body follows the closing frontmatter fence + // (`\n---\n\n` separates the frontmatter block from the body). + let body = rendered + .split_once("\n---\n\n") + .map(|(_, body)| body) + .unwrap_or(""); + assert!(!body.trim().is_empty(), "{} has an empty body", s.name); + } + } + } + + #[test] + fn find_resolves_prefixed_and_bare() { + assert_eq!(find("orx-compute").map(|s| s.name), Some("orx-compute")); + assert_eq!(find("compute").map(|s| s.name), Some("orx-compute")); + assert_eq!(find("orx-create").map(|s| s.name), Some("orx-create")); + assert_eq!(find("create").map(|s| s.name), Some("orx-create")); + assert!(find("does-not-exist").is_none()); + assert!(find("project-query").is_none()); + } + + #[test] + fn ensure_session_skills_writes_local_set_idempotently() { + let tmp = std::env::temp_dir().join(format!( + "orx-agent-skills-test-{}-{}", + std::process::id(), + uuid::Uuid::new_v4() + )); + let rel = ".claude/skills"; + ensure_session_skills(&tmp, rel).unwrap(); + + let base = tmp.join(rel); + let expected: HashSet<&str> = skills(SkillSet::Local).iter().map(|s| s.name).collect(); + let got: HashSet<String> = std::fs::read_dir(&base) + .unwrap() + .map(|e| e.unwrap().file_name().to_string_lossy().into_owned()) + .collect(); + let got_refs: HashSet<&str> = got.iter().map(String::as_str).collect(); + assert_eq!(got_refs, expected, "wrote exactly the Local-set dirs"); + + for s in skills(SkillSet::Local) { + let path = base.join(s.name).join("SKILL.md"); + let content = std::fs::read_to_string(&path).unwrap(); + assert_eq!(content, render(s), "{} SKILL.md content", s.name); + } + + // Idempotent: a second call overwrites in place and changes nothing. + ensure_session_skills(&tmp, rel).unwrap(); + let got2: HashSet<String> = std::fs::read_dir(&base) + .unwrap() + .map(|e| e.unwrap().file_name().to_string_lossy().into_owned()) + .collect(); + assert_eq!(got2, got, "second call is idempotent"); + + let _ = std::fs::remove_dir_all(&tmp); + } +} diff --git a/src/local/harness/claude.rs b/src/local/harness/claude.rs index fcd10ba..ad72f29 100644 --- a/src/local/harness/claude.rs +++ b/src/local/harness/claude.rs @@ -286,6 +286,10 @@ impl Harness for ClaudeCode { fn skill_shim(&self) -> Option<&'static str> { Some(super::CLAUDE_SKILL) } + + fn session_skills_dir(&self) -> Option<&'static str> { + Some(".claude/skills") + } } /// Session mode → Claude Code `--permission-mode` value. The shared wire ids are @@ -563,8 +567,11 @@ async fn run_turn(ctx: &mut TurnCtx) -> Result<()> { })?; let project = ctx.project.clone(); let session_id = ctx.session_id.clone(); + // The modular orx skills land in the harness's session-skills dir, fresh, + // for this session's agent to auto-load — source of truth is the trait. + let skills_dir = ClaudeCode.session_skills_dir(); let (repo, playbook) = - tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id)) + tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id, skills_dir)) .await .map_err(|e| anyhow!("playbook task failed: {e}"))??; diff --git a/src/local/harness/codex.rs b/src/local/harness/codex.rs index f721b17..b0322a0 100644 --- a/src/local/harness/codex.rs +++ b/src/local/harness/codex.rs @@ -227,11 +227,38 @@ impl Harness for Codex { } fn skill_target(&self) -> Option<PathBuf> { - Some(self.config_home()?.join("prompts").join("orx.md")) + // Codex now speaks native SKILL.md skills (`~/.agents/skills/`); the + // legacy `~/.codex/prompts/` path is deprecated and model-invisible. The + // primary target is the real skill; the legacy prompt still rides along + // via `extra_skill_targets` for older codex versions. + Some( + dirs::home_dir()? + .join(".agents") + .join("skills") + .join("orx") + .join("SKILL.md"), + ) } fn skill_shim(&self) -> Option<&'static str> { - Some(super::CODEX_PROMPT) + // Native SKILL.md format, same body as Claude Code / OpenCode / Cursor. + Some(super::CLAUDE_SKILL) + } + + fn extra_skill_targets(&self) -> Vec<(PathBuf, &'static str)> { + // Keep the legacy `/orx` prompt for codex versions that don't yet read + // `~/.agents/skills/`. + match dirs::home_dir() { + Some(home) => vec![( + home.join(".codex").join("prompts").join("orx.md"), + super::CODEX_PROMPT, + )], + None => Vec::new(), + } + } + + fn session_skills_dir(&self) -> Option<&'static str> { + Some(".agents/skills") } } @@ -586,8 +613,11 @@ async fn run_turn_app_server(ctx: &mut TurnCtx) -> Result<()> { .await?; let project = ctx.project.clone(); let session_id = ctx.session_id.clone(); + // The modular orx skills land in the harness's session-skills dir, fresh, + // for this session's agent to auto-load — source of truth is the trait. + let skills_dir = Codex.session_skills_dir(); let (repo, playbook) = - tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id)) + tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id, skills_dir)) .await .map_err(|e| anyhow!("playbook task failed: {e}"))??; let playbook_md = std::fs::read_to_string(&playbook).unwrap_or_default(); @@ -1042,8 +1072,11 @@ async fn run_turn_exec(ctx: &mut TurnCtx) -> Result<()> { let bin = find_codex_required()?; let project = ctx.project.clone(); let session_id = ctx.session_id.clone(); + // The modular orx skills land in the harness's session-skills dir, fresh, + // for this session's agent to auto-load — source of truth is the trait. + let skills_dir = Codex.session_skills_dir(); let (repo, playbook) = - tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id)) + tokio::task::spawn_blocking(move || ensure_playbook(&project, &session_id, skills_dir)) .await .map_err(|e| anyhow!("playbook task failed: {e}"))??; diff --git a/src/local/harness/mod.rs b/src/local/harness/mod.rs index 56eb78c..0b14414 100644 --- a/src/local/harness/mod.rs +++ b/src/local/harness/mod.rs @@ -21,7 +21,7 @@ mod claude; pub(crate) mod codex; mod cursor; mod detect; -mod opencode; +pub(crate) mod opencode; mod options; mod plan_gate; @@ -148,10 +148,31 @@ pub trait Harness: Send + Sync { None } + /// Additional `(target, contents)` shim files beyond the primary + /// [`skill_target`](Self::skill_target) — for a harness that must write more + /// than one file (Codex writes both the new `~/.agents/skills/orx/SKILL.md` + /// and the legacy `~/.codex/prompts/orx.md` for older versions). Each is + /// written and reported alongside the primary target. Default: none. + fn extra_skill_targets(&self) -> Vec<(PathBuf, &'static str)> { + Vec::new() + } + /// True if the agent looks set up on this machine (its config home exists). fn is_installed_locally(&self) -> bool { self.config_home().map(|h| h.exists()).unwrap_or(false) } + + // --- session-skills capability ---------------------------------------- + + /// The worktree-relative dir this harness discovers native `SKILL.md` skill + /// dirs under, for a **local `orx up` session** — `.claude/skills`, + /// `.opencode/skills`, `.agents/skills`. The modular `orx` skills are + /// written there (fresh every turn, beside the playbook) so the session's + /// own agent auto-loads them. `None` for a harness with no local chat + /// session that can host per-session skills (Cursor). + fn session_skills_dir(&self) -> Option<&'static str> { + None + } } /// The one registry. Every consumer — chat dispatch, detection sweep, the @@ -222,9 +243,10 @@ pub(crate) fn xdg_config_home() -> PathBuf { // stays in the CLI's SKILL.md and is fetched fresh each session, so the // installed shim never drifts as that guide changes — which it does, often. -/// Claude Code / OpenCode / Cursor skill (`skills/orx/SKILL.md`). The frontmatter -/// `description` drives auto-discovery and the `/orx` invocation; the body only -/// points the agent at the live guide. +/// Native `SKILL.md` shim (`skills/orx/SKILL.md`) — Claude Code, OpenCode, +/// Cursor, and now Codex (`~/.agents/skills/orx/`) all read this same format. +/// The frontmatter `description` drives auto-discovery and the `/orx` +/// invocation; the body only points the agent at the live guide. pub(super) const CLAUDE_SKILL: &str = r#"--- name: orx description: Drive automated ML research on OpenResearch with the `orx` CLI — create experiments, launch and monitor runs on GPU compute, analyze results and logs, query the evidence DB, and search literature. Use whenever the user wants to understand, explain, explore, or work on an OpenResearch project, run experiments, do auto-research, or mentions orx or OpenResearch. @@ -242,10 +264,12 @@ start of every session** instead of relying on this file or prior memory. orx skill ``` -This prints the current manual: the cardinal rules, the full command reference, -the experiment-tree model, and the auto-research loop. Read it before taking any -action. For a deeper reference on a specific area, run `orx skill <path>` using -the paths listed at the end of that output. +This prints the current manual — the cardinal rules and a command +quick-reference — followed by a **live index of modules**. Read it before taking +any action. For the detail on a specific area, run `orx skill <name>` to print +that module (e.g. `orx skill experiment-tree`, `orx skill compute`); the same +command fetches deeper API-served references by the paths listed at the end of +the output. ## 2. Carry out the user's research goal @@ -260,15 +284,19 @@ The user must be logged in. If any command reports `Not logged in`, ask them to run `orx login`. "#; -/// Codex prompt (`~/.codex/prompts/orx.md`), invoked as `/orx`. Plain markdown for -/// broad version compatibility; `$ARGUMENTS` is substituted with whatever the user -/// types after the command (and reads fine as-is if their Codex doesn't expand it). +/// Legacy Codex prompt (`~/.codex/prompts/orx.md`), invoked as `/orx`. Codex now +/// reads native SKILL.md skills (`~/.agents/skills/`, gets `CLAUDE_SKILL`); this +/// prompt is still written alongside for older codex versions that don't. +/// Plain markdown for broad version compatibility; `$ARGUMENTS` is substituted +/// with whatever the user types after the command (and reads fine as-is if their +/// Codex doesn't expand it). pub(super) const CODEX_PROMPT: &str = r#"Drive automated ML research on OpenResearch using the `orx` CLI. Start by running `orx skill` to load the current operating manual — the cardinal -rules, the full command reference, the experiment-tree model, and the -auto-research loop. It changes often, so always read it fresh rather than relying -on memory or a cached copy. +rules, a command quick-reference, and a live index of modules. It changes often, +so always read it fresh rather than relying on memory or a cached copy. Pull up a +module's detail with `orx skill <name>` (e.g. `orx skill experiment-tree`, +`orx skill compute`). Then carry out the user's research goal, following the auto-research loop from that guide: create the baseline experiment first when the project is empty, branch diff --git a/src/local/harness/opencode.rs b/src/local/harness/opencode.rs index c26e9ee..3c497e0 100644 --- a/src/local/harness/opencode.rs +++ b/src/local/harness/opencode.rs @@ -145,6 +145,10 @@ impl Harness for OpenCode { // OpenCode reads the same SKILL.md format as Claude Code. Some(super::CLAUDE_SKILL) } + + fn session_skills_dir(&self) -> Option<&'static str> { + Some(".opencode/skills") + } } fn opencode_auth_path() -> Option<PathBuf> { diff --git a/src/local/mod.rs b/src/local/mod.rs index 57fef19..e42091d 100644 --- a/src/local/mod.rs +++ b/src/local/mod.rs @@ -8,6 +8,7 @@ //! in `local_experiments`. CLI commands check the local store FIRST and only //! require credentials on the server path. +pub mod agent_skills; pub mod chat; pub mod codex; pub mod datadir; diff --git a/src/local/opencode.rs b/src/local/opencode.rs index 68badfc..fa04803 100644 --- a/src/local/opencode.rs +++ b/src/local/opencode.rs @@ -188,6 +188,14 @@ fn playbook_md(project: &LocalProject) -> String { hf/modal, `--host` for ssh/slurm; k8s reads the committed manifest; local\n \ takes no flags)." }; + // The modular skills installed into this session's worktree (see + // `agent_skills::ensure_session_skills`). Generated from the Local set so + // the playbook index and the files on disk can never drift. + let skills_list = super::agent_skills::skills(super::agent_skills::SkillSet::Local) + .iter() + .map(|s| format!("- **{}** — {}", s.name, s.description)) + .collect::<Vec<_>>() + .join("\n"); format!( r#"# OpenResearch local agent — {name} @@ -217,6 +225,17 @@ Orient with `orx projects` and `orx runs {id}`. first: `orx create-experiment {id} --title "Baseline"` (no `--parent`). Give it the run command, run it once for reference numbers, then branch children off it. +## Skills + +Focused how-to guides are installed as **native skills for this session** — your +harness auto-loads them, and you can pull one up by name when a task calls for it: + +{skills_list} + +The cardinal rules, command surface, and auto-research loop below are always in +effect; the skills expand the details (backend specifics, the k8s manifest, git +recipes, report layout) so you load them only when you need them. + ## Working alongside other agents Several chat sessions may drive this project at once, each in its own worktree @@ -309,21 +328,11 @@ Carry one goal across many runs: 6. **Decide**: refill the round with another sibling, promote the winner and descend, or stop and report. Write what you learned into `orx exp desc`. -When a line of work concludes (or the user asks for a write-up), write a -report **directly into the files dir**. Its layout mirrors the experiment -tree — every top-level folder is named for an experiment slug: - -- Per-experiment output goes in the folder named for its slug: - `{files}/<experiment-slug>/report.md`, plus an `images/` subfolder for any - figures it references by relative path. One experiment, one folder — its - `report.md` is that experiment's findings. -- Cross-experiment syntheses and anything not tied to one node (comparisons, - lit reviews) go under the reserved `project/` namespace as their own - report folders: `{files}/project/<topic>/report.md`. - -A report's first `# ` heading becomes its title. There is no upload step; -anything under `{files}` (reports, figures, data files) appears in the -dashboard's Files tab immediately, grouped by experiment. +When a line of work concludes (or the user asks for a write-up), write a report +**directly into the files dir** (`{files}`) — no upload step; anything under it +appears in the dashboard's Files tab immediately, grouped by experiment. The +layout mirrors the tree (one folder per experiment slug); the `orx-reports` +skill has the folder structure and section guidance. When the user gives you a research task, see it through this loop — don't stop after a single step or hand back a half-finished attempt. End your turn only @@ -369,83 +378,36 @@ small or CPU-scale runs and use a remote backend for anything heavy. ## Compute backends {backends_intro} -All of them share the same contract — the job clones the experiment branch's -GitHub tip and runs the fixed run command, and everything downstream -(`orx exp wait` / `orx runs` / `orx logs` / `orx exp cancel`) works -identically. A detached `orx supervise` mirrors status and logs; don't kill it. - -| Backend | Runs on | Shape comes from | -|---|---|---| -| `hf` | Hugging Face Jobs — billed per minute to the user's HF account (`HF_TOKEN`) | `--flavor`: `cpu-basic` / `cpu-upgrade` (CPU-only), `t4-small`, `t4-medium`, `l4x1`, `l4x4`, `l40sx1`, `a10g-small`, `a10g-large`, `a100-large`, `h100`, `h200`, … | -| `modal` | Modal Sandboxes — billed per second to the user's Modal account (`MODAL_TOKEN_ID`/`MODAL_TOKEN_SECRET` or `~/.modal.toml`) | `--flavor`: a Modal GPU (`t4`, `l4`, `a10g`, `a100`, `a100-80gb`, `l40s`, `h100`, `h200`; append `:N` for a count, e.g. `h100:2`) or `cpu` / `cpu-large` | -| `k8s` | the user's own Kubernetes cluster — auth from their kubeconfig; context/namespace in Settings → Compute | a **manifest you commit on the experiment branch** (default `.orx/k8s.yaml`, or `--manifest <path>`) — see below | -| `ssh` | a detached process on the user's own box — no scheduler, no container, the host's environment as-is | `--host`: an `~/.ssh/config` host alias | -| `slurm` | a batch job on the user's Slurm cluster, submitted via `sbatch` on the login node over ssh | `--host`: the login node's `~/.ssh/config` alias (defaults from the slurm settings); `--flavor`: a GRES GPU request (`h100:2`; omit for CPU-only) | -| `openresearch` | an **ephemeral OpenResearch box** billed to the user's org (needs `orx login` + a registered SSH key) — provisioned for the run, deleted when it ends; fixed CUDA+PyTorch+uv image | `--flavor`: a GPU id from `orx compute` (`h100_sxm`, `h100_sxm:2`) or a CPU flavor (`cpu5c`/`cpu5g`/`cpu5m`, `cpu5c:32`); plus `[--org <id>] [--disk GB] [--provider P]` | -| `local` | a detached process on **this machine** — no scheduler, no container, this machine's environment as-is | nothing — no flags; the hardware is whatever this machine has | - -- `--timeout` (default `4h`) applies to `hf`/`modal`/`k8s`/`slurm`/ - `openresearch`; set it to cover the whole run — a job killed at the timeout - reads as a failed run. Doesn't apply to `ssh` or `local` (the process runs - until it exits or is cancelled). On k8s a manifest-set - `activeDeadlineSeconds` wins over the flag. -- `--image` overrides the container on `hf`/`modal` (default: CUDA pytorch on - GPU flavors, `python:3.12` on CPU). Doesn't apply to `ssh`/`slurm`/`local` - (the host's own environment), `k8s` (the manifest sets the image), or - `openresearch` (the platform's fixed image). - -### The k8s manifest contract - -There are no flavors or topology flags: **you write plain Kubernetes YAML**, -commit it on the experiment branch, and orx applies it. Inspect the cluster -yourself (`kubectl get nodes`, allocatable resources, GPU products) and write -whatever the run needs — a single-pod 4-GPU Job, an Indexed Job spanning -nodes with a headless Service and downward-API rank env, an auxiliary -inference Deployment. The manifest inherits through the tree like all code, -and changing it is a commit — visible in the diff like any experimental -variable. - -Rules orx enforces at submit (loud, before anything runs): - -- **Exactly one Job** — its completion/failure is the run's outcome. With - several Jobs, label the primary `orx-primary: "true"`. -- **Some container of that Job must run the injected script**: set - `command: ["bash", "-c", "$ORX_SCRIPT"]`. The `ORX_SCRIPT` env var (added - by orx) clones the branch tip and runs the experiment's fixed run command — - the run command stays the contract; the manifest only shapes where it runs. -- Every resource needs `metadata.name` (no `generateName`) and no foreign - `metadata.namespace`. Put `{{{{ORX_RUN}}}}` in names — orx substitutes a - run-unique token so re-runs don't collide. - -orx injects the rest: run labels, the `orx-env` Secret (`envFrom`, holds the -synced API keys + `HF_TOKEN`/`GITHUB_TOKEN`) on the primary Job, and defaults -for `activeDeadlineSeconds`/`ttlSecondsAfterFinished`/`backoffLimit: 0` when -unset. Auxiliary resources that need the env reference the `orx-env` Secret -themselves. Cancel deletes exactly what the manifest created. - -The run log follows the primary Job's **leader pod** (completion index 0 for -Indexed Jobs, else its sole pod) — print everything you'll need to analyze -from there; other pods stay reachable via `kubectl logs`. Cross-node traffic -rides the pod network — fine for loosely-coupled work (async RL, -parameter-server); tightly-coupled per-step all-reduce wants a fast fabric -the cluster may not have. +Backends: `hf` and `modal` (managed SKUs, `--flavor`), `k8s` (a manifest you +commit on the branch), `ssh` and `slurm` (`--host`), `openresearch` (an +ephemeral org box, `--flavor`), and `local` (this machine, no flags). All share +one contract — the job clones the experiment branch's GitHub tip and runs the +fixed run command, and everything downstream (`orx exp wait` / `orx runs` / +`orx logs` / `orx exp cancel`) works identically. A detached `orx supervise` +mirrors status and logs; don't kill it. `--timeout` (default `4h`) applies to +`hf`/`modal`/`k8s`/`slurm`/`openresearch`; `--image` overrides the container on +`hf`/`modal`. + +**Load the specifics before launching on a backend you haven't used this +session:** the `orx-compute` skill has the per-backend flavors, flags, and +sizing discipline; the `orx-compute-k8s` skill has the full manifest contract +orx enforces at submit. Fetch them with `orx skill compute` / `orx skill +compute-k8s` if your harness hasn't surfaced them. ## Sizing compute -- **Decide GPU vs CPU first.** API-driven evals, data prep, and CPU-bound - papers run fine (and far cheaper) on a CPU flavor. -- **Pick the smallest flavor that fits** the model and a minimal batch; don't - reflexively grab the biggest. -- **Let a real failure escalate you.** OOM or hopelessly-slow → move up a - tier. That's expected, not a mistake. -- Raise `--timeout` (`--timeout 1d`) only for genuinely long runs. +Decide GPU vs CPU first (CPU flavors are far cheaper for API-driven evals and +data prep), pick the smallest flavor that fits, and let a real OOM/too-slow +failure escalate you a tier. Per-flavor sizing detail lives in the `orx-compute` +skill. ## Analyzing results Run logs are the only evidence channel in local mode. Make the run command print everything you'll need to stdout — final metrics, an `EVAL.md`-style summary, key config — and read it back with `orx logs <runId>` (use `--head` / -`--range` for long logs). If a run's output isn't in its log, it's lost. +`--range` for long logs). If a run's output isn't in its log, it's lost. The +`orx-evidence` skill expands this. ## Asking the user @@ -470,10 +432,16 @@ plan mode. fn exclude_agent_files(hub: &Path) { let path = hub.join(".git").join("info").join("exclude"); let existing = std::fs::read_to_string(&path).unwrap_or_default(); - let missing: Vec<&str> = ["opencode.json", ".openresearch/"] - .into_iter() - .filter(|entry| !existing.lines().any(|l| l.trim() == *entry)) - .collect(); + let missing: Vec<&str> = [ + "opencode.json", + ".openresearch/", + ".claude/skills/", + ".opencode/skills/", + ".agents/skills/", + ] + .into_iter() + .filter(|entry| !existing.lines().any(|l| l.trim() == *entry)) + .collect(); if missing.is_empty() { return; } @@ -499,7 +467,16 @@ fn exclude_agent_files(hub: &Path) { /// legacy exec: first-turn context). Returns /// `(workdir, playbook)` — the worktree the harness runs in and the playbook /// path inside it. -pub fn ensure_playbook(project: &LocalProject, session_id: &str) -> Result<(PathBuf, PathBuf)> { +/// +/// `session_skills_dir` is the harness's worktree-relative native-skills dir +/// (`.claude/skills`, `.opencode/skills`, `.agents/skills`); when `Some`, the +/// modular `orx` skills are written there too, fresh alongside the playbook, so +/// the session's own agent auto-loads them with zero drift. +pub fn ensure_playbook( + project: &LocalProject, + session_id: &str, + session_skills_dir: Option<&str>, +) -> Result<(PathBuf, PathBuf)> { let workdir = git::ensure_session_worktree( &project.github_owner, &project.github_repo, @@ -513,6 +490,11 @@ pub fn ensure_playbook(project: &LocalProject, session_id: &str) -> Result<(Path } std::fs::write(&playbook, playbook_md(project)) .map_err(|e| anyhow!("Could not write {}: {}", playbook.display(), e))?; + // Modular skills, written fresh beside the playbook (same freshness + // semantics) so this session's agent discovers them natively. + if let Some(dir) = session_skills_dir { + super::agent_skills::ensure_session_skills(&workdir, dir)?; + } // One shared exclude covers every worktree. exclude_agent_files(&git::clone_path( &project.github_owner, @@ -534,7 +516,10 @@ fn write_agent_files( model: Option<&str>, session_id: &str, ) -> Result<(PathBuf, Option<PathBuf>)> { - let (repo, playbook) = ensure_playbook(project, session_id)?; + // Source of truth for the session-skills dir is the harness trait. + use crate::local::harness::Harness; + let skills_dir = crate::local::harness::opencode::OpenCode.session_skills_dir(); + let (repo, playbook) = ensure_playbook(project, session_id, skills_dir)?; let config_override = if git::is_tracked(&repo, "opencode.json") { // Out-of-root config: absolute instructions path (no root to anchor it). let path = repo @@ -805,3 +790,72 @@ impl AgentHost { } } } + +#[cfg(test)] +mod tests { + use super::*; + use crate::local::agent_skills::{self, SkillSet}; + + fn sample_project() -> LocalProject { + LocalProject { + id: "proj_test".into(), + name: "Test Project".into(), + slug: "test-project".into(), + github_owner: "acme".into(), + github_repo: "widget".into(), + baseline_branch: "main".into(), + repo_path: "/tmp/nonexistent".into(), + run_command: None, + paper_id: None, + created_at: 0, + updated_at: 0, + } + } + + /// The playbook's "## Skills" index must list exactly the Local-set skills, + /// in order — regenerate-and-compare so it can never freeze out of sync with + /// `agent_skills::skills` (the same set written into the session worktree). + #[test] + fn playbook_skills_index_matches_local_set() { + let md = playbook_md(&sample_project()); + let expected: Vec<String> = agent_skills::skills(SkillSet::Local) + .iter() + .map(|s| format!("- **{}** — {}", s.name, s.description)) + .collect(); + + // The "## Skills" section body: between the heading and the next `## `. + let after = md + .split("## Skills\n") + .nth(1) + .expect("no ## Skills section"); + let section = after.split("\n## ").next().unwrap(); + + let listed: Vec<String> = section + .lines() + .filter(|l| l.starts_with("- **")) + .map(str::to_string) + .collect(); + assert_eq!( + listed, expected, + "playbook Skills index drifted from Local set" + ); + } + + /// The slimmed playbook keeps its templated conditional logic — the + /// compute-default branch's placeholders must still resolve (no leftover + /// `{...}` braces from a botched edit). + #[test] + fn playbook_has_no_unresolved_placeholders() { + let md = playbook_md(&sample_project()); + assert!( + !md.contains("{backends_intro}") + && !md.contains("{launch_step}") + && !md.contains("{files}"), + "playbook has an unresolved placeholder" + ); + // Sanity: the slimmed pointers to the modules survived. + assert!(md.contains("orx-compute")); + assert!(md.contains("orx-reports")); + assert!(md.contains("orx-evidence")); + } +} diff --git a/src/main.rs b/src/main.rs index f50592e..7735143 100644 --- a/src/main.rs +++ b/src/main.rs @@ -677,6 +677,14 @@ pub struct InstallSkillsArgs { /// or `all`. Defaults to every agent already set up on this machine. #[arg(long)] pub agent: Option<String>, + + /// Also install the full set of modular `orx` skills (~8 always-listed + /// skills) into the agent's global skills dir, not just the thin shim. + /// Intended for dedicated/orx-only environments (e.g. the cloud box) — in a + /// general-purpose setup the always-on skills add noise, so the default is + /// the shim alone. + #[arg(long)] + pub full: bool, } #[derive(Args, Debug)] From 2cfc0511f4e70babf0bfdc3d38d90091d0076a73 Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 16:58:26 -0700 Subject: [PATCH 2/7] agent-skills: store modules as literal SKILL.md files, installed verbatim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each module is now a complete, GitHub-readable skill at agent-skills/<name>/SKILL.md (frontmatter included); local-mode body variants live as SKILL.local.md siblings. The render() step is gone — files are embedded and installed byte-for-byte, and the frontmatter drift test now validates the files against the code's name/description. --- .../SKILL.md} | 5 + .../{compute.md => orx-compute/SKILL.md} | 5 + .../{create.md => orx-create/SKILL.md} | 5 + .../SKILL.local.md} | 5 + .../SKILL.md} | 5 + .../SKILL.md} | 5 + .../{git-editing.md => orx-git/SKILL.md} | 5 + agent-skills/{lit.md => orx-lit/SKILL.md} | 5 + .../SKILL.local.md} | 5 + .../SKILL.md} | 5 + src/commands/install_skills.rs | 4 +- src/commands/skill.rs | 2 +- src/local/agent_skills.rs | 105 +++---- .../{index-DgScguTc.js => index-DE9xlq83.js} | 288 +++++++++--------- ...{index-BsmS7b0n.css => index-Dj5p3Wr0.css} | 2 +- ui/dist/index.html | 4 +- 16 files changed, 247 insertions(+), 208 deletions(-) rename agent-skills/{compute-k8s.md => orx-compute-k8s/SKILL.md} (95%) rename agent-skills/{compute.md => orx-compute/SKILL.md} (98%) rename agent-skills/{create.md => orx-create/SKILL.md} (97%) rename agent-skills/{evidence-local.md => orx-evidence/SKILL.local.md} (91%) rename agent-skills/{evidence-cloud.md => orx-evidence/SKILL.md} (98%) rename agent-skills/{experiment-tree.md => orx-experiment-tree/SKILL.md} (98%) rename agent-skills/{git-editing.md => orx-git/SKILL.md} (96%) rename agent-skills/{lit.md => orx-lit/SKILL.md} (95%) rename agent-skills/{reports-local.md => orx-reports/SKILL.local.md} (87%) rename agent-skills/{reports-cloud.md => orx-reports/SKILL.md} (90%) rename ui/dist/assets/{index-DgScguTc.js => index-DE9xlq83.js} (76%) rename ui/dist/assets/{index-BsmS7b0n.css => index-Dj5p3Wr0.css} (99%) diff --git a/agent-skills/compute-k8s.md b/agent-skills/orx-compute-k8s/SKILL.md similarity index 95% rename from agent-skills/compute-k8s.md rename to agent-skills/orx-compute-k8s/SKILL.md index 66cc3e7..3205a5f 100644 --- a/agent-skills/compute-k8s.md +++ b/agent-skills/orx-compute-k8s/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-compute-k8s +description: "Run an experiment on your Kubernetes cluster (`orx exp run --backend k8s`): the manifest contract orx enforces at submit." +--- + **Use `--backend k8s` ONLY when the user explicitly asks to run on their cluster** ("run this on k8s", "use our cluster") or it is the configured default target. Local projects (`orx up`) only for now. Auth comes from the diff --git a/agent-skills/compute.md b/agent-skills/orx-compute/SKILL.md similarity index 98% rename from agent-skills/compute.md rename to agent-skills/orx-compute/SKILL.md index dad047a..ae23328 100644 --- a/agent-skills/compute.md +++ b/agent-skills/orx-compute/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-compute +description: "Launch experiment runs on compute with `orx exp run`: managed GPU/CPU, hf/modal/ssh/local backends, sizing, and waiting on runs." +--- + Each experiment node has a **run command** (the shell command that trains/evaluates it) and is launched on **compute** you choose at run time. Compute is *not* stored on the node — you pick a GPU, a CPU-only instance, or an existing sandbox each time diff --git a/agent-skills/create.md b/agent-skills/orx-create/SKILL.md similarity index 97% rename from agent-skills/create.md rename to agent-skills/orx-create/SKILL.md index 33d2e06..40af59b 100644 --- a/agent-skills/create.md +++ b/agent-skills/orx-create/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-create +description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`)." +--- + ## `orx create-project` — start a new project Creates a project in an organization (org ids are printed next to the org names diff --git a/agent-skills/evidence-local.md b/agent-skills/orx-evidence/SKILL.local.md similarity index 91% rename from agent-skills/evidence-local.md rename to agent-skills/orx-evidence/SKILL.local.md index 7d1c297..a51e795 100644 --- a/agent-skills/evidence-local.md +++ b/agent-skills/orx-evidence/SKILL.local.md @@ -1,3 +1,8 @@ +--- +name: orx-evidence +description: "Analyze results in local mode: run logs are the only channel (`orx logs`) — make the run print the evidence you'll need." +--- + In local mode (`orx up`) run **logs are the only evidence channel** — there is no `artifacts`, `artifact`, `query`, `chart`, `search-logs`, or `wandb`. Make the run command print everything you'll need to judge the result, then read it back with diff --git a/agent-skills/evidence-cloud.md b/agent-skills/orx-evidence/SKILL.md similarity index 98% rename from agent-skills/evidence-cloud.md rename to agent-skills/orx-evidence/SKILL.md index 332a1aa..5b61fdc 100644 --- a/agent-skills/evidence-cloud.md +++ b/agent-skills/orx-evidence/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-evidence +description: "Analyze results: run logs, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB." +--- + ## Reading & searching run logs — `orx logs` / `orx search-logs` A run's terminal output (the PTY stream) is captured live while it runs and diff --git a/agent-skills/experiment-tree.md b/agent-skills/orx-experiment-tree/SKILL.md similarity index 98% rename from agent-skills/experiment-tree.md rename to agent-skills/orx-experiment-tree/SKILL.md index de59223..89dedc9 100644 --- a/agent-skills/experiment-tree.md +++ b/agent-skills/orx-experiment-tree/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-experiment-tree +description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc`." +--- + A project is a **tree of experiment nodes**. The root (**baseline**) holds the starting code and a **run command** — the single shell command that trains or evaluates the node and writes an `EVAL.md` with its results. Every other node is a diff --git a/agent-skills/git-editing.md b/agent-skills/orx-git/SKILL.md similarity index 96% rename from agent-skills/git-editing.md rename to agent-skills/orx-git/SKILL.md index 285c861..0f9091b 100644 --- a/agent-skills/git-editing.md +++ b/agent-skills/orx-git/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-git +description: "Read, edit, and diff a node's code with plain git in the cache-dir clone (or your session worktree): sync, commit, push before running." +--- + Every experiment node **is a git branch** (`orx/<slug>`) on the project's GitHub repo — `orx create-experiment` prints it. There is no dev box and no `orx` code command: the **local clone in the cache dir is the standard way to interface diff --git a/agent-skills/lit.md b/agent-skills/orx-lit/SKILL.md similarity index 95% rename from agent-skills/lit.md rename to agent-skills/orx-lit/SKILL.md index 5cd7f2a..d5a0a09 100644 --- a/agent-skills/lit.md +++ b/agent-skills/orx-lit/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-lit +description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`) — ground hypotheses and find code to seed a baseline from." +--- + These tap **alphaXiv's public corpus** (2.5M+ arXiv papers: CS, math, physics, stats, q-bio/fin, EE — not PubMed/biomed). They need **no `orx login`** and hit alphaXiv hosts, not the OpenResearch API. Use them to ground research in real diff --git a/agent-skills/reports-local.md b/agent-skills/orx-reports/SKILL.local.md similarity index 87% rename from agent-skills/reports-local.md rename to agent-skills/orx-reports/SKILL.local.md index cafffb0..61849f9 100644 --- a/agent-skills/reports-local.md +++ b/agent-skills/orx-reports/SKILL.local.md @@ -1,3 +1,8 @@ +--- +name: orx-reports +description: "Write research reports into the local project's files dir (tree-mirroring folder layout) — they appear in the dashboard's Files tab." +--- + In local mode (`orx up`), reports are written **directly into the project's files dir** — there is no upload step. Anything under the files dir (reports, figures, data files) appears in the dashboard's Files tab immediately, grouped by diff --git a/agent-skills/reports-cloud.md b/agent-skills/orx-reports/SKILL.md similarity index 90% rename from agent-skills/reports-cloud.md rename to agent-skills/orx-reports/SKILL.md index 5466781..dc6a94f 100644 --- a/agent-skills/reports-cloud.md +++ b/agent-skills/orx-reports/SKILL.md @@ -1,3 +1,8 @@ +--- +name: orx-reports +description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page." +--- + When a line of work concludes, write up the experiment tree as a local markdown report and publish it to the project with `orx report upload` — it then shows up on the project page (and its public view) with images inline. diff --git a/src/commands/install_skills.rs b/src/commands/install_skills.rs index 484d035..f28bad1 100644 --- a/src/commands/install_skills.rs +++ b/src/commands/install_skills.rs @@ -127,7 +127,7 @@ fn global_skills_dir(harness: &dyn Harness) -> Option<PathBuf> { /// Write the full set of modular `orx` skills into the harness's global skills /// dir (`--full`). Overwrites in place; returns the `SKILL.md` paths written. async fn write_full_skills(harness: &dyn Harness) -> Result<Vec<PathBuf>> { - use crate::local::agent_skills::{render, skills, SkillSet}; + use crate::local::agent_skills::{skills, SkillSet}; let base = global_skills_dir(harness) .ok_or_else(|| anyhow!("{} has no global skills dir", harness.name()))?; @@ -136,7 +136,7 @@ async fn write_full_skills(harness: &dyn Harness) -> Result<Vec<PathBuf>> { let dir = base.join(skill.name); fs::create_dir_all(&dir).await?; let path = dir.join("SKILL.md"); - fs::write(&path, render(skill)).await?; + fs::write(&path, skill.content).await?; written.push(path); } Ok(written) diff --git a/src/commands/skill.rs b/src/commands/skill.rs index 346ec71..7909005 100644 --- a/src/commands/skill.rs +++ b/src/commands/skill.rs @@ -12,7 +12,7 @@ pub async fn run(args: crate::SkillArgs) -> Result<()> { // First: a bundled module (with or without the `orx-` prefix). These // ship in the binary, so they resolve offline and never drift. if let Some(skill) = agent_skills::find(&path) { - println!("{}", agent_skills::render(skill)); + println!("{}", skill.content.trim_end()); return Ok(()); } // Otherwise fetch the canonical doc from the API (same docs the assistant diff --git a/src/local/agent_skills.rs b/src/local/agent_skills.rs index e5eb324..86e0063 100644 --- a/src/local/agent_skills.rs +++ b/src/local/agent_skills.rs @@ -1,9 +1,10 @@ //! Native modular agent skills for `orx`. //! //! The monolithic `orx skill` overview (repo-root `SKILL.md`) is factored into a -//! handful of focused modules whose bodies live in the repo `agent-skills/` -//! directory and are embedded in the binary at compile time. Two consumers use -//! them: +//! handful of focused modules that live as **literal, complete skill files** in +//! the repo `agent-skills/` directory (`agent-skills/<name>/SKILL.md`, +//! frontmatter included — readable as-is on GitHub) and are embedded in the +//! binary at compile time and installed verbatim. Two consumers use them: //! //! * **Local `orx up` sessions** get the [`SkillSet::Local`] modules written as //! native `SKILL.md` skill dirs *into the session worktree* — fresh on every @@ -27,12 +28,13 @@ use std::path::Path; use crate::error::{anyhow, Result}; /// One embedded skill module: its public name (== skill dir name == the `name:` -/// frontmatter field), a one-line description, and the markdown body (no -/// frontmatter — [`render`] generates it). +/// frontmatter field), a one-line description (mirrored in the file's +/// frontmatter — a test enforces they agree), and the complete `SKILL.md` +/// contents, installed and printed verbatim. pub struct AgentSkill { pub name: &'static str, pub description: &'static str, - pub body: &'static str, + pub content: &'static str, } /// Which set of module bodies to serve. The two sets carry the same public skill @@ -46,18 +48,20 @@ pub enum SkillSet { Full, } -// --- Module bodies (embedded from the repo `agent-skills/` dir) -------------- +// --- Module files (embedded verbatim from the repo `agent-skills/` dir; the +// `SKILL.local.md` siblings are the local-mode body variants under the same +// public skill name) ---------------------------------------------------------- -const COMPUTE: &str = include_str!("../../agent-skills/compute.md"); -const COMPUTE_K8S: &str = include_str!("../../agent-skills/compute-k8s.md"); -const EXPERIMENT_TREE: &str = include_str!("../../agent-skills/experiment-tree.md"); -const GIT_EDITING: &str = include_str!("../../agent-skills/git-editing.md"); -const LIT: &str = include_str!("../../agent-skills/lit.md"); -const CREATE: &str = include_str!("../../agent-skills/create.md"); -const REPORTS_LOCAL: &str = include_str!("../../agent-skills/reports-local.md"); -const REPORTS_CLOUD: &str = include_str!("../../agent-skills/reports-cloud.md"); -const EVIDENCE_LOCAL: &str = include_str!("../../agent-skills/evidence-local.md"); -const EVIDENCE_CLOUD: &str = include_str!("../../agent-skills/evidence-cloud.md"); +const COMPUTE: &str = include_str!("../../agent-skills/orx-compute/SKILL.md"); +const COMPUTE_K8S: &str = include_str!("../../agent-skills/orx-compute-k8s/SKILL.md"); +const EXPERIMENT_TREE: &str = include_str!("../../agent-skills/orx-experiment-tree/SKILL.md"); +const GIT_EDITING: &str = include_str!("../../agent-skills/orx-git/SKILL.md"); +const LIT: &str = include_str!("../../agent-skills/orx-lit/SKILL.md"); +const CREATE: &str = include_str!("../../agent-skills/orx-create/SKILL.md"); +const REPORTS_LOCAL: &str = include_str!("../../agent-skills/orx-reports/SKILL.local.md"); +const REPORTS_CLOUD: &str = include_str!("../../agent-skills/orx-reports/SKILL.md"); +const EVIDENCE_LOCAL: &str = include_str!("../../agent-skills/orx-evidence/SKILL.local.md"); +const EVIDENCE_CLOUD: &str = include_str!("../../agent-skills/orx-evidence/SKILL.md"); // Descriptions are ≤150 chars (Codex's ambient skill budget is tight): one line, // no leading `orx-`, phrased so an agent knows when to load the module. @@ -65,52 +69,52 @@ const EVIDENCE_CLOUD: &str = include_str!("../../agent-skills/evidence-cloud.md" const S_COMPUTE: AgentSkill = AgentSkill { name: "orx-compute", description: "Launch experiment runs on compute with `orx exp run`: managed GPU/CPU, hf/modal/ssh/local backends, sizing, and waiting on runs.", - body: COMPUTE, + content: COMPUTE, }; const S_COMPUTE_K8S: AgentSkill = AgentSkill { name: "orx-compute-k8s", description: "Run an experiment on your Kubernetes cluster (`orx exp run --backend k8s`): the manifest contract orx enforces at submit.", - body: COMPUTE_K8S, + content: COMPUTE_K8S, }; const S_EXPERIMENT_TREE: AgentSkill = AgentSkill { name: "orx-experiment-tree", description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc`.", - body: EXPERIMENT_TREE, + content: EXPERIMENT_TREE, }; const S_GIT: AgentSkill = AgentSkill { name: "orx-git", description: "Read, edit, and diff a node's code with plain git in the cache-dir clone (or your session worktree): sync, commit, push before running.", - body: GIT_EDITING, + content: GIT_EDITING, }; const S_LIT: AgentSkill = AgentSkill { name: "orx-lit", description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`) — ground hypotheses and find code to seed a baseline from.", - body: LIT, + content: LIT, }; const S_CREATE: AgentSkill = AgentSkill { name: "orx-create", description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`).", - body: CREATE, + content: CREATE, }; const S_REPORTS_LOCAL: AgentSkill = AgentSkill { name: "orx-reports", description: "Write research reports into the local project's files dir (tree-mirroring folder layout) — they appear in the dashboard's Files tab.", - body: REPORTS_LOCAL, + content: REPORTS_LOCAL, }; const S_REPORTS_CLOUD: AgentSkill = AgentSkill { name: "orx-reports", description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page.", - body: REPORTS_CLOUD, + content: REPORTS_CLOUD, }; const S_EVIDENCE_LOCAL: AgentSkill = AgentSkill { name: "orx-evidence", description: "Analyze results in local mode: run logs are the only channel (`orx logs`) — make the run print the evidence you'll need.", - body: EVIDENCE_LOCAL, + content: EVIDENCE_LOCAL, }; const S_EVIDENCE_CLOUD: AgentSkill = AgentSkill { name: "orx-evidence", description: "Analyze results: run logs, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB.", - body: EVIDENCE_CLOUD, + content: EVIDENCE_CLOUD, }; /// The modules for a given set, in a stable order. Local and Full share names; @@ -149,26 +153,6 @@ pub fn find(name: &str) -> Option<&'static AgentSkill> { .find(|s| s.name == want || s.name.strip_prefix("orx-") == Some(want)) } -/// Render a skill to a full `SKILL.md`: generated frontmatter + body. The -/// frontmatter `name` matches the dir name; `description` is the module's line. -/// -/// The `description` is emitted as a **JSON-quoted** scalar. Descriptions -/// contain colon-space (`orx exp run`: managed …) and backticks, which are -/// invalid in an unquoted YAML plain scalar — a strict frontmatter parser (the -/// Claude/Codex/OpenCode skill loaders) would error or truncate the value. A -/// JSON string is always a valid YAML flow scalar, so quoting keeps every -/// present and future description safe regardless of punctuation. -pub fn render(skill: &AgentSkill) -> String { - let description = serde_json::to_string(skill.description) - .unwrap_or_else(|_| format!("{:?}", skill.description)); - format!( - "---\nname: {}\ndescription: {}\n---\n\n{}", - skill.name, - description, - skill.body.trim_end(), - ) -} - /// Write the [`SkillSet::Local`] modules as `<worktree>/<skills_dir_rel>/<name>/SKILL.md`, /// overwriting every file on every call (same freshness semantics as the /// playbook — zero drift). Returns `Err` on the first write failure; the caller @@ -180,7 +164,7 @@ pub fn ensure_session_skills(worktree: &Path, skills_dir_rel: &str) -> Result<() std::fs::create_dir_all(&dir) .map_err(|e| anyhow!("Could not create {}: {}", dir.display(), e))?; let path = dir.join("SKILL.md"); - std::fs::write(&path, render(skill)) + std::fs::write(&path, skill.content) .map_err(|e| anyhow!("Could not write {}: {}", path.display(), e))?; } Ok(()) @@ -246,11 +230,14 @@ mod tests { } #[test] - fn rendered_frontmatter_is_valid_yaml() { + fn file_frontmatter_matches_code_and_is_valid_yaml() { + // The skill files under `agent-skills/` are the literal installed + // artifacts (embedded verbatim), so their frontmatter must agree with + // the code's name/description — this is the drift guard between the + // GitHub-readable files and the indexes generated from the consts. for set in [SkillSet::Local, SkillSet::Full] { for s in skills(set) { - let rendered = render(s); - let mut lines = rendered.lines(); + let mut lines = s.content.lines(); assert_eq!(lines.next(), Some("---"), "{} missing opening ---", s.name); let name_line = lines.next().unwrap_or_default(); let desc_line = lines.next().unwrap_or_default(); @@ -261,11 +248,12 @@ mod tests { s.name ); - // The description value must be YAML-safe. `render` emits it as a - // JSON-quoted scalar; strip `description: ` and JSON-decode it — - // this round-trip both proves the quoting is well-formed and - // recovers the exact description. A bare (unquoted) value - // containing `: ` — the bug this guards — would not JSON-decode. + // The description value must be YAML-safe. The files carry it + // as a JSON-quoted scalar; strip `description: ` and JSON-decode + // — the round-trip proves the quoting is well-formed and that + // the file agrees with the code's description. A bare + // (unquoted) value containing `: ` — the bug this guards — + // would not JSON-decode. let value = desc_line .strip_prefix("description: ") .unwrap_or_else(|| panic!("{} description frontmatter shape", s.name)); @@ -283,7 +271,8 @@ mod tests { assert_eq!(lines.next(), Some("---"), "{} missing closing ---", s.name); // A non-empty body follows the closing frontmatter fence // (`\n---\n\n` separates the frontmatter block from the body). - let body = rendered + let body = s + .content .split_once("\n---\n\n") .map(|(_, body)| body) .unwrap_or(""); @@ -324,7 +313,7 @@ mod tests { for s in skills(SkillSet::Local) { let path = base.join(s.name).join("SKILL.md"); let content = std::fs::read_to_string(&path).unwrap(); - assert_eq!(content, render(s), "{} SKILL.md content", s.name); + assert_eq!(content, s.content, "{} SKILL.md content", s.name); } // Idempotent: a second call overwrites in place and changes nothing. diff --git a/ui/dist/assets/index-DgScguTc.js b/ui/dist/assets/index-DE9xlq83.js similarity index 76% rename from ui/dist/assets/index-DgScguTc.js rename to ui/dist/assets/index-DE9xlq83.js index d704024..862f450 100644 --- a/ui/dist/assets/index-DgScguTc.js +++ b/ui/dist/assets/index-DE9xlq83.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ey;function uA(){if(Ey)return xo;Ey=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return xo.Fragment=t,xo.jsx=n,xo.jsxs=n,xo}var ky;function hA(){return ky||(ky=1,Id.exports=uA()),Id.exports}var m=hA(),zd={exports:{}},He={};/** + */var Ey;function aA(){if(Ey)return xo;Ey=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return xo.Fragment=t,xo.jsx=n,xo.jsxs=n,xo}var ky;function oA(){return ky||(ky=1,Id.exports=aA()),Id.exports}var m=oA(),zd={exports:{}},He={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ay;function fA(){if(Ay)return He;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),_=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function S(O,$,U){this.props=O,this.context=$,this.refs=b,this.updater=U||w}S.prototype.isReactComponent={},S.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,$,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function x(){}x.prototype=S.prototype;function y(O,$,U){this.props=O,this.context=$,this.refs=b,this.updater=U||w}var E=y.prototype=new x;E.constructor=y,C(E,S.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function j(O,$,U){var Q=U.ref;return{$$typeof:e,type:O,key:$,ref:Q!==void 0?Q:null,props:U}}function B(O,$){return j(O.type,$,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function Y(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(U){return $[U]})}var H=/\/+/g;function z(O,$){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):$.toString(36)}function V(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function G(O,$,U,Q,re){var ae=typeof O;(ae==="undefined"||ae==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case t:Z=!0;break;case p:return Z=O._init,G(Z(O._payload),$,U,Q,re)}}if(Z)return re=re(O),Z=Q===""?"."+z(O,0):Q,R(re)?(U="",Z!=null&&(U=Z.replace(H,"$&/")+"/"),G(re,$,U,"",function(ne){return ne})):re!=null&&(F(re)&&(re=B(re,U+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(H,"$&/")+"/")+Z)),$.push(re)),1;Z=0;var P=Q===""?".":Q+":";if(R(O))for(var ee=0;ee<O.length;ee++)Q=O[ee],ae=P+z(Q,ee),Z+=G(Q,$,U,ae,re);else if(ee=v(O),typeof ee=="function")for(O=ee.call(O),ee=0;!(Q=O.next()).done;)Q=Q.value,ae=P+z(Q,ee++),Z+=G(Q,$,U,ae,re);else if(ae==="object"){if(typeof O.then=="function")return G(V(O),$,U,Q,re);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Z}function X(O,$,U){if(O==null)return O;var Q=[],re=0;return G(O,Q,"","",function(ae){return $.call(U,ae,re++)}),Q}function K(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(U){(O._status===0||O._status===-1)&&(O._status=1,O._result=U)},function(U){(O._status===0||O._status===-1)&&(O._status=2,O._result=U)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var L=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},M={map:X,forEach:function(O,$,U){X(O,function(){$.apply(this,arguments)},U)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return He.Activity=d,He.Children=M,He.Component=S,He.Fragment=n,He.Profiler=a,He.PureComponent=y,He.StrictMode=r,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},He.cache=function(O){return function(){return O.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(O,$,U){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Q=C({},O.props),re=O.key;if($!=null)for(ae in $.key!==void 0&&(re=""+$.key),$)!T.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=U;else if(1<ae){for(var Z=Array(ae),P=0;P<ae;P++)Z[P]=arguments[P+2];Q.children=Z}return j(O.type,re,Q)},He.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},He.createElement=function(O,$,U){var Q,re={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)T.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=$[Q]);var Z=arguments.length-2;if(Z===1)re.children=U;else if(1<Z){for(var P=Array(Z),ee=0;ee<Z;ee++)P[ee]=arguments[ee+2];re.children=P}if(O&&O.defaultProps)for(Q in Z=O.defaultProps,Z)re[Q]===void 0&&(re[Q]=Z[Q]);return j(O,ae,re)},He.createRef=function(){return{current:null}},He.forwardRef=function(O){return{$$typeof:o,render:O}},He.isValidElement=F,He.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:K}},He.memo=function(O,$){return{$$typeof:f,type:O,compare:$===void 0?null:$}},He.startTransition=function(O){var $=D.T,U={};D.T=U;try{var Q=O(),re=D.S;re!==null&&re(U,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,L)}catch(ae){L(ae)}finally{$!==null&&U.types!==null&&($.types=U.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(O){return D.H.use(O)},He.useActionState=function(O,$,U){return D.H.useActionState(O,$,U)},He.useCallback=function(O,$){return D.H.useCallback(O,$)},He.useContext=function(O){return D.H.useContext(O)},He.useDebugValue=function(){},He.useDeferredValue=function(O,$){return D.H.useDeferredValue(O,$)},He.useEffect=function(O,$){return D.H.useEffect(O,$)},He.useEffectEvent=function(O){return D.H.useEffectEvent(O)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(O,$,U){return D.H.useImperativeHandle(O,$,U)},He.useInsertionEffect=function(O,$){return D.H.useInsertionEffect(O,$)},He.useLayoutEffect=function(O,$){return D.H.useLayoutEffect(O,$)},He.useMemo=function(O,$){return D.H.useMemo(O,$)},He.useOptimistic=function(O,$){return D.H.useOptimistic(O,$)},He.useReducer=function(O,$,U){return D.H.useReducer(O,$,U)},He.useRef=function(O){return D.H.useRef(O)},He.useState=function(O){return D.H.useState(O)},He.useSyncExternalStore=function(O,$,U){return D.H.useSyncExternalStore(O,$,U)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.7",He}var Ny;function al(){return Ny||(Ny=1,zd.exports=fA()),zd.exports}var q=al();const dA=Pu(q);var Hd={exports:{}},wo={},Fd={exports:{}},Pd={};/** + */var Ay;function lA(){if(Ay)return He;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),_=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function S(O,$,F){this.props=O,this.context=$,this.refs=b,this.updater=F||w}S.prototype.isReactComponent={},S.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,$,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function x(){}x.prototype=S.prototype;function y(O,$,F){this.props=O,this.context=$,this.refs=b,this.updater=F||w}var E=y.prototype=new x;E.constructor=y,C(E,S.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function j(O,$,F){var Q=F.ref;return{$$typeof:e,type:O,key:$,ref:Q!==void 0?Q:null,props:F}}function B(O,$){return j(O.type,$,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function G(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(F){return $[F]})}var U=/\/+/g;function H(O,$){return typeof O=="object"&&O!==null&&O.key!=null?G(""+O.key):$.toString(36)}function Y(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function q(O,$,F,Q,re){var ae=typeof O;(ae==="undefined"||ae==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case t:Z=!0;break;case p:return Z=O._init,q(Z(O._payload),$,F,Q,re)}}if(Z)return re=re(O),Z=Q===""?"."+H(O,0):Q,R(re)?(F="",Z!=null&&(F=Z.replace(U,"$&/")+"/"),q(re,$,F,"",function(ne){return ne})):re!=null&&(z(re)&&(re=B(re,F+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(U,"$&/")+"/")+Z)),$.push(re)),1;Z=0;var P=Q===""?".":Q+":";if(R(O))for(var ee=0;ee<O.length;ee++)Q=O[ee],ae=P+H(Q,ee),Z+=q(Q,$,F,ae,re);else if(ee=v(O),typeof ee=="function")for(O=ee.call(O),ee=0;!(Q=O.next()).done;)Q=Q.value,ae=P+H(Q,ee++),Z+=q(Q,$,F,ae,re);else if(ae==="object"){if(typeof O.then=="function")return q(Y(O),$,F,Q,re);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Z}function X(O,$,F){if(O==null)return O;var Q=[],re=0;return q(O,Q,"","",function(ae){return $.call(F,ae,re++)}),Q}function K(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(F){(O._status===0||O._status===-1)&&(O._status=1,O._result=F)},function(F){(O._status===0||O._status===-1)&&(O._status=2,O._result=F)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var L=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},M={map:X,forEach:function(O,$,F){X(O,function(){$.apply(this,arguments)},F)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return He.Activity=d,He.Children=M,He.Component=S,He.Fragment=n,He.Profiler=a,He.PureComponent=y,He.StrictMode=r,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},He.cache=function(O){return function(){return O.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(O,$,F){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Q=C({},O.props),re=O.key;if($!=null)for(ae in $.key!==void 0&&(re=""+$.key),$)!T.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=F;else if(1<ae){for(var Z=Array(ae),P=0;P<ae;P++)Z[P]=arguments[P+2];Q.children=Z}return j(O.type,re,Q)},He.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},He.createElement=function(O,$,F){var Q,re={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)T.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=$[Q]);var Z=arguments.length-2;if(Z===1)re.children=F;else if(1<Z){for(var P=Array(Z),ee=0;ee<Z;ee++)P[ee]=arguments[ee+2];re.children=P}if(O&&O.defaultProps)for(Q in Z=O.defaultProps,Z)re[Q]===void 0&&(re[Q]=Z[Q]);return j(O,ae,re)},He.createRef=function(){return{current:null}},He.forwardRef=function(O){return{$$typeof:o,render:O}},He.isValidElement=z,He.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:K}},He.memo=function(O,$){return{$$typeof:f,type:O,compare:$===void 0?null:$}},He.startTransition=function(O){var $=D.T,F={};D.T=F;try{var Q=O(),re=D.S;re!==null&&re(F,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,L)}catch(ae){L(ae)}finally{$!==null&&F.types!==null&&($.types=F.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(O){return D.H.use(O)},He.useActionState=function(O,$,F){return D.H.useActionState(O,$,F)},He.useCallback=function(O,$){return D.H.useCallback(O,$)},He.useContext=function(O){return D.H.useContext(O)},He.useDebugValue=function(){},He.useDeferredValue=function(O,$){return D.H.useDeferredValue(O,$)},He.useEffect=function(O,$){return D.H.useEffect(O,$)},He.useEffectEvent=function(O){return D.H.useEffectEvent(O)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(O,$,F){return D.H.useImperativeHandle(O,$,F)},He.useInsertionEffect=function(O,$){return D.H.useInsertionEffect(O,$)},He.useLayoutEffect=function(O,$){return D.H.useLayoutEffect(O,$)},He.useMemo=function(O,$){return D.H.useMemo(O,$)},He.useOptimistic=function(O,$){return D.H.useOptimistic(O,$)},He.useReducer=function(O,$,F){return D.H.useReducer(O,$,F)},He.useRef=function(O){return D.H.useRef(O)},He.useState=function(O){return D.H.useState(O)},He.useSyncExternalStore=function(O,$,F){return D.H.useSyncExternalStore(O,$,F)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.7",He}var Ny;function al(){return Ny||(Ny=1,zd.exports=lA()),zd.exports}var V=al();const cA=Pu(V);var Hd={exports:{}},wo={},Fd={exports:{}},Pd={};/** * @license React * scheduler.production.js * @@ -22,7 +22,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ty;function pA(){return Ty||(Ty=1,(function(e){function t(G,X){var K=G.length;G.push(X);e:for(;0<K;){var L=K-1>>>1,M=G[L];if(0<a(M,X))G[L]=X,G[K]=M,K=L;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var X=G[0],K=G.pop();if(K!==X){G[0]=K;e:for(var L=0,M=G.length,O=M>>>1;L<O;){var $=2*(L+1)-1,U=G[$],Q=$+1,re=G[Q];if(0>a(U,K))Q<M&&0>a(re,U)?(G[L]=re,G[Q]=K,L=Q):(G[L]=U,G[$]=K,L=$);else if(Q<M&&0>a(re,K))G[L]=re,G[Q]=K,L=Q;else break e}}return X}function a(G,X){var K=G.sortIndex-X.sortIndex;return K!==0?K:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,_=3,v=!1,w=!1,C=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(G){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=G)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function R(G){if(C=!1,E(G),!w)if(n(c)!==null)w=!0,N||(N=!0,Y());else{var X=n(f);X!==null&&V(R,X.startTime-G)}}var N=!1,D=-1,T=5,j=-1;function B(){return b?!0:!(e.unstable_now()-j<T)}function F(){if(b=!1,N){var G=e.unstable_now();j=G;var X=!0;try{e:{w=!1,C&&(C=!1,x(D),D=-1),v=!0;var K=_;try{t:{for(E(G),d=n(c);d!==null&&!(d.expirationTime>G&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,_=d.priorityLevel;var M=L(d.expirationTime<=G);if(G=e.unstable_now(),typeof M=="function"){d.callback=M,E(G),X=!0;break t}d===n(c)&&r(c),E(G)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&V(R,O.startTime-G),X=!1}}break e}finally{d=null,_=K,v=!1}X=void 0}}finally{X?Y():N=!1}}}var Y;if(typeof y=="function")Y=function(){y(F)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,z=H.port2;H.port1.onmessage=F,Y=function(){z.postMessage(null)}}else Y=function(){S(F,0)};function V(G,X){D=S(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(G){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var K=_;_=X;try{return G()}finally{_=K}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(G,X){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var K=_;_=G;try{return X()}finally{_=K}},e.unstable_scheduleCallback=function(G,X,K){var L=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?L+K:L):K=L,G){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=K+M,G={id:p++,callback:X,priorityLevel:G,startTime:K,expirationTime:M,sortIndex:-1},K>L?(G.sortIndex=K,t(f,G),n(c)===null&&G===n(f)&&(C?(x(D),D=-1):C=!0,V(R,K-L))):(G.sortIndex=M,t(c,G),w||v||(w=!0,N||(N=!0,Y()))),G},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(G){var X=_;return function(){var K=_;_=X;try{return G.apply(this,arguments)}finally{_=K}}}})(Pd)),Pd}var Ry;function gA(){return Ry||(Ry=1,Fd.exports=pA()),Fd.exports}var Ud={exports:{}},Jt={};/** + */var Ty;function uA(){return Ty||(Ty=1,(function(e){function t(q,X){var K=q.length;q.push(X);e:for(;0<K;){var L=K-1>>>1,M=q[L];if(0<a(M,X))q[L]=X,q[K]=M,K=L;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var X=q[0],K=q.pop();if(K!==X){q[0]=K;e:for(var L=0,M=q.length,O=M>>>1;L<O;){var $=2*(L+1)-1,F=q[$],Q=$+1,re=q[Q];if(0>a(F,K))Q<M&&0>a(re,F)?(q[L]=re,q[Q]=K,L=Q):(q[L]=F,q[$]=K,L=$);else if(Q<M&&0>a(re,K))q[L]=re,q[Q]=K,L=Q;else break e}}return X}function a(q,X){var K=q.sortIndex-X.sortIndex;return K!==0?K:q.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,_=3,v=!1,w=!1,C=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=q)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function R(q){if(C=!1,E(q),!w)if(n(c)!==null)w=!0,N||(N=!0,G());else{var X=n(f);X!==null&&Y(R,X.startTime-q)}}var N=!1,D=-1,T=5,j=-1;function B(){return b?!0:!(e.unstable_now()-j<T)}function z(){if(b=!1,N){var q=e.unstable_now();j=q;var X=!0;try{e:{w=!1,C&&(C=!1,x(D),D=-1),v=!0;var K=_;try{t:{for(E(q),d=n(c);d!==null&&!(d.expirationTime>q&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,_=d.priorityLevel;var M=L(d.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){d.callback=M,E(q),X=!0;break t}d===n(c)&&r(c),E(q)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&Y(R,O.startTime-q),X=!1}}break e}finally{d=null,_=K,v=!1}X=void 0}}finally{X?G():N=!1}}}var G;if(typeof y=="function")G=function(){y(z)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=z,G=function(){H.postMessage(null)}}else G=function(){S(z,0)};function Y(q,X){D=S(function(){q(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(q){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var K=_;_=X;try{return q()}finally{_=K}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var K=_;_=q;try{return X()}finally{_=K}},e.unstable_scheduleCallback=function(q,X,K){var L=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?L+K:L):K=L,q){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=K+M,q={id:p++,callback:X,priorityLevel:q,startTime:K,expirationTime:M,sortIndex:-1},K>L?(q.sortIndex=K,t(f,q),n(c)===null&&q===n(f)&&(C?(x(D),D=-1):C=!0,Y(R,K-L))):(q.sortIndex=M,t(c,q),w||v||(w=!0,N||(N=!0,G()))),q},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(q){var X=_;return function(){var K=_;_=X;try{return q.apply(this,arguments)}finally{_=K}}}})(Pd)),Pd}var Ry;function hA(){return Ry||(Ry=1,Fd.exports=uA()),Fd.exports}var Ud={exports:{}},Jt={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Dy;function mA(){if(Dy)return Jt;Dy=1;var e=al();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(c,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jt.createPortal=function(c,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(c,f,null,p)},Jt.flushSync=function(c){var f=u.T,p=r.p;try{if(u.T=null,r.p=2,c)return c()}finally{u.T=f,r.p=p,r.d.f()}},Jt.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Jt.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Jt.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:_,fetchPriority:v}):p==="script"&&r.d.X(c,{crossOrigin:d,integrity:_,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Jt.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=o(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Jt.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin);r.d.L(c,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Jt.preloadModule=function(c,f){if(typeof c=="string")if(f){var p=o(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Jt.requestFormReset=function(c){r.d.r(c)},Jt.unstable_batchedUpdates=function(c,f){return c(f)},Jt.useFormState=function(c,f,p){return u.H.useFormState(c,f,p)},Jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Jt.version="19.2.7",Jt}var My;function FS(){if(My)return Ud.exports;My=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ud.exports=mA(),Ud.exports}/** + */var Dy;function fA(){if(Dy)return Jt;Dy=1;var e=al();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(c,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jt.createPortal=function(c,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(c,f,null,p)},Jt.flushSync=function(c){var f=u.T,p=r.p;try{if(u.T=null,r.p=2,c)return c()}finally{u.T=f,r.p=p,r.d.f()}},Jt.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Jt.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Jt.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:_,fetchPriority:v}):p==="script"&&r.d.X(c,{crossOrigin:d,integrity:_,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Jt.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=o(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Jt.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin);r.d.L(c,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Jt.preloadModule=function(c,f){if(typeof c=="string")if(f){var p=o(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Jt.requestFormReset=function(c){r.d.r(c)},Jt.unstable_batchedUpdates=function(c,f){return c(f)},Jt.useFormState=function(c,f,p){return u.H.useFormState(c,f,p)},Jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Jt.version="19.2.7",Jt}var My;function zS(){if(My)return Ud.exports;My=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ud.exports=fA(),Ud.exports}/** * @license React * react-dom-client.production.js * @@ -38,325 +38,325 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jy;function _A(){if(jy)return wo;jy=1;var e=gA(),t=al(),n=FS();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)s+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,h=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(h=s.return),i=s.return;while(i)}return s.tag===3?h:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function o(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var h=i,g=s;;){var k=h.return;if(k===null)break;var A=k.alternate;if(A===null){if(g=k.return,g!==null){h=g;continue}break}if(k.child===A.child){for(A=k.child;A;){if(A===h)return c(k),i;if(A===g)return c(k),s;A=A.sibling}throw Error(r(188))}if(h.return!==g.return)h=k,g=A;else{for(var I=!1,W=k.child;W;){if(W===h){I=!0,h=k,g=A;break}if(W===g){I=!0,g=k,h=A;break}W=W.sibling}if(!I){for(W=A.child;W;){if(W===h){I=!0,h=A,g=k;break}if(W===g){I=!0,g=A,h=k;break}W=W.sibling}if(!I)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var d=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Y(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var H=Symbol.for("react.client.reference");function z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===H?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case y:return i.displayName||"Context";case x:return(i._context.displayName||"Context")+".Consumer";case E:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return s=i.displayName||null,s!==null?s:z(i.type)||"Memo";case T:s=i._payload,i=i._init;try{return z(i(s))}catch{}}return null}var V=Array.isArray,G=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},L=[],M=-1;function O(i){return{current:i}}function $(i){0>M||(i.current=L[M],L[M]=null,M--)}function U(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),ae=O(null),Z=O(null);function P(i,s){switch(U(ae,s),U(re,i),U(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Wv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Wv(s),i=Xv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(Q),U(Q,i)}function ee(){$(Q),$(re),$(ae)}function ne(i){i.memoizedState!==null&&U(Z,i);var s=Q.current,h=Xv(s,i.type);s!==h&&(U(re,i),U(Q,h))}function ge(i){re.current===i&&($(Q),$(re)),Z.current===i&&($(Z),vo._currentValue=K)}var he,ye;function be(i){if(he===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);he=s&&s[1]||"",ye=-1<h.stack.indexOf(` + */var jy;function dA(){if(jy)return wo;jy=1;var e=hA(),t=al(),n=zS();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)s+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,h=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(h=s.return),i=s.return;while(i)}return s.tag===3?h:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function o(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var h=i,g=s;;){var k=h.return;if(k===null)break;var A=k.alternate;if(A===null){if(g=k.return,g!==null){h=g;continue}break}if(k.child===A.child){for(A=k.child;A;){if(A===h)return c(k),i;if(A===g)return c(k),s;A=A.sibling}throw Error(r(188))}if(h.return!==g.return)h=k,g=A;else{for(var I=!1,W=k.child;W;){if(W===h){I=!0,h=k,g=A;break}if(W===g){I=!0,g=k,h=A;break}W=W.sibling}if(!I){for(W=A.child;W;){if(W===h){I=!0,h=A,g=k;break}if(W===g){I=!0,g=A,h=k;break}W=W.sibling}if(!I)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var d=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=z&&i[z]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case y:return i.displayName||"Context";case x:return(i._context.displayName||"Context")+".Consumer";case E:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return s=i.displayName||null,s!==null?s:H(i.type)||"Memo";case T:s=i._payload,i=i._init;try{return H(i(s))}catch{}}return null}var Y=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},L=[],M=-1;function O(i){return{current:i}}function $(i){0>M||(i.current=L[M],L[M]=null,M--)}function F(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),ae=O(null),Z=O(null);function P(i,s){switch(F(ae,s),F(re,i),F(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Wv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Wv(s),i=Xv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(Q),F(Q,i)}function ee(){$(Q),$(re),$(ae)}function ne(i){i.memoizedState!==null&&F(Z,i);var s=Q.current,h=Xv(s,i.type);s!==h&&(F(re,i),F(Q,h))}function ge(i){re.current===i&&($(Q),$(re)),Z.current===i&&($(Z),vo._currentValue=K)}var he,ye;function be(i){if(he===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);he=s&&s[1]||"",ye=-1<h.stack.indexOf(` at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return` `+he+i+ye}var ke=!1;function Ee(i,s){if(!i||ke)return"";ke=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(s){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(pe){var ue=pe}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(pe){ue=pe}i.call(ve.prototype)}}else{try{throw Error()}catch(pe){ue=pe}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(pe){if(pe&&ue&&typeof pe.stack=="string")return[pe.stack,ue.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=g.DetermineComponentFrameRoot(),I=A[0],W=A[1];if(I&&W){var J=I.split(` `),ce=W.split(` `);for(k=g=0;g<J.length&&!J[g].includes("DetermineComponentFrameRoot");)g++;for(;k<ce.length&&!ce[k].includes("DetermineComponentFrameRoot");)k++;if(g===J.length||k===ce.length)for(g=J.length-1,k=ce.length-1;1<=g&&0<=k&&J[g]!==ce[k];)k--;for(;1<=g&&0<=k;g--,k--)if(J[g]!==ce[k]){if(g!==1||k!==1)do if(g--,k--,0>k||J[g]!==ce[k]){var me=` `+J[g].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=g&&0<=k);break}}}finally{ke=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?be(h):""}function Ce(i,s){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==s&&s!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ee(i.type,!1);case 11:return Ee(i.type.render,!1);case 1:return Ee(i.type,!0);case 31:return be("Activity");default:return""}}function rt(i){try{var s="",h=null;do s+=Ce(i,h),h=i,i=i.return;while(i);return s}catch(g){return` Error generating stack: `+g.message+` -`+g.stack}}var bt=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,Pt=e.unstable_shouldYield,ht=e.unstable_requestPaint,Fe=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,De=e.unstable_IdlePriority,Ve=e.log,Ie=e.unstable_setDisableYieldValue,Nt=null,Et=null;function qt(i){if(typeof Ve=="function"&&Ie(i),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Nt,i)}catch{}}var st=Math.clz32?Math.clz32:ps,Ln=Math.log,Ut=Math.LN2;function ps(i){return i>>>=0,i===0?32:31-(Ln(i)/Ut|0)|0}var mi=256,_i=262144,vi=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function yi(i,s,h){var g=i.pendingLanes;if(g===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var W=g&134217727;return W!==0?(g=W&~A,g!==0?k=On(g):(I&=W,I!==0?k=On(I):h||(h=W&~i,h!==0&&(k=On(h))))):(W=g&~A,W!==0?k=On(W):I!==0?k=On(I):h||(h=g&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ni(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function oe(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function we(){var i=vi;return vi<<=1,(vi&62914560)===0&&(vi=4194304),i}function Ne(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function qe(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function at(i,s,h,g,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var W=i.entanglements,J=i.expirationTimes,ce=i.hiddenUpdates;for(h=I&~h;0<h;){var me=31-st(h),ve=1<<me;W[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var pe=ue[me];pe!==null&&(pe.lane&=-536870913)}h&=~ve}g!==0&&bi(i,g,0),A!==0&&k===0&&i.tag!==0&&(i.suspendedLanes|=A&~(I&~s))}function bi(i,s,h){i.pendingLanes|=s,i.suspendedLanes&=~s;var g=31-st(s);i.entangledLanes|=s,i.entanglements[g]=i.entanglements[g]|1073741824|h&261930}function nn(i,s){var h=i.entangledLanes|=s;for(i=i.entanglements;h;){var g=31-st(h),k=1<<g;k&s|i[g]&s&&(i[g]|=s),h&=~k}}function gs(i,s){var h=s&-s;return h=(h&42)!==0?1:ka(h),(h&(i.suspendedLanes|s))!==0?0:h}function ka(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Aa(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yl(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:vy(i.type))}function bl(i,s){var h=X.p;try{return X.p=i,s()}finally{X.p=h}}var ii=Math.random().toString(36).slice(2),$t="__reactFiber$"+ii,Qt="__reactProps$"+ii,Si="__reactContainer$"+ii,ms="__reactEvents$"+ii,Sl="__reactListeners$"+ii,Nh="__reactHandles$"+ii,xl="__reactResources$"+ii,Rr="__reactMarker$"+ii;function Na(i){delete i[$t],delete i[Qt],delete i[ms],delete i[Sl],delete i[Nh]}function Yi(i){var s=i[$t];if(s)return s;for(var h=i.parentNode;h;){if(s=h[Si]||h[$t]){if(h=s.alternate,s.child!==null||h!==null&&h.child!==null)for(i=ny(i);i!==null;){if(h=i[$t])return h;i=ny(i)}return s}i=h,h=i.parentNode}return null}function Wi(i){if(i=i[$t]||i[Si]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Xi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ki(i){var s=i[xl];return s||(s=i[xl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[Rr]=!0}var wl=new Set,Cl={};function xi(i,s){Zi(i,s),Zi(i+"Capture",s)}function Zi(i,s){for(Cl[i]=s,i=0;i<s.length;i++)wl.add(s[i])}var Th=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),El={},Ta={};function Rh(i){return bt.call(Ta,i)?!0:bt.call(El,i)?!1:Th.test(i)?Ta[i]=!0:(El[i]=!0,!1)}function _s(i,s,h){if(Rh(s))if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var g=s.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+h)}}function vs(i,s,h){if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+h)}}function qn(i,s,h,g){if(g===null)i.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(s,h,""+g)}}function an(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function kl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Dh(i,s,h){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var k=g.get,A=g.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return k.call(this)},set:function(I){h=""+I,A.call(this,I)}}),Object.defineProperty(i,s,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ra(i){if(!i._valueTracker){var s=kl(i)?"checked":"value";i._valueTracker=Dh(i,s,""+i[s])}}function Dr(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var h=s.getValue(),g="";return i&&(g=kl(i)?i.checked?"true":"false":i.value),i=g,i!==h?(s.setValue(i),!0):!1}function ys(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Al=/[\n"\\]/g;function on(i){return i.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Da(i,s,h,g,k,A,I,W){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?Ma(i,I,an(s)):h!=null?Ma(i,I,an(h)):g!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+an(W):i.removeAttribute("name")}function bs(i,s,h,g,k,A,I,W){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Ra(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,W||s===i.value||(i.value=s),i.defaultValue=s}g=g??k,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=W?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ra(i)}function Ma(i,s,h){s==="number"&&ys(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function Qi(i,s,h,g){if(i=i.options,s){s={};for(var k=0;k<h.length;k++)s["$"+h[k]]=!0;for(h=0;h<i.length;h++)k=s.hasOwnProperty("$"+i[h].value),i[h].selected!==k&&(i[h].selected=k),k&&g&&(i[h].defaultSelected=!0)}else{for(h=""+an(h),s=null,k=0;k<i.length;k++){if(i[k].value===h){i[k].selected=!0,g&&(i[k].defaultSelected=!0);return}s!==null||i[k].disabled||(s=i[k])}s!==null&&(s.selected=!0)}}function ja(i,s,h){if(s!=null&&(s=""+an(s),s!==i.value&&(i.value=s),h==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=h!=null?""+an(h):""}function Gm(i,s,h,g){if(s==null){if(g!=null){if(h!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),s=h}h=an(s),i.defaultValue=h,g=i.textContent,g===h&&g!==""&&g!==null&&(i.value=g),Ra(i)}function Ss(i,s){if(s){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=s;return}}i.textContent=s}var sE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qm(i,s,h){var g=s.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":g?i.setProperty(s,h):typeof h!="number"||h===0||sE.has(s)?s==="float"?i.cssFloat=h:i[s]=(""+h).trim():i[s]=h+"px"}function Vm(i,s,h){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||s!=null&&s.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var k in s)g=s[k],s.hasOwnProperty(k)&&h[k]!==g&&qm(i,k,g)}else for(var A in s)s.hasOwnProperty(A)&&qm(i,A,s[A])}function Mh(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var aE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),oE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(i){return oE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function wi(){}var jh=null;function Lh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xs=null,ws=null;function Ym(i){var s=Wi(i);if(s&&(i=s.stateNode)){var h=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Da(i,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),s=h.name,h.type==="radio"&&s!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+on(""+s)+'"][type="radio"]'),s=0;s<h.length;s++){var g=h[s];if(g!==i&&g.form===i.form){var k=g[Qt]||null;if(!k)throw Error(r(90));Da(g,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(s=0;s<h.length;s++)g=h[s],g.form===i.form&&Dr(g)}break e;case"textarea":ja(i,h.value,h.defaultValue);break e;case"select":s=h.value,s!=null&&Qi(i,!!h.multiple,s,!1)}}}var Oh=!1;function Wm(i,s,h){if(Oh)return i(s,h);Oh=!0;try{var g=i(s);return g}finally{if(Oh=!1,(xs!==null||ws!==null)&&(gc(),xs&&(s=xs,i=ws,ws=xs=null,Ym(s),i)))for(s=0;s<i.length;s++)Ym(i[s])}}function La(i,s){var h=i.stateNode;if(h===null)return null;var g=h[Qt]||null;if(g===null)return null;h=g[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(r(231,s,typeof h));return h}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(Ci)try{var Oa={};Object.defineProperty(Oa,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{Bh=!1}var Ji=null,Ih=null,Tl=null;function Xm(){if(Tl)return Tl;var i,s=Ih,h=s.length,g,k="value"in Ji?Ji.value:Ji.textContent,A=k.length;for(i=0;i<h&&s[i]===k[i];i++);var I=h-i;for(g=1;g<=I&&s[h-g]===k[A-g];g++);return Tl=k.slice(i,1<g?1-g:void 0)}function Rl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Dl(){return!0}function Km(){return!1}function ln(i){function s(h,g,k,A,I){this._reactName=h,this._targetInst=k,this.type=g,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(h=i[W],this[W]=h?h(A):A[W]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Dl:Km,this.isPropagationStopped=Km,this}return d(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Dl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Dl)},persist:function(){},isPersistent:Dl}),s}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=ln(Mr),Ba=d({},Mr,{view:0,detail:0}),lE=ln(Ba),zh,Hh,Ia,jl=d({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ia&&(Ia&&i.type==="mousemove"?(zh=i.screenX-Ia.screenX,Hh=i.screenY-Ia.screenY):Hh=zh=0,Ia=i),zh)},movementY:function(i){return"movementY"in i?i.movementY:Hh}}),Zm=ln(jl),cE=d({},jl,{dataTransfer:0}),uE=ln(cE),hE=d({},Ba,{relatedTarget:0}),Fh=ln(hE),fE=d({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),dE=ln(fE),pE=d({},Mr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),gE=ln(pE),mE=d({},Mr,{data:0}),Qm=ln(mE),_E={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bE(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=yE[i])?!!s[i]:!1}function Ph(){return bE}var SE=d({},Ba,{key:function(i){if(i.key){var s=_E[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Rl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?vE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(i){return i.type==="keypress"?Rl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Rl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),xE=ln(SE),wE=d({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=ln(wE),CE=d({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),EE=ln(CE),kE=d({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),AE=ln(kE),NE=d({},jl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),TE=ln(NE),RE=d({},Mr,{newState:0,oldState:0}),DE=ln(RE),ME=[9,13,27,32],Uh=Ci&&"CompositionEvent"in window,za=null;Ci&&"documentMode"in document&&(za=document.documentMode);var jE=Ci&&"TextEvent"in window&&!za,e0=Ci&&(!Uh||za&&8<za&&11>=za),t0=" ",n0=!1;function i0(i,s){switch(i){case"keyup":return ME.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Cs=!1;function LE(i,s){switch(i){case"compositionend":return r0(s);case"keypress":return s.which!==32?null:(n0=!0,t0);case"textInput":return i=s.data,i===t0&&n0?null:i;default:return null}}function OE(i,s){if(Cs)return i==="compositionend"||!Uh&&i0(i,s)?(i=Xm(),Tl=Ih=Ji=null,Cs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return e0&&s.locale!=="ko"?null:s.data;default:return null}}var BE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!BE[i.type]:s==="textarea"}function a0(i,s,h,g){xs?ws?ws.push(g):ws=[g]:xs=g,s=xc(s,"onChange"),0<s.length&&(h=new Ml("onChange","change",null,h,g),i.push({event:h,listeners:s}))}var Ha=null,Fa=null;function IE(i){Uv(i,0)}function Ll(i){var s=Xi(i);if(Dr(s))return i}function o0(i,s){if(i==="change")return s}var l0=!1;if(Ci){var $h;if(Ci){var Gh="oninput"in document;if(!Gh){var c0=document.createElement("div");c0.setAttribute("oninput","return;"),Gh=typeof c0.oninput=="function"}$h=Gh}else $h=!1;l0=$h&&(!document.documentMode||9<document.documentMode)}function u0(){Ha&&(Ha.detachEvent("onpropertychange",h0),Fa=Ha=null)}function h0(i){if(i.propertyName==="value"&&Ll(Fa)){var s=[];a0(s,Fa,i,Lh(i)),Wm(IE,s)}}function zE(i,s,h){i==="focusin"?(u0(),Ha=s,Fa=h,Ha.attachEvent("onpropertychange",h0)):i==="focusout"&&u0()}function HE(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ll(Fa)}function FE(i,s){if(i==="click")return Ll(s)}function PE(i,s){if(i==="input"||i==="change")return Ll(s)}function UE(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var yn=typeof Object.is=="function"?Object.is:UE;function Pa(i,s){if(yn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var h=Object.keys(i),g=Object.keys(s);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var k=h[g];if(!bt.call(s,k)||!yn(i[k],s[k]))return!1}return!0}function f0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function d0(i,s){var h=f0(i);i=0;for(var g;h;){if(h.nodeType===3){if(g=i+h.textContent.length,i<=s&&g>=s)return{node:h,offset:s-i};i=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=f0(h)}}function p0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?p0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function g0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=ys(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=ys(i.document)}return s}function qh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var $E=Ci&&"documentMode"in document&&11>=document.documentMode,Es=null,Vh=null,Ua=null,Yh=!1;function m0(i,s,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yh||Es==null||Es!==ys(g)||(g=Es,"selectionStart"in g&&qh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ua&&Pa(Ua,g)||(Ua=g,g=xc(Vh,"onSelect"),0<g.length&&(s=new Ml("onSelect","select",null,s,h),i.push({event:s,listeners:g}),s.target=Es)))}function jr(i,s){var h={};return h[i.toLowerCase()]=s.toLowerCase(),h["Webkit"+i]="webkit"+s,h["Moz"+i]="moz"+s,h}var ks={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Wh={},_0={};Ci&&(_0=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Lr(i){if(Wh[i])return Wh[i];if(!ks[i])return i;var s=ks[i],h;for(h in s)if(s.hasOwnProperty(h)&&h in _0)return Wh[i]=s[h];return i}var v0=Lr("animationend"),y0=Lr("animationiteration"),b0=Lr("animationstart"),GE=Lr("transitionrun"),qE=Lr("transitionstart"),VE=Lr("transitioncancel"),S0=Lr("transitionend"),x0=new Map,Xh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xh.push("scrollEnd");function Vn(i,s){x0.set(i,s),xi(s,[i])}var Ol=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Bn=[],As=0,Kh=0;function Bl(){for(var i=As,s=Kh=As=0;s<i;){var h=Bn[s];Bn[s++]=null;var g=Bn[s];Bn[s++]=null;var k=Bn[s];Bn[s++]=null;var A=Bn[s];if(Bn[s++]=null,g!==null&&k!==null){var I=g.pending;I===null?k.next=k:(k.next=I.next,I.next=k),g.pending=k}A!==0&&w0(h,k,A)}}function Il(i,s,h,g){Bn[As++]=i,Bn[As++]=s,Bn[As++]=h,Bn[As++]=g,Kh|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Zh(i,s,h,g){return Il(i,s,h,g),zl(i)}function Or(i,s){return Il(i,null,null,s),zl(i)}function w0(i,s,h){i.lanes|=h;var g=i.alternate;g!==null&&(g.lanes|=h);for(var k=!1,A=i.return;A!==null;)A.childLanes|=h,g=A.alternate,g!==null&&(g.childLanes|=h),A.tag===22&&(i=A.stateNode,i===null||i._visibility&1||(k=!0)),i=A,A=A.return;return i.tag===3?(A=i.stateNode,k&&s!==null&&(k=31-st(h),i=A.hiddenUpdates,g=i[k],g===null?i[k]=[s]:g.push(s),s.lane=h|536870912),A):null}function zl(i){if(50<uo)throw uo=0,od=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ns={};function YE(i,s,h,g){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(i,s,h,g){return new YE(i,s,h,g)}function Qh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ei(i,s){var h=i.alternate;return h===null?(h=bn(i.tag,s,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=s,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&65011712,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,s=i.dependencies,h.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h.refCleanup=i.refCleanup,h}function C0(i,s){i.flags&=65011714;var h=i.alternate;return h===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=h.childLanes,i.lanes=h.lanes,i.child=h.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=h.memoizedProps,i.memoizedState=h.memoizedState,i.updateQueue=h.updateQueue,i.type=h.type,s=h.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Hl(i,s,h,g,k,A){var I=0;if(g=i,typeof i=="function")Qh(i)&&(I=1);else if(typeof i=="string")I=Qk(i,h,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case j:return i=bn(31,h,s,k),i.elementType=j,i.lanes=A,i;case C:return Br(h.children,k,A,s);case b:I=8,k|=24;break;case S:return i=bn(12,h,s,k|2),i.elementType=S,i.lanes=A,i;case R:return i=bn(13,h,s,k),i.elementType=R,i.lanes=A,i;case N:return i=bn(19,h,s,k),i.elementType=N,i.lanes=A,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case y:I=10;break e;case x:I=9;break e;case E:I=11;break e;case D:I=14;break e;case T:I=16,g=null;break e}I=29,h=Error(r(130,i===null?"null":typeof i,"")),g=null}return s=bn(I,h,s,k),s.elementType=i,s.type=g,s.lanes=A,s}function Br(i,s,h,g){return i=bn(7,i,g,s),i.lanes=h,i}function Jh(i,s,h){return i=bn(6,i,null,s),i.lanes=h,i}function E0(i){var s=bn(18,null,null,0);return s.stateNode=i,s}function ef(i,s,h){return s=bn(4,i.children!==null?i.children:[],i.key,s),s.lanes=h,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var k0=new WeakMap;function In(i,s){if(typeof i=="object"&&i!==null){var h=k0.get(i);return h!==void 0?h:(s={value:i,source:s,stack:rt(s)},k0.set(i,s),s)}return{value:i,source:s,stack:rt(s)}}var Ts=[],Rs=0,Fl=null,$a=0,zn=[],Hn=0,er=null,ri=1,si="";function ki(i,s){Ts[Rs++]=$a,Ts[Rs++]=Fl,Fl=i,$a=s}function A0(i,s,h){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,er=i;var g=ri;i=si;var k=32-st(g)-1;g&=~(1<<k),h+=1;var A=32-st(s)+k;if(30<A){var I=k-k%5;A=(g&(1<<I)-1).toString(32),g>>=I,k-=I,ri=1<<32-st(s)+k|h<<k|g,si=A+i}else ri=1<<A|h<<k|g,si=i}function tf(i){i.return!==null&&(ki(i,1),A0(i,1,0))}function nf(i){for(;i===Fl;)Fl=Ts[--Rs],Ts[Rs]=null,$a=Ts[--Rs],Ts[Rs]=null;for(;i===er;)er=zn[--Hn],zn[Hn]=null,si=zn[--Hn],zn[Hn]=null,ri=zn[--Hn],zn[Hn]=null}function N0(i,s){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,ri=s.id,si=s.overflow,er=i}var Wt=null,St=null,Qe=!1,tr=null,Fn=!1,rf=Error(r(519));function nr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(In(s,i)),rf}function T0(i){var s=i.stateNode,h=i.type,g=i.memoizedProps;switch(s[$t]=i,s[Qt]=g,h){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(h=0;h<fo.length;h++)We(fo[h],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),bs(s,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),Gm(s,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||s.textContent===""+h||g.suppressHydrationWarning===!0||Vv(s.textContent,h)?(g.popover!=null&&(We("beforetoggle",s),We("toggle",s)),g.onScroll!=null&&We("scroll",s),g.onScrollEnd!=null&&We("scrollend",s),g.onClick!=null&&(s.onclick=wi),s=!0):s=!1,s||nr(i,!0)}function R0(i){for(Wt=i.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Wt=Wt.return}}function Ds(i){if(i!==Wt)return!1;if(!Qe)return R0(i),Qe=!0,!1;var s=i.tag,h;if((h=s!==3&&s!==27)&&((h=s===5)&&(h=i.type,h=!(h!=="form"&&h!=="button")||xd(i.type,i.memoizedProps)),h=!h),h&&St&&nr(i),R0(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else s===27?(s=St,mr(i.type)?(i=Ad,Ad=null,St=i):St=s):St=Wt?Un(i.stateNode.nextSibling):null;return!0}function Ir(){St=Wt=null,Qe=!1}function sf(){var i=tr;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),tr=null),i}function Ga(i){tr===null?tr=[i]:tr.push(i)}var af=O(null),zr=null,Ai=null;function ir(i,s,h){U(af,s._currentValue),s._currentValue=h}function Ni(i){i._currentValue=af.current,$(af)}function of(i,s,h){for(;i!==null;){var g=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),i===h)break;i=i.return}}function lf(i,s,h,g){var k=i.child;for(k!==null&&(k.return=i);k!==null;){var A=k.dependencies;if(A!==null){var I=k.child;A=A.firstContext;e:for(;A!==null;){var W=A;A=k;for(var J=0;J<s.length;J++)if(W.context===s[J]){A.lanes|=h,W=A.alternate,W!==null&&(W.lanes|=h),of(A.return,h,i),g||(I=null);break e}A=W.next}}else if(k.tag===18){if(I=k.return,I===null)throw Error(r(341));I.lanes|=h,A=I.alternate,A!==null&&(A.lanes|=h),of(I,h,i),I=null}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===i){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}}function Ms(i,s,h,g){i=null;for(var k=s,A=!1;k!==null;){if(!A){if((k.flags&524288)!==0)A=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var I=k.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var W=k.type;yn(k.pendingProps.value,I.value)||(i!==null?i.push(W):i=[W])}}else if(k===Z.current){if(I=k.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(i!==null?i.push(vo):i=[vo])}k=k.return}i!==null&&lf(s,i,h,g),s.flags|=262144}function Pl(i){for(i=i.firstContext;i!==null;){if(!yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Hr(i){zr=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Xt(i){return D0(zr,i)}function Ul(i,s){return zr===null&&Hr(i),D0(i,s)}function D0(i,s){var h=s._currentValue;if(s={context:s,memoizedValue:h,next:null},Ai===null){if(i===null)throw Error(r(308));Ai=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ai=Ai.next=s;return h}var WE=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(h,g){i.push(g)}};this.abort=function(){s.aborted=!0,i.forEach(function(h){return h()})}},XE=e.unstable_scheduleCallback,KE=e.unstable_NormalPriority,Ot={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cf(){return{controller:new WE,data:new Map,refCount:0}}function qa(i){i.refCount--,i.refCount===0&&XE(KE,function(){i.controller.abort()})}var Va=null,uf=0,js=0,Ls=null;function ZE(i,s){if(Va===null){var h=Va=[];uf=0,js=dd(),Ls={status:"pending",value:void 0,then:function(g){h.push(g)}}}return uf++,s.then(M0,M0),s}function M0(){if(--uf===0&&Va!==null){Ls!==null&&(Ls.status="fulfilled");var i=Va;Va=null,js=0,Ls=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function QE(i,s){var h=[],g={status:"pending",value:null,reason:null,then:function(k){h.push(k)}};return i.then(function(){g.status="fulfilled",g.value=s;for(var k=0;k<h.length;k++)(0,h[k])(s)},function(k){for(g.status="rejected",g.reason=k,k=0;k<h.length;k++)(0,h[k])(void 0)}),g}var j0=G.S;G.S=function(i,s){mv=Fe(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&ZE(i,s),j0!==null&&j0(i,s)};var Fr=O(null);function hf(){var i=Fr.current;return i!==null?i:_t.pooledCache}function $l(i,s){s===null?U(Fr,Fr.current):U(Fr,s.pool)}function L0(){var i=hf();return i===null?null:{parent:Ot._currentValue,pool:i}}var Os=Error(r(460)),ff=Error(r(474)),Gl=Error(r(542)),ql={then:function(){}};function O0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function B0(i,s,h){switch(h=i[h],h===void 0?i.push(s):h!==s&&(s.then(wi,wi),s=h),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i;default:if(typeof s.status=="string")s.then(wi,wi);else{if(i=_t,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var k=s;k.status="fulfilled",k.value=g}},function(g){if(s.status==="pending"){var k=s;k.status="rejected",k.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i}throw Ur=s,Os}}function Pr(i){try{var s=i._init;return s(i._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ur=h,Os):h}}var Ur=null;function I0(){if(Ur===null)throw Error(r(459));var i=Ur;return Ur=null,i}function z0(i){if(i===Os||i===Gl)throw Error(r(483))}var Bs=null,Ya=0;function Vl(i){var s=Ya;return Ya+=1,Bs===null&&(Bs=[]),B0(Bs,i,s)}function Wa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Yl(i,s){throw s.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function H0(i){function s(se,te){if(i){var le=se.deletions;le===null?(se.deletions=[te],se.flags|=16):le.push(te)}}function h(se,te){if(!i)return null;for(;te!==null;)s(se,te),te=te.sibling;return null}function g(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function k(se,te){return se=Ei(se,te),se.index=0,se.sibling=null,se}function A(se,te,le){return se.index=le,i?(le=se.alternate,le!==null?(le=le.index,le<te?(se.flags|=67108866,te):le):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function I(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function W(se,te,le,_e){return te===null||te.tag!==6?(te=Jh(le,se.mode,_e),te.return=se,te):(te=k(te,le),te.return=se,te)}function J(se,te,le,_e){var Le=le.type;return Le===C?me(se,te,le.props.children,_e,le.key):te!==null&&(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type)?(te=k(te,le.props),Wa(te,le),te.return=se,te):(te=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(te,le),te.return=se,te)}function ce(se,te,le,_e){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=ef(le,se.mode,_e),te.return=se,te):(te=k(te,le.children||[]),te.return=se,te)}function me(se,te,le,_e,Le){return te===null||te.tag!==7?(te=Br(le,se.mode,_e,Le),te.return=se,te):(te=k(te,le),te.return=se,te)}function ve(se,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Jh(""+te,se.mode,le),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return le=Hl(te.type,te.key,te.props,null,se.mode,le),Wa(le,te),le.return=se,le;case w:return te=ef(te,se.mode,le),te.return=se,te;case T:return te=Pr(te),ve(se,te,le)}if(V(te)||Y(te))return te=Br(te,se.mode,le,null),te.return=se,te;if(typeof te.then=="function")return ve(se,Vl(te),le);if(te.$$typeof===y)return ve(se,Ul(se,te),le);Yl(se,te)}return null}function ue(se,te,le,_e){var Le=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Le!==null?null:W(se,te,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return le.key===Le?J(se,te,le,_e):null;case w:return le.key===Le?ce(se,te,le,_e):null;case T:return le=Pr(le),ue(se,te,le,_e)}if(V(le)||Y(le))return Le!==null?null:me(se,te,le,_e,null);if(typeof le.then=="function")return ue(se,te,Vl(le),_e);if(le.$$typeof===y)return ue(se,te,Ul(se,le),_e);Yl(se,le)}return null}function pe(se,te,le,_e,Le){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return se=se.get(le)||null,W(te,se,""+_e,Le);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return se=se.get(_e.key===null?le:_e.key)||null,J(te,se,_e,Le);case w:return se=se.get(_e.key===null?le:_e.key)||null,ce(te,se,_e,Le);case T:return _e=Pr(_e),pe(se,te,le,_e,Le)}if(V(_e)||Y(_e))return se=se.get(le)||null,me(te,se,_e,Le,null);if(typeof _e.then=="function")return pe(se,te,le,Vl(_e),Le);if(_e.$$typeof===y)return pe(se,te,le,Ul(te,_e),Le);Yl(te,_e)}return null}function Te(se,te,le,_e){for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null;Re!==null&&Ue<le.length;Ue++){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var it=ue(se,Re,le[Ue],_e);if(it===null){Re===null&&(Re=Ze);break}i&&Re&&it.alternate===null&&s(se,Re),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it,Re=Ze}if(Ue===le.length)return h(se,Re),Qe&&ki(se,Ue),Le;if(Re===null){for(;Ue<le.length;Ue++)Re=ve(se,le[Ue],_e),Re!==null&&(te=A(Re,te,Ue),nt===null?Le=Re:nt.sibling=Re,nt=Re);return Qe&&ki(se,Ue),Le}for(Re=g(Re);Ue<le.length;Ue++)Ze=pe(Re,se,Ue,le[Ue],_e),Ze!==null&&(i&&Ze.alternate!==null&&Re.delete(Ze.key===null?Ue:Ze.key),te=A(Ze,te,Ue),nt===null?Le=Ze:nt.sibling=Ze,nt=Ze);return i&&Re.forEach(function(Sr){return s(se,Sr)}),Qe&&ki(se,Ue),Le}function Be(se,te,le,_e){if(le==null)throw Error(r(151));for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null,it=le.next();Re!==null&&!it.done;Ue++,it=le.next()){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var Sr=ue(se,Re,it.value,_e);if(Sr===null){Re===null&&(Re=Ze);break}i&&Re&&Sr.alternate===null&&s(se,Re),te=A(Sr,te,Ue),nt===null?Le=Sr:nt.sibling=Sr,nt=Sr,Re=Ze}if(it.done)return h(se,Re),Qe&&ki(se,Ue),Le;if(Re===null){for(;!it.done;Ue++,it=le.next())it=ve(se,it.value,_e),it!==null&&(te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return Qe&&ki(se,Ue),Le}for(Re=g(Re);!it.done;Ue++,it=le.next())it=pe(Re,se,Ue,it.value,_e),it!==null&&(i&&it.alternate!==null&&Re.delete(it.key===null?Ue:it.key),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return i&&Re.forEach(function(cA){return s(se,cA)}),Qe&&ki(se,Ue),Le}function mt(se,te,le,_e){if(typeof le=="object"&&le!==null&&le.type===C&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case v:e:{for(var Le=le.key;te!==null;){if(te.key===Le){if(Le=le.type,Le===C){if(te.tag===7){h(se,te.sibling),_e=k(te,le.props.children),_e.return=se,se=_e;break e}}else if(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type){h(se,te.sibling),_e=k(te,le.props),Wa(_e,le),_e.return=se,se=_e;break e}h(se,te);break}else s(se,te);te=te.sibling}le.type===C?(_e=Br(le.props.children,se.mode,_e,le.key),_e.return=se,se=_e):(_e=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(_e,le),_e.return=se,se=_e)}return I(se);case w:e:{for(Le=le.key;te!==null;){if(te.key===Le)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){h(se,te.sibling),_e=k(te,le.children||[]),_e.return=se,se=_e;break e}else{h(se,te);break}else s(se,te);te=te.sibling}_e=ef(le,se.mode,_e),_e.return=se,se=_e}return I(se);case T:return le=Pr(le),mt(se,te,le,_e)}if(V(le))return Te(se,te,le,_e);if(Y(le)){if(Le=Y(le),typeof Le!="function")throw Error(r(150));return le=Le.call(le),Be(se,te,le,_e)}if(typeof le.then=="function")return mt(se,te,Vl(le),_e);if(le.$$typeof===y)return mt(se,te,Ul(se,le),_e);Yl(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(h(se,te.sibling),_e=k(te,le),_e.return=se,se=_e):(h(se,te),_e=Jh(le,se.mode,_e),_e.return=se,se=_e),I(se)):h(se,te)}return function(se,te,le,_e){try{Ya=0;var Le=mt(se,te,le,_e);return Bs=null,Le}catch(Re){if(Re===Os||Re===Gl)throw Re;var nt=bn(29,Re,null,se.mode);return nt.lanes=_e,nt.return=se,nt}finally{}}}var $r=H0(!0),F0=H0(!1),rr=!1;function df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function sr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ar(i,s,h){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(ot&2)!==0){var k=g.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),g.pending=s,s=zl(i),w0(i,null,h),s}return Il(i,g,s,h),zl(i)}function Xa(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}function gf(i,s){var h=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:g.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:g.shared,callbacks:g.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var mf=!1;function Ka(){if(mf){var i=Ls;if(i!==null)throw i}}function Za(i,s,h,g){mf=!1;var k=i.updateQueue;rr=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,W=k.shared.pending;if(W!==null){k.shared.pending=null;var J=W,ce=J.next;J.next=null,I===null?A=ce:I.next=ce,I=J;var me=i.alternate;me!==null&&(me=me.updateQueue,W=me.lastBaseUpdate,W!==I&&(W===null?me.firstBaseUpdate=ce:W.next=ce,me.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,me=ce=J=null,W=A;do{var ue=W.lane&-536870913,pe=ue!==W.lane;if(pe?(Ke&ue)===ue:(g&ue)===ue){ue!==0&&ue===js&&(mf=!0),me!==null&&(me=me.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Te=i,Be=W;ue=s;var mt=h;switch(Be.tag){case 1:if(Te=Be.payload,typeof Te=="function"){ve=Te.call(mt,ve,ue);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Be.payload,ue=typeof Te=="function"?Te.call(mt,ve,ue):Te,ue==null)break e;ve=d({},ve,ue);break e;case 2:rr=!0}}ue=W.callback,ue!==null&&(i.flags|=64,pe&&(i.flags|=8192),pe=k.callbacks,pe===null?k.callbacks=[ue]:pe.push(ue))}else pe={lane:ue,tag:W.tag,payload:W.payload,callback:W.callback,next:null},me===null?(ce=me=pe,J=ve):me=me.next=pe,I|=ue;if(W=W.next,W===null){if(W=k.shared.pending,W===null)break;pe=W,W=pe.next,pe.next=null,k.lastBaseUpdate=pe,k.shared.pending=null}}while(!0);me===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=ce,k.lastBaseUpdate=me,A===null&&(k.shared.lanes=0),hr|=I,i.lanes=I,i.memoizedState=ve}}function P0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function U0(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;i<h.length;i++)P0(h[i],s)}var Is=O(null),Wl=O(0);function $0(i,s){i=Ii,U(Wl,i),U(Is,s),Ii=i|s.baseLanes}function _f(){U(Wl,Ii),U(Is,Is.current)}function vf(){Ii=Wl.current,$(Is),$(Wl)}var Sn=O(null),Pn=null;function or(i){var s=i.alternate;U(Mt,Mt.current&1),U(Sn,i),Pn===null&&(s===null||Is.current!==null||s.memoizedState!==null)&&(Pn=i)}function yf(i){U(Mt,Mt.current),U(Sn,i),Pn===null&&(Pn=i)}function G0(i){i.tag===22?(U(Mt,Mt.current),U(Sn,i),Pn===null&&(Pn=i)):lr()}function lr(){U(Mt,Mt.current),U(Sn,Sn.current)}function xn(i){$(Sn),Pn===i&&(Pn=null),$(Mt)}var Mt=O(0);function Xl(i){for(var s=i;s!==null;){if(s.tag===13){var h=s.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ed(h)||kd(h)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ti=0,Pe=null,pt=null,Bt=null,Kl=!1,zs=!1,Gr=!1,Zl=0,Qa=0,Hs=null,JE=0;function Tt(){throw Error(r(321))}function bf(i,s){if(s===null)return!1;for(var h=0;h<s.length&&h<i.length;h++)if(!yn(i[h],s[h]))return!1;return!0}function Sf(i,s,h,g,k,A){return Ti=A,Pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,G.H=i===null||i.memoizedState===null?A_:Bf,Gr=!1,A=h(g,k),Gr=!1,zs&&(A=V0(s,h,g,k)),q0(i),A}function q0(i){G.H=to;var s=pt!==null&&pt.next!==null;if(Ti=0,Bt=pt=Pe=null,Kl=!1,Qa=0,Hs=null,s)throw Error(r(300));i===null||It||(i=i.dependencies,i!==null&&Pl(i)&&(It=!0))}function V0(i,s,h,g){Pe=i;var k=0;do{if(zs&&(Hs=null),Qa=0,zs=!1,25<=k)throw Error(r(301));if(k+=1,Bt=pt=null,i.updateQueue!=null){var A=i.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}G.H=N_,A=s(h,g)}while(zs);return A}function ek(){var i=G.H,s=i.useState()[0];return s=typeof s.then=="function"?Ja(s):s,i=i.useState()[0],(pt!==null?pt.memoizedState:null)!==i&&(Pe.flags|=1024),s}function xf(){var i=Zl!==0;return Zl=0,i}function wf(i,s,h){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~h}function Cf(i){if(Kl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Kl=!1}Ti=0,Bt=pt=Pe=null,zs=!1,Qa=Zl=0,Hs=null}function rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i,Bt}function jt(){if(pt===null){var i=Pe.alternate;i=i!==null?i.memoizedState:null}else i=pt.next;var s=Bt===null?Pe.memoizedState:Bt.next;if(s!==null)Bt=s,pt=i;else{if(i===null)throw Pe.alternate===null?Error(r(467)):Error(r(310));pt=i,i={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i}return Bt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var s=Qa;return Qa+=1,Hs===null&&(Hs=[]),i=B0(Hs,i,s),s=Pe,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,G.H=s===null||s.memoizedState===null?A_:Bf),i}function Jl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===y)return Xt(i)}throw Error(r(438,String(i)))}function Ef(i){var s=null,h=Pe.updateQueue;if(h!==null&&(s=h.memoCache),s==null){var g=Pe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(s={data:g.data.map(function(k){return k.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),h===null&&(h=Ql(),Pe.updateQueue=h),h.memoCache=s,h=s.data[s.index],h===void 0)for(h=s.data[s.index]=Array(i),g=0;g<i;g++)h[g]=B;return s.index++,h}function Ri(i,s){return typeof s=="function"?s(i):s}function ec(i){var s=jt();return kf(s,pt,i)}function kf(i,s,h){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var k=i.baseQueue,A=g.pending;if(A!==null){if(k!==null){var I=k.next;k.next=A.next,A.next=I}s.baseQueue=k=A,g.pending=null}if(A=i.baseState,k===null)i.memoizedState=A;else{s=k.next;var W=I=null,J=null,ce=s,me=!1;do{var ve=ce.lane&-536870913;if(ve!==ce.lane?(Ke&ve)===ve:(Ti&ve)===ve){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ve===js&&(me=!0);else if((Ti&ue)===ue){ce=ce.next,ue===js&&(me=!0);continue}else ve={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ve,I=A):J=J.next=ve,Pe.lanes|=ue,hr|=ue;ve=ce.action,Gr&&h(A,ve),A=ce.hasEagerState?ce.eagerState:h(A,ve)}else ue={lane:ve,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ue,I=A):J=J.next=ue,Pe.lanes|=ve,hr|=ve;ce=ce.next}while(ce!==null&&ce!==s);if(J===null?I=A:J.next=W,!yn(A,i.memoizedState)&&(It=!0,me&&(h=Ls,h!==null)))throw h;i.memoizedState=A,i.baseState=I,i.baseQueue=J,g.lastRenderedState=A}return k===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Af(i){var s=jt(),h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=i;var g=h.dispatch,k=h.pending,A=s.memoizedState;if(k!==null){h.pending=null;var I=k=k.next;do A=i(A,I.action),I=I.next;while(I!==k);yn(A,s.memoizedState)||(It=!0),s.memoizedState=A,s.baseQueue===null&&(s.baseState=A),h.lastRenderedState=A}return[A,g]}function Y0(i,s,h){var g=Pe,k=jt(),A=Qe;if(A){if(h===void 0)throw Error(r(407));h=h()}else h=s();var I=!yn((pt||k).memoizedState,h);if(I&&(k.memoizedState=h,It=!0),k=k.queue,Rf(K0.bind(null,g,k,i),[i]),k.getSnapshot!==s||I||Bt!==null&&Bt.memoizedState.tag&1){if(g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,k,h,s),null),_t===null)throw Error(r(349));A||(Ti&127)!==0||W0(g,s,h)}return h}function W0(i,s,h){i.flags|=16384,i={getSnapshot:s,value:h},s=Pe.updateQueue,s===null?(s=Ql(),Pe.updateQueue=s,s.stores=[i]):(h=s.stores,h===null?s.stores=[i]:h.push(i))}function X0(i,s,h,g){s.value=h,s.getSnapshot=g,Z0(s)&&Q0(i)}function K0(i,s,h){return h(function(){Z0(s)&&Q0(i)})}function Z0(i){var s=i.getSnapshot;i=i.value;try{var h=s();return!yn(i,h)}catch{return!0}}function Q0(i){var s=Or(i,2);s!==null&&dn(s,i,2)}function Nf(i){var s=rn();if(typeof i=="function"){var h=i;if(i=h(),Gr){qt(!0);try{h()}finally{qt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},s}function J0(i,s,h,g){return i.baseState=h,kf(i,pt,typeof g=="function"?g:Ri)}function tk(i,s,h,g,k){if(ic(i))throw Error(r(485));if(i=s.action,i!==null){var A={payload:k,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};G.T!==null?h(!0):A.isTransition=!1,g(A),h=s.pending,h===null?(A.next=s.pending=A,e_(s,A)):(A.next=h.next,s.pending=h.next=A)}}function e_(i,s){var h=s.action,g=s.payload,k=i.state;if(s.isTransition){var A=G.T,I={};G.T=I;try{var W=h(k,g),J=G.S;J!==null&&J(I,W),t_(i,s,W)}catch(ce){Tf(i,s,ce)}finally{A!==null&&I.types!==null&&(A.types=I.types),G.T=A}}else try{A=h(k,g),t_(i,s,A)}catch(ce){Tf(i,s,ce)}}function t_(i,s,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){n_(i,s,g)},function(g){return Tf(i,s,g)}):n_(i,s,h)}function n_(i,s,h){s.status="fulfilled",s.value=h,i_(s),i.state=h,s=i.pending,s!==null&&(h=s.next,h===s?i.pending=null:(h=h.next,s.next=h,e_(i,h)))}function Tf(i,s,h){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do s.status="rejected",s.reason=h,i_(s),s=s.next;while(s!==g)}i.action=null}function i_(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function r_(i,s){return s}function s_(i,s){if(Qe){var h=_t.formState;if(h!==null){e:{var g=Pe;if(Qe){if(St){t:{for(var k=St,A=Fn;k.nodeType!==8;){if(!A){k=null;break t}if(k=Un(k.nextSibling),k===null){k=null;break t}}A=k.data,k=A==="F!"||A==="F"?k:null}if(k){St=Un(k.nextSibling),g=k.data==="F!";break e}}nr(g)}g=!1}g&&(s=h[0])}}return h=rn(),h.memoizedState=h.baseState=s,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r_,lastRenderedState:s},h.queue=g,h=C_.bind(null,Pe,g),g.dispatch=h,g=Nf(!1),A=Of.bind(null,Pe,!1,g.queue),g=rn(),k={state:s,dispatch:null,action:i,pending:null},g.queue=k,h=tk.bind(null,Pe,k,A,h),k.dispatch=h,g.memoizedState=i,[s,h,!1]}function a_(i){var s=jt();return o_(s,pt,i)}function o_(i,s,h){if(s=kf(i,s,r_)[0],i=ec(Ri)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var g=Ja(s)}catch(I){throw I===Os?Gl:I}else g=s;s=jt();var k=s.queue,A=k.dispatch;return h!==s.memoizedState&&(Pe.flags|=2048,Fs(9,{destroy:void 0},nk.bind(null,k,h),null)),[g,A,i]}function nk(i,s){i.action=s}function l_(i){var s=jt(),h=pt;if(h!==null)return o_(s,h,i);jt(),s=s.memoizedState,h=jt();var g=h.queue.dispatch;return h.memoizedState=i,[s,g,!1]}function Fs(i,s,h,g){return i={tag:i,create:h,deps:g,inst:s,next:null},s=Pe.updateQueue,s===null&&(s=Ql(),Pe.updateQueue=s),h=s.lastEffect,h===null?s.lastEffect=i.next=i:(g=h.next,h.next=i,i.next=g,s.lastEffect=i),i}function c_(){return jt().memoizedState}function tc(i,s,h,g){var k=rn();Pe.flags|=i,k.memoizedState=Fs(1|s,{destroy:void 0},h,g===void 0?null:g)}function nc(i,s,h,g){var k=jt();g=g===void 0?null:g;var A=k.memoizedState.inst;pt!==null&&g!==null&&bf(g,pt.memoizedState.deps)?k.memoizedState=Fs(s,A,h,g):(Pe.flags|=i,k.memoizedState=Fs(1|s,A,h,g))}function u_(i,s){tc(8390656,8,i,s)}function Rf(i,s){nc(2048,8,i,s)}function ik(i){Pe.flags|=4;var s=Pe.updateQueue;if(s===null)s=Ql(),Pe.updateQueue=s,s.events=[i];else{var h=s.events;h===null?s.events=[i]:h.push(i)}}function h_(i){var s=jt().memoizedState;return ik({ref:s,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function f_(i,s){return nc(4,2,i,s)}function d_(i,s){return nc(4,4,i,s)}function p_(i,s){if(typeof s=="function"){i=i();var h=s(i);return function(){typeof h=="function"?h():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function g_(i,s,h){h=h!=null?h.concat([i]):null,nc(4,4,p_.bind(null,s,i),h)}function Df(){}function m_(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;return s!==null&&bf(s,g[1])?g[0]:(h.memoizedState=[i,s],i)}function __(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;if(s!==null&&bf(s,g[1]))return g[0];if(g=i(),Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g}function Mf(i,s,h){return h===void 0||(Ti&1073741824)!==0&&(Ke&261930)===0?i.memoizedState=s:(i.memoizedState=h,i=vv(),Pe.lanes|=i,hr|=i,h)}function v_(i,s,h,g){return yn(h,s)?h:Is.current!==null?(i=Mf(i,h,g),yn(i,s)||(It=!0),i):(Ti&42)===0||(Ti&1073741824)!==0&&(Ke&261930)===0?(It=!0,i.memoizedState=h):(i=vv(),Pe.lanes|=i,hr|=i,s)}function y_(i,s,h,g,k){var A=X.p;X.p=A!==0&&8>A?A:8;var I=G.T,W={};G.T=W,Of(i,!1,s,h);try{var J=k(),ce=G.S;if(ce!==null&&ce(W,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=QE(J,g);eo(i,s,me,En(i))}else eo(i,s,g,En(i))}catch(ve){eo(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&W.types!==null&&(I.types=W.types),G.T=I}}function rk(){}function jf(i,s,h,g){if(i.tag!==5)throw Error(r(476));var k=b_(i).queue;y_(i,k,s,K,h===null?rk:function(){return S_(i),h(g)})}function b_(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function S_(i){var s=b_(i);s.next===null&&(s=i.alternate.memoizedState),eo(i,s.next.queue,{},En())}function Lf(){return Xt(vo)}function x_(){return jt().memoizedState}function w_(){return jt().memoizedState}function sk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=sr(h);var g=ar(s,i,h);g!==null&&(dn(g,s,h),Xa(g,s,h)),s={cache:cf()},i.payload=s;return}s=s.return}}function ak(i,s,h){var g=En();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ic(i)?E_(s,h):(h=Zh(i,s,h,g),h!==null&&(dn(h,i,g),k_(h,s,g)))}function C_(i,s,h){var g=En();eo(i,s,h,g)}function eo(i,s,h,g){var k={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ic(i))E_(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,W=A(I,h);if(k.hasEagerState=!0,k.eagerState=W,yn(W,I))return Il(i,s,k,0),_t===null&&Bl(),!1}catch{}finally{}if(h=Zh(i,s,k,g),h!==null)return dn(h,i,g),k_(h,s,g),!0}return!1}function Of(i,s,h,g){if(g={lane:2,revertLane:dd(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ic(i)){if(s)throw Error(r(479))}else s=Zh(i,h,g,2),s!==null&&dn(s,i,2)}function ic(i){var s=i.alternate;return i===Pe||s!==null&&s===Pe}function E_(i,s){zs=Kl=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function k_(i,s,h){if((h&4194048)!==0){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}var to={readContext:Xt,use:Jl,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};to.useEffectEvent=Tt;var A_={readContext:Xt,use:Jl,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Xt,useEffect:u_,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,tc(4194308,4,p_.bind(null,s,i),h)},useLayoutEffect:function(i,s){return tc(4194308,4,i,s)},useInsertionEffect:function(i,s){tc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var g=i();if(Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g},useReducer:function(i,s,h){var g=rn();if(h!==void 0){var k=h(s);if(Gr){qt(!0);try{h(s)}finally{qt(!1)}}}else k=s;return g.memoizedState=g.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},g.queue=i,i=i.dispatch=ak.bind(null,Pe,i),[g.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Nf(i);var s=i.queue,h=C_.bind(null,Pe,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:Df,useDeferredValue:function(i,s){var h=rn();return Mf(h,i,s)},useTransition:function(){var i=Nf(!1);return i=y_.bind(null,Pe,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var g=Pe,k=rn();if(Qe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),_t===null)throw Error(r(349));(Ke&127)!==0||W0(g,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,u_(K0.bind(null,g,A,i),[i]),g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,A,h,s),null),h},useId:function(){var i=rn(),s=_t.identifierPrefix;if(Qe){var h=si,g=ri;h=(g&~(1<<32-st(g)-1)).toString(32)+h,s="_"+s+"R_"+h,h=Zl++,0<h&&(s+="H"+h.toString(32)),s+="_"}else h=JE++,s="_"+s+"r_"+h.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Lf,useFormState:s_,useActionState:s_,useOptimistic:function(i){var s=rn();s.memoizedState=s.baseState=i;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=h,s=Of.bind(null,Pe,!0,h),h.dispatch=s,[i,s]},useMemoCache:Ef,useCacheRefresh:function(){return rn().memoizedState=sk.bind(null,Pe)},useEffectEvent:function(i){var s=rn(),h={impl:i};return s.memoizedState=h,function(){if((ot&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Bf={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:ec,useRef:c_,useState:function(){return ec(Ri)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=ec(Ri)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:a_,useActionState:a_,useOptimistic:function(i,s){var h=jt();return J0(h,pt,i,s)},useMemoCache:Ef,useCacheRefresh:w_};Bf.useEffectEvent=h_;var N_={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:Af,useRef:c_,useState:function(){return Af(Ri)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return pt===null?Mf(h,i,s):v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=Af(Ri)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:l_,useActionState:l_,useOptimistic:function(i,s){var h=jt();return pt!==null?J0(h,pt,i,s):(h.baseState=i,[i,h.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:w_};N_.useEffectEvent=h_;function If(i,s,h,g){s=i.memoizedState,h=h(g,s),h=h==null?s:d({},s,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var zf={enqueueSetState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueReplaceState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.tag=1,k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var h=En(),g=sr(h);g.tag=2,s!=null&&(g.callback=s),s=ar(i,g,h),s!==null&&(dn(s,i,h),Xa(s,i,h))}};function T_(i,s,h,g,k,A,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,A,I):s.prototype&&s.prototype.isPureReactComponent?!Pa(h,g)||!Pa(k,A):!0}function R_(i,s,h,g){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(h,g),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(h,g),s.state!==i&&zf.enqueueReplaceState(s,s.state,null)}function qr(i,s){var h=s;if("ref"in s){h={};for(var g in s)g!=="ref"&&(h[g]=s[g])}if(i=i.defaultProps){h===s&&(h=d({},h));for(var k in i)h[k]===void 0&&(h[k]=i[k])}return h}function D_(i){Ol(i)}function M_(i){console.error(i)}function j_(i){Ol(i)}function rc(i,s){try{var h=i.onUncaughtError;h(s.value,{componentStack:s.stack})}catch(g){setTimeout(function(){throw g})}}function L_(i,s,h){try{var g=i.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Hf(i,s,h){return h=sr(h),h.tag=3,h.payload={element:null},h.callback=function(){rc(i,s)},h}function O_(i){return i=sr(i),i.tag=3,i}function B_(i,s,h,g){var k=h.type.getDerivedStateFromError;if(typeof k=="function"){var A=g.value;i.payload=function(){return k(A)},i.callback=function(){L_(s,h,g)}}var I=h.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){L_(s,h,g),typeof k!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var W=g.stack;this.componentDidCatch(g.value,{componentStack:W!==null?W:""})})}function ok(i,s,h,g,k){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(s=h.alternate,s!==null&&Ms(s,h,k,!0),h=Sn.current,h!==null){switch(h.tag){case 31:case 13:return Pn===null?mc():h.alternate===null&&Rt===0&&(Rt=3),h.flags&=-257,h.flags|=65536,h.lanes=k,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?h.updateQueue=new Set([g]):s.add(g),ud(i,g,k)),!1;case 22:return h.flags|=65536,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=s):(h=s.retryQueue,h===null?s.retryQueue=new Set([g]):h.add(g)),ud(i,g,k)),!1}throw Error(r(435,h.tag))}return ud(i,g,k),mc(),!1}if(Qe)return s=Sn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=k,g!==rf&&(i=Error(r(422),{cause:g}),Ga(In(i,h)))):(g!==rf&&(s=Error(r(423),{cause:g}),Ga(In(s,h))),i=i.current.alternate,i.flags|=65536,k&=-k,i.lanes|=k,g=In(g,h),k=Hf(i.stateNode,g,k),gf(i,k),Rt!==4&&(Rt=2)),!1;var A=Error(r(520),{cause:g});if(A=In(A,h),co===null?co=[A]:co.push(A),Rt!==4&&(Rt=2),s===null)return!0;g=In(g,h),h=s;do{switch(h.tag){case 3:return h.flags|=65536,i=k&-k,h.lanes|=i,i=Hf(h.stateNode,g,i),gf(h,i),!1;case 1:if(s=h.type,A=h.stateNode,(h.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(fr===null||!fr.has(A))))return h.flags|=65536,k&=-k,h.lanes|=k,k=O_(k),B_(k,i,h,g),gf(h,k),!1}h=h.return}while(h!==null);return!1}var Ff=Error(r(461)),It=!1;function Kt(i,s,h,g){s.child=i===null?F0(s,null,h,g):$r(s,i.child,h,g)}function I_(i,s,h,g,k){h=h.render;var A=s.ref;if("ref"in g){var I={};for(var W in g)W!=="ref"&&(I[W]=g[W])}else I=g;return Hr(s),g=Sf(i,s,h,I,A,k),W=xf(),i!==null&&!It?(wf(i,s,k),Di(i,s,k)):(Qe&&W&&tf(s),s.flags|=1,Kt(i,s,g,k),s.child)}function z_(i,s,h,g,k){if(i===null){var A=h.type;return typeof A=="function"&&!Qh(A)&&A.defaultProps===void 0&&h.compare===null?(s.tag=15,s.type=A,H_(i,s,A,g,k)):(i=Hl(h.type,null,g,s,s.mode,k),i.ref=s.ref,i.return=s,s.child=i)}if(A=i.child,!Wf(i,k)){var I=A.memoizedProps;if(h=h.compare,h=h!==null?h:Pa,h(I,g)&&i.ref===s.ref)return Di(i,s,k)}return s.flags|=1,i=Ei(A,g),i.ref=s.ref,i.return=s,s.child=i}function H_(i,s,h,g,k){if(i!==null){var A=i.memoizedProps;if(Pa(A,g)&&i.ref===s.ref)if(It=!1,s.pendingProps=g=A,Wf(i,k))(i.flags&131072)!==0&&(It=!0);else return s.lanes=i.lanes,Di(i,s,k)}return Pf(i,s,h,g,k)}function F_(i,s,h,g){var k=g.children,A=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((s.flags&128)!==0){if(A=A!==null?A.baseLanes|h:h,i!==null){for(g=s.child=i.child,k=0;g!==null;)k=k|g.lanes|g.childLanes,g=g.sibling;g=k&~A}else g=0,s.child=null;return P_(i,s,A,h,g)}if((h&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&$l(s,A!==null?A.cachePool:null),A!==null?$0(s,A):_f(),G0(s);else return g=s.lanes=536870912,P_(i,s,A!==null?A.baseLanes|h:h,h,g)}else A!==null?($l(s,A.cachePool),$0(s,A),lr(),s.memoizedState=null):(i!==null&&$l(s,null),_f(),lr());return Kt(i,s,k,h),s.child}function no(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function P_(i,s,h,g,k){var A=hf();return A=A===null?null:{parent:Ot._currentValue,pool:A},s.memoizedState={baseLanes:h,cachePool:A},i!==null&&$l(s,null),_f(),G0(s),i!==null&&Ms(i,s,g,!0),s.childLanes=k,null}function sc(i,s){return s=oc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function U_(i,s,h){return $r(s,i.child,null,h),i=sc(s,s.pendingProps),i.flags|=2,xn(s),s.memoizedState=null,i}function lk(i,s,h){var g=s.pendingProps,k=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Qe){if(g.mode==="hidden")return i=sc(s,g),s.lanes=536870912,no(null,i);if(yf(s),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return s.lanes=536870912,null}return sc(s,g)}var A=i.memoizedState;if(A!==null){var I=A.dehydrated;if(yf(s),k)if(s.flags&256)s.flags&=-257,s=U_(i,s,h);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(It||Ms(i,s,h,!1),k=(h&i.childLanes)!==0,It||k){if(g=_t,g!==null&&(I=gs(g,h),I!==0&&I!==A.retryLane))throw A.retryLane=I,Or(i,I),dn(g,i,I),Ff;mc(),s=U_(i,s,h)}else i=A.treeContext,St=Un(I.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=sc(s,g),s.flags|=4096;return s}return i=Ei(i.child,{mode:g.mode,children:g.children}),i.ref=s.ref,s.child=i,i.return=s,i}function ac(i,s){var h=s.ref;if(h===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(i===null||i.ref!==h)&&(s.flags|=4194816)}}function Pf(i,s,h,g,k){return Hr(s),h=Sf(i,s,h,g,void 0,k),g=xf(),i!==null&&!It?(wf(i,s,k),Di(i,s,k)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,k),s.child)}function $_(i,s,h,g,k,A){return Hr(s),s.updateQueue=null,h=V0(s,g,h,k),q0(i),g=xf(),i!==null&&!It?(wf(i,s,A),Di(i,s,A)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,A),s.child)}function G_(i,s,h,g,k){if(Hr(s),s.stateNode===null){var A=Ns,I=h.contextType;typeof I=="object"&&I!==null&&(A=Xt(I)),A=new h(g,A),s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=zf,s.stateNode=A,A._reactInternals=s,A=s.stateNode,A.props=g,A.state=s.memoizedState,A.refs={},df(s),I=h.contextType,A.context=typeof I=="object"&&I!==null?Xt(I):Ns,A.state=s.memoizedState,I=h.getDerivedStateFromProps,typeof I=="function"&&(If(s,h,I,g),A.state=s.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(I=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),I!==A.state&&zf.enqueueReplaceState(A,A.state,null),Za(s,g,A,k),Ka(),A.state=s.memoizedState),typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!0}else if(i===null){A=s.stateNode;var W=s.memoizedProps,J=qr(h,W);A.props=J;var ce=A.context,me=h.contextType;I=Ns,typeof me=="object"&&me!==null&&(I=Xt(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof A.getSnapshotBeforeUpdate=="function",W=s.pendingProps!==W,me||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(W||ce!==I)&&R_(s,A,g,I),rr=!1;var ue=s.memoizedState;A.state=ue,Za(s,g,A,k),Ka(),ce=s.memoizedState,W||ue!==ce||rr?(typeof ve=="function"&&(If(s,h,ve,g),ce=s.memoizedState),(J=rr||T_(s,h,J,g,ue,ce,I))?(me||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(s.flags|=4194308)):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=g,s.memoizedState=ce),A.props=g,A.state=ce,A.context=I,g=J):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!1)}else{A=s.stateNode,pf(i,s),I=s.memoizedProps,me=qr(h,I),A.props=me,ve=s.pendingProps,ue=A.context,ce=h.contextType,J=Ns,typeof ce=="object"&&ce!==null&&(J=Xt(ce)),W=h.getDerivedStateFromProps,(ce=typeof W=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==ve||ue!==J)&&R_(s,A,g,J),rr=!1,ue=s.memoizedState,A.state=ue,Za(s,g,A,k),Ka();var pe=s.memoizedState;I!==ve||ue!==pe||rr||i!==null&&i.dependencies!==null&&Pl(i.dependencies)?(typeof W=="function"&&(If(s,h,W,g),pe=s.memoizedState),(me=rr||T_(s,h,me,g,ue,pe,J)||i!==null&&i.dependencies!==null&&Pl(i.dependencies))?(ce||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,pe,J),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,pe,J)),typeof A.componentDidUpdate=="function"&&(s.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),s.memoizedProps=g,s.memoizedState=pe),A.props=g,A.state=pe,A.context=J,g=me):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),g=!1)}return A=g,ac(i,s),g=(s.flags&128)!==0,A||g?(A=s.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:A.render(),s.flags|=1,i!==null&&g?(s.child=$r(s,i.child,null,k),s.child=$r(s,null,h,k)):Kt(i,s,h,k),s.memoizedState=A.state,i=s.child):i=Di(i,s,k),i}function q_(i,s,h,g){return Ir(),s.flags|=256,Kt(i,s,h,g),s.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $f(i){return{baseLanes:i,cachePool:L0()}}function Gf(i,s,h){return i=i!==null?i.childLanes&~h:0,s&&(i|=Cn),i}function V_(i,s,h){var g=s.pendingProps,k=!1,A=(s.flags&128)!==0,I;if((I=A)||(I=i!==null&&i.memoizedState===null?!1:(Mt.current&2)!==0),I&&(k=!0,s.flags&=-129),I=(s.flags&32)!==0,s.flags&=-33,i===null){if(Qe){if(k?or(s):lr(),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return kd(i)?s.lanes=32:s.lanes=536870912,null}var W=g.children;return g=g.fallback,k?(lr(),k=s.mode,W=oc({mode:"hidden",children:W},k),g=Br(g,k,h,null),W.return=s,g.return=s,W.sibling=g,s.child=W,g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(null,g)):(or(s),qf(s,W))}var J=i.memoizedState;if(J!==null&&(W=J.dehydrated,W!==null)){if(A)s.flags&256?(or(s),s.flags&=-257,s=Vf(i,s,h)):s.memoizedState!==null?(lr(),s.child=i.child,s.flags|=128,s=null):(lr(),W=g.fallback,k=s.mode,g=oc({mode:"visible",children:g.children},k),W=Br(W,k,h,null),W.flags|=2,g.return=s,W.return=s,g.sibling=W,s.child=g,$r(s,i.child,null,h),g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,s=no(null,g));else if(or(s),kd(W)){if(I=W.nextSibling&&W.nextSibling.dataset,I)var ce=I.dgst;I=ce,g=Error(r(419)),g.stack="",g.digest=I,Ga({value:g,source:null,stack:null}),s=Vf(i,s,h)}else if(It||Ms(i,s,h,!1),I=(h&i.childLanes)!==0,It||I){if(I=_t,I!==null&&(g=gs(I,h),g!==0&&g!==J.retryLane))throw J.retryLane=g,Or(i,g),dn(I,i,g),Ff;Ed(W)||mc(),s=Vf(i,s,h)}else Ed(W)?(s.flags|=192,s.child=i.child,s=null):(i=J.treeContext,St=Un(W.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=qf(s,g.children),s.flags|=4096);return s}return k?(lr(),W=g.fallback,k=s.mode,J=i.child,ce=J.sibling,g=Ei(J,{mode:"hidden",children:g.children}),g.subtreeFlags=J.subtreeFlags&65011712,ce!==null?W=Ei(ce,W):(W=Br(W,k,h,null),W.flags|=2),W.return=s,g.return=s,g.sibling=W,s.child=g,no(null,g),g=s.child,W=i.child.memoizedState,W===null?W=$f(h):(k=W.cachePool,k!==null?(J=Ot._currentValue,k=k.parent!==J?{parent:J,pool:J}:k):k=L0(),W={baseLanes:W.baseLanes|h,cachePool:k}),g.memoizedState=W,g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(i.child,g)):(or(s),h=i.child,i=h.sibling,h=Ei(h,{mode:"visible",children:g.children}),h.return=s,h.sibling=null,i!==null&&(I=s.deletions,I===null?(s.deletions=[i],s.flags|=16):I.push(i)),s.child=h,s.memoizedState=null,h)}function qf(i,s){return s=oc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function oc(i,s){return i=bn(22,i,null,s),i.lanes=0,i}function Vf(i,s,h){return $r(s,i.child,null,h),i=qf(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Y_(i,s,h){i.lanes|=s;var g=i.alternate;g!==null&&(g.lanes|=s),of(i.return,s,h)}function Yf(i,s,h,g,k,A){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:k,treeForkCount:A}:(I.isBackwards=s,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=h,I.tailMode=k,I.treeForkCount=A)}function W_(i,s,h){var g=s.pendingProps,k=g.revealOrder,A=g.tail;g=g.children;var I=Mt.current,W=(I&2)!==0;if(W?(I=I&1|2,s.flags|=128):I&=1,U(Mt,I),Kt(i,s,g,h),g=Qe?$a:0,!W&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Y_(i,h,s);else if(i.tag===19)Y_(i,h,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(k){case"forwards":for(h=s.child,k=null;h!==null;)i=h.alternate,i!==null&&Xl(i)===null&&(k=h),h=h.sibling;h=k,h===null?(k=s.child,s.child=null):(k=h.sibling,h.sibling=null),Yf(s,!1,k,h,A,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,k=s.child,s.child=null;k!==null;){if(i=k.alternate,i!==null&&Xl(i)===null){s.child=k;break}i=k.sibling,k.sibling=h,h=k,k=i}Yf(s,!0,h,null,A,g);break;case"together":Yf(s,!1,null,null,void 0,g);break;default:s.memoizedState=null}return s.child}function Di(i,s,h){if(i!==null&&(s.dependencies=i.dependencies),hr|=s.lanes,(h&s.childLanes)===0)if(i!==null){if(Ms(i,s,h,!1),(h&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,h=Ei(i,i.pendingProps),s.child=h,h.return=s;i.sibling!==null;)i=i.sibling,h=h.sibling=Ei(i,i.pendingProps),h.return=s;h.sibling=null}return s.child}function Wf(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Pl(i)))}function ck(i,s,h){switch(s.tag){case 3:P(s,s.stateNode.containerInfo),ir(s,Ot,i.memoizedState.cache),Ir();break;case 27:case 5:ne(s);break;case 4:P(s,s.stateNode.containerInfo);break;case 10:ir(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,yf(s),null;break;case 13:var g=s.memoizedState;if(g!==null)return g.dehydrated!==null?(or(s),s.flags|=128,null):(h&s.child.childLanes)!==0?V_(i,s,h):(or(s),i=Di(i,s,h),i!==null?i.sibling:null);or(s);break;case 19:var k=(i.flags&128)!==0;if(g=(h&s.childLanes)!==0,g||(Ms(i,s,h,!1),g=(h&s.childLanes)!==0),k){if(g)return W_(i,s,h);s.flags|=128}if(k=s.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),U(Mt,Mt.current),g)break;return null;case 22:return s.lanes=0,F_(i,s,h,s.pendingProps);case 24:ir(s,Ot,i.memoizedState.cache)}return Di(i,s,h)}function X_(i,s,h){if(i!==null)if(i.memoizedProps!==s.pendingProps)It=!0;else{if(!Wf(i,h)&&(s.flags&128)===0)return It=!1,ck(i,s,h);It=(i.flags&131072)!==0}else It=!1,Qe&&(s.flags&1048576)!==0&&A0(s,$a,s.index);switch(s.lanes=0,s.tag){case 16:e:{var g=s.pendingProps;if(i=Pr(s.elementType),s.type=i,typeof i=="function")Qh(i)?(g=qr(i,g),s.tag=1,s=G_(null,s,i,g,h)):(s.tag=0,s=Pf(null,s,i,g,h));else{if(i!=null){var k=i.$$typeof;if(k===E){s.tag=11,s=I_(null,s,i,g,h);break e}else if(k===D){s.tag=14,s=z_(null,s,i,g,h);break e}}throw s=z(i)||i,Error(r(306,s,""))}}return s;case 0:return Pf(i,s,s.type,s.pendingProps,h);case 1:return g=s.type,k=qr(g,s.pendingProps),G_(i,s,g,k,h);case 3:e:{if(P(s,s.stateNode.containerInfo),i===null)throw Error(r(387));g=s.pendingProps;var A=s.memoizedState;k=A.element,pf(i,s),Za(s,g,null,h);var I=s.memoizedState;if(g=I.cache,ir(s,Ot,g),g!==A.cache&&lf(s,[Ot],h,!0),Ka(),g=I.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:I.cache},s.updateQueue.baseState=A,s.memoizedState=A,s.flags&256){s=q_(i,s,g,h);break e}else if(g!==k){k=In(Error(r(424)),s),Ga(k),s=q_(i,s,g,h);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(St=Un(i.firstChild),Wt=s,Qe=!0,tr=null,Fn=!0,h=F0(s,null,g,h),s.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Ir(),g===k){s=Di(i,s,h);break e}Kt(i,s,g,h)}s=s.child}return s;case 26:return ac(i,s),i===null?(h=ay(s.type,null,s.pendingProps,null))?s.memoizedState=h:Qe||(h=s.type,i=s.pendingProps,g=wc(ae.current).createElement(h),g[$t]=s,g[Qt]=i,Zt(g,h,i),Lt(g),s.stateNode=g):s.memoizedState=ay(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ne(s),i===null&&Qe&&(g=s.stateNode=iy(s.type,s.pendingProps,ae.current),Wt=s,Fn=!0,k=St,mr(s.type)?(Ad=k,St=Un(g.firstChild)):St=k),Kt(i,s,s.pendingProps.children,h),ac(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Qe&&((k=g=St)&&(g=Hk(g,s.type,s.pendingProps,Fn),g!==null?(s.stateNode=g,Wt=s,St=Un(g.firstChild),Fn=!1,k=!0):k=!1),k||nr(s)),ne(s),k=s.type,A=s.pendingProps,I=i!==null?i.memoizedProps:null,g=A.children,xd(k,A)?g=null:I!==null&&xd(k,I)&&(s.flags|=32),s.memoizedState!==null&&(k=Sf(i,s,ek,null,null,h),vo._currentValue=k),ac(i,s),Kt(i,s,g,h),s.child;case 6:return i===null&&Qe&&((i=h=St)&&(h=Fk(h,s.pendingProps,Fn),h!==null?(s.stateNode=h,Wt=s,St=null,i=!0):i=!1),i||nr(s)),null;case 13:return V_(i,s,h);case 4:return P(s,s.stateNode.containerInfo),g=s.pendingProps,i===null?s.child=$r(s,null,g,h):Kt(i,s,g,h),s.child;case 11:return I_(i,s,s.type,s.pendingProps,h);case 7:return Kt(i,s,s.pendingProps,h),s.child;case 8:return Kt(i,s,s.pendingProps.children,h),s.child;case 12:return Kt(i,s,s.pendingProps.children,h),s.child;case 10:return g=s.pendingProps,ir(s,s.type,g.value),Kt(i,s,g.children,h),s.child;case 9:return k=s.type._context,g=s.pendingProps.children,Hr(s),k=Xt(k),g=g(k),s.flags|=1,Kt(i,s,g,h),s.child;case 14:return z_(i,s,s.type,s.pendingProps,h);case 15:return H_(i,s,s.type,s.pendingProps,h);case 19:return W_(i,s,h);case 31:return lk(i,s,h);case 22:return F_(i,s,h,s.pendingProps);case 24:return Hr(s),g=Xt(Ot),i===null?(k=hf(),k===null&&(k=_t,A=cf(),k.pooledCache=A,A.refCount++,A!==null&&(k.pooledCacheLanes|=h),k=A),s.memoizedState={parent:g,cache:k},df(s),ir(s,Ot,k)):((i.lanes&h)!==0&&(pf(i,s),Za(s,null,null,h),Ka()),k=i.memoizedState,A=s.memoizedState,k.parent!==g?(k={parent:g,cache:g},s.memoizedState=k,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=k),ir(s,Ot,g)):(g=A.cache,ir(s,Ot,g),g!==k.cache&&lf(s,[Ot],h,!0))),Kt(i,s,s.pendingProps.children,h),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Mi(i){i.flags|=4}function Xf(i,s,h,g,k){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(k&335544128)===k)if(i.stateNode.complete)i.flags|=8192;else if(xv())i.flags|=8192;else throw Ur=ql,ff}else i.flags&=-16777217}function K_(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!hy(s))if(xv())i.flags|=8192;else throw Ur=ql,ff}function lc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?we():536870912,i.lanes|=s,Gs|=s)}function io(i,s){if(!Qe)switch(i.tailMode){case"hidden":s=i.tail;for(var h=null;s!==null;)s.alternate!==null&&(h=s),s=s.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,h=0,g=0;if(s)for(var k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags&65011712,g|=k.flags&65011712,k.return=i,k=k.sibling;else for(k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags,g|=k.flags,k.return=i,k=k.sibling;return i.subtreeFlags|=g,i.childLanes=h,s}function uk(i,s,h){var g=s.pendingProps;switch(nf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(s),null;case 1:return xt(s),null;case 3:return h=s.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),s.memoizedState.cache!==g&&(s.flags|=2048),Ni(Ot),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Ds(s)?Mi(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sf())),xt(s),null;case 26:var k=s.type,A=s.memoizedState;return i===null?(Mi(s),A!==null?(xt(s),K_(s,A)):(xt(s),Xf(s,k,null,g,h))):A?A!==i.memoizedState?(Mi(s),xt(s),K_(s,A)):(xt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==g&&Mi(s),xt(s),Xf(s,k,i,g,h)),null;case 27:if(ge(s),h=ae.current,k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}i=Q.current,Ds(s)?T0(s):(i=iy(k,g,h),s.stateNode=i,Mi(s))}return xt(s),null;case 5:if(ge(s),k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}if(A=Q.current,Ds(s))T0(s);else{var I=wc(ae.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?A.multiple=!0:g.size&&(A.size=g.size);break;default:A=typeof g.is=="string"?I.createElement(k,{is:g.is}):I.createElement(k)}}A[$t]=s,A[Qt]=g;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Zt(A,k,g),k){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Mi(s)}}return xt(s),Xf(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(typeof g!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Ds(s)){if(i=s.stateNode,h=s.memoizedProps,g=null,k=Wt,k!==null)switch(k.tag){case 27:case 5:g=k.memoizedProps}i[$t]=s,i=!!(i.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||Vv(i.nodeValue,h)),i||nr(s,!0)}else i=wc(i).createTextNode(g),i[$t]=s,s.stateNode=i}return xt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(g=Ds(s),h!==null){if(i===null){if(!g)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),i=!1}else h=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return xt(s),null;case 13:if(g=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Ds(s),g!==null&&g.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),k=!1}else k=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=g!==null,i=i!==null&&i.memoizedState!==null,h&&(g=s.child,k=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(k=g.alternate.memoizedState.cachePool.pool),A=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(A=g.memoizedState.cachePool.pool),A!==k&&(g.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),lc(s,s.updateQueue),xt(s),null);case 4:return ee(),i===null&&_d(s.stateNode.containerInfo),xt(s),null;case 10:return Ni(s.type),xt(s),null;case 19:if($(Mt),g=s.memoizedState,g===null)return xt(s),null;if(k=(s.flags&128)!==0,A=g.rendering,A===null)if(k)io(g,!1);else{if(Rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Xl(i),A!==null){for(s.flags|=128,io(g,!1),i=A.updateQueue,s.updateQueue=i,lc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)C0(h,i),h=h.sibling;return U(Mt,Mt.current&1|2),Qe&&ki(s,g.treeForkCount),s.child}i=i.sibling}g.tail!==null&&Fe()>dc&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304)}else{if(!k)if(i=Xl(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,lc(s,i),io(g,!0),g.tail===null&&g.tailMode==="hidden"&&!A.alternate&&!Qe)return xt(s),null}else 2*Fe()-g.renderingStartTime>dc&&h!==536870912&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304);g.isBackwards?(A.sibling=s.child,s.child=A):(i=g.last,i!==null?i.sibling=A:s.child=A,g.last=A)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Fe(),i.sibling=null,h=Mt.current,U(Mt,k?h&1|2:h&1),Qe&&ki(s,g.treeForkCount),i):(xt(s),null);case 22:case 23:return xn(s),vf(),g=s.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(s.flags|=8192):g&&(s.flags|=8192),g?(h&536870912)!==0&&(s.flags&128)===0&&(xt(s),s.subtreeFlags&6&&(s.flags|=8192)):xt(s),h=s.updateQueue,h!==null&&lc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==h&&(s.flags|=2048),i!==null&&$(Fr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ni(Ot),xt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function hk(i,s){switch(nf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ni(Ot),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return $(Mt),null;case 4:return ee(),null;case 10:return Ni(s.type),null;case 22:case 23:return xn(s),vf(),i!==null&&$(Fr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ni(Ot),null;case 25:return null;default:return null}}function Z_(i,s){switch(nf(s),s.tag){case 3:Ni(Ot),ee();break;case 26:case 27:case 5:ge(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:$(Mt);break;case 10:Ni(s.type);break;case 22:case 23:xn(s),vf(),i!==null&&$(Fr);break;case 24:Ni(Ot)}}function ro(i,s){try{var h=s.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var k=g.next;h=k;do{if((h.tag&i)===i){g=void 0;var A=h.create,I=h.inst;g=A(),I.destroy=g}h=h.next}while(h!==k)}}catch(W){dt(s,s.return,W)}}function cr(i,s,h){try{var g=s.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&i)===i){var I=g.inst,W=I.destroy;if(W!==void 0){I.destroy=void 0,k=s;var J=h,ce=W;try{ce()}catch(me){dt(k,J,me)}}}g=g.next}while(g!==A)}}catch(me){dt(s,s.return,me)}}function Q_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{U0(s,h)}catch(g){dt(i,i.return,g)}}}function J_(i,s,h){h.props=qr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(g){dt(i,s,g)}}function so(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof h=="function"?i.refCleanup=h(g):h.current=g}}catch(k){dt(i,s,k)}}function ai(i,s){var h=i.ref,g=i.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(k){dt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){dt(i,s,k)}else h.current=null}function ev(i){var s=i.type,h=i.memoizedProps,g=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(k){dt(i,i.return,k)}}function Kf(i,s,h){try{var g=i.stateNode;jk(g,i.type,h,s),g[Qt]=s}catch(k){dt(i,i.return,k)}}function tv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function Zf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||tv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qf(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=wi));else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(Qf(i,s,h),i=i.sibling;i!==null;)Qf(i,s,h),i=i.sibling}function cc(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(cc(i,s,h),i=i.sibling;i!==null;)cc(i,s,h),i=i.sibling}function nv(i){var s=i.stateNode,h=i.memoizedProps;try{for(var g=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Zt(s,g,h),s[$t]=i,s[Qt]=h}catch(A){dt(i,i.return,A)}}var ji=!1,zt=!1,Jf=!1,iv=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function fk(i,s){if(i=i.containerInfo,bd=Rc,i=g0(i),qh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var k=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,W=-1,J=-1,ce=0,me=0,ve=i,ue=null;t:for(;;){for(var pe;ve!==h||k!==0&&ve.nodeType!==3||(W=I+k),ve!==A||g!==0&&ve.nodeType!==3||(J=I+g),ve.nodeType===3&&(I+=ve.nodeValue.length),(pe=ve.firstChild)!==null;)ue=ve,ve=pe;for(;;){if(ve===i)break t;if(ue===h&&++ce===k&&(W=I),ue===A&&++me===g&&(J=I),(pe=ve.nextSibling)!==null)break;ve=ue,ue=ve.parentNode}ve=pe}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Sd={focusedElem:i,selectionRange:h},Rc=!1,Vt=s;Vt!==null;)if(s=Vt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Vt=i;else for(;Vt!==null;){switch(s=Vt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h<i.length;h++)k=i[h],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&A!==null){i=void 0,h=s,k=A.memoizedProps,A=A.memoizedState,g=h.stateNode;try{var Te=qr(h.type,k);i=g.getSnapshotBeforeUpdate(Te,A),g.__reactInternalSnapshotBeforeUpdate=i}catch(Be){dt(h,h.return,Be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,h=i.nodeType,h===9)Cd(i);else if(h===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Cd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Vt=i;break}Vt=s.return}}function rv(i,s,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Oi(i,h),g&4&&ro(5,h);break;case 1:if(Oi(i,h),g&4)if(i=h.stateNode,s===null)try{i.componentDidMount()}catch(I){dt(h,h.return,I)}else{var k=qr(h.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(k,s,i.__reactInternalSnapshotBeforeUpdate)}catch(I){dt(h,h.return,I)}}g&64&&Q_(h),g&512&&so(h,h.return);break;case 3:if(Oi(i,h),g&64&&(i=h.updateQueue,i!==null)){if(s=null,h.child!==null)switch(h.child.tag){case 27:case 5:s=h.child.stateNode;break;case 1:s=h.child.stateNode}try{U0(i,s)}catch(I){dt(h,h.return,I)}}break;case 27:s===null&&g&4&&nv(h);case 26:case 5:Oi(i,h),s===null&&g&4&&ev(h),g&512&&so(h,h.return);break;case 12:Oi(i,h);break;case 31:Oi(i,h),g&4&&ov(i,h);break;case 13:Oi(i,h),g&4&&lv(i,h),g&64&&(i=h.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(h=Sk.bind(null,h),Pk(i,h))));break;case 22:if(g=h.memoizedState!==null||ji,!g){s=s!==null&&s.memoizedState!==null||zt,k=ji;var A=zt;ji=g,(zt=s)&&!A?Bi(i,h,(h.subtreeFlags&8772)!==0):Oi(i,h),ji=k,zt=A}break;case 30:break;default:Oi(i,h)}}function sv(i){var s=i.alternate;s!==null&&(i.alternate=null,sv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Na(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var kt=null,cn=!1;function Li(i,s,h){for(h=h.child;h!==null;)av(i,s,h),h=h.sibling}function av(i,s,h){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Nt,h)}catch{}switch(h.tag){case 26:zt||ai(h,s),Li(i,s,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:zt||ai(h,s);var g=kt,k=cn;mr(h.type)&&(kt=h.stateNode,cn=!1),Li(i,s,h),go(h.stateNode),kt=g,cn=k;break;case 5:zt||ai(h,s);case 6:if(g=kt,k=cn,kt=null,Li(i,s,h),kt=g,cn=k,kt!==null)if(cn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(h.stateNode)}catch(A){dt(h,s,A)}else try{kt.removeChild(h.stateNode)}catch(A){dt(h,s,A)}break;case 18:kt!==null&&(cn?(i=kt,Qv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,h.stateNode),Qs(i)):Qv(kt,h.stateNode));break;case 4:g=kt,k=cn,kt=h.stateNode.containerInfo,cn=!0,Li(i,s,h),kt=g,cn=k;break;case 0:case 11:case 14:case 15:cr(2,h,s),zt||cr(4,h,s),Li(i,s,h);break;case 1:zt||(ai(h,s),g=h.stateNode,typeof g.componentWillUnmount=="function"&&J_(h,s,g)),Li(i,s,h);break;case 21:Li(i,s,h);break;case 22:zt=(g=zt)||h.memoizedState!==null,Li(i,s,h),zt=g;break;default:Li(i,s,h)}}function ov(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Qs(i)}catch(h){dt(s,s.return,h)}}}function lv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Qs(i)}catch(h){dt(s,s.return,h)}}function dk(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new iv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new iv),s;default:throw Error(r(435,i.tag))}}function uc(i,s){var h=dk(i);s.forEach(function(g){if(!h.has(g)){h.add(g);var k=xk.bind(null,i,g);g.then(k,k)}})}function un(i,s){var h=s.deletions;if(h!==null)for(var g=0;g<h.length;g++){var k=h[g],A=i,I=s,W=I;e:for(;W!==null;){switch(W.tag){case 27:if(mr(W.type)){kt=W.stateNode,cn=!1;break e}break;case 5:kt=W.stateNode,cn=!1;break e;case 3:case 4:kt=W.stateNode.containerInfo,cn=!0;break e}W=W.return}if(kt===null)throw Error(r(160));av(A,I,k),kt=null,cn=!1,A=k.alternate,A!==null&&(A.return=null),k.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)cv(s,i),s=s.sibling}var Yn=null;function cv(i,s){var h=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),hn(i),g&4&&(cr(3,i,i.return),ro(3,i),cr(5,i,i.return));break;case 1:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&64&&ji&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(h=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var k=Yn;if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&4){var A=h!==null?h.memoizedState:null;if(g=i.memoizedState,h===null)if(g===null)if(i.stateNode===null){e:{g=i.type,h=i.memoizedProps,k=k.ownerDocument||k;t:switch(g){case"title":A=k.getElementsByTagName("title")[0],(!A||A[Rr]||A[$t]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=k.createElement(g),k.head.insertBefore(A,k.querySelector("head > title"))),Zt(A,g,h),A[$t]=i,Lt(A),g=A;break e;case"link":var I=cy("link","href",k).get(g+(h.href||""));if(I){for(var W=0;W<I.length;W++)if(A=I[W],A.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&A.getAttribute("rel")===(h.rel==null?null:h.rel)&&A.getAttribute("title")===(h.title==null?null:h.title)&&A.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;case"meta":if(I=cy("meta","content",k).get(g+(h.content||""))){for(W=0;W<I.length;W++)if(A=I[W],A.getAttribute("content")===(h.content==null?null:""+h.content)&&A.getAttribute("name")===(h.name==null?null:h.name)&&A.getAttribute("property")===(h.property==null?null:h.property)&&A.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&A.getAttribute("charset")===(h.charSet==null?null:h.charSet)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;default:throw Error(r(468,g))}A[$t]=i,Lt(A),g=A}i.stateNode=g}else uy(k,i.type,i.stateNode);else i.stateNode=ly(k,g,i.memoizedProps);else A!==g?(A===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):A.count--,g===null?uy(k,i.type,i.stateNode):ly(k,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Kf(i,i.memoizedProps,h.memoizedProps)}break;case 27:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),h!==null&&g&4&&Kf(i,i.memoizedProps,h.memoizedProps);break;case 5:if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),i.flags&32){k=i.stateNode;try{Ss(k,"")}catch(Te){dt(i,i.return,Te)}}g&4&&i.stateNode!=null&&(k=i.memoizedProps,Kf(i,k,h!==null?h.memoizedProps:k)),g&1024&&(Jf=!0);break;case 6:if(un(s,i),hn(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,h=i.stateNode;try{h.nodeValue=g}catch(Te){dt(i,i.return,Te)}}break;case 3:if(kc=null,k=Yn,Yn=Cc(s.containerInfo),un(s,i),Yn=k,hn(i),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Qs(s.containerInfo)}catch(Te){dt(i,i.return,Te)}Jf&&(Jf=!1,uv(i));break;case 4:g=Yn,Yn=Cc(i.stateNode.containerInfo),un(s,i),hn(i),Yn=g;break;case 12:un(s,i),hn(i);break;case 31:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 13:un(s,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(fc=Fe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 22:k=i.memoizedState!==null;var J=h!==null&&h.memoizedState!==null,ce=ji,me=zt;if(ji=ce||k,zt=me||J,un(s,i),zt=me,ji=ce,hn(i),g&8192)e:for(s=i.stateNode,s._visibility=k?s._visibility&-2:s._visibility|1,k&&(h===null||J||ji||zt||Vr(i)),h=null,s=i;;){if(s.tag===5||s.tag===26){if(h===null){J=h=s;try{if(A=J.stateNode,k)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{W=J.stateNode;var ve=J.memoizedProps.style,ue=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;W.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===6){if(h===null){J=s;try{J.stateNode.nodeValue=k?"":J.memoizedProps}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===18){if(h===null){J=s;try{var pe=J.stateNode;k?Jv(pe,!0):Jv(J.stateNode,!1)}catch(Te){dt(J,J.return,Te)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;h===s&&(h=null),s=s.return}h===s&&(h=null),s.sibling.return=s.return,s=s.sibling}g&4&&(g=i.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,uc(i,h))));break;case 19:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 30:break;case 21:break;default:un(s,i),hn(i)}}function hn(i){var s=i.flags;if(s&2){try{for(var h,g=i.return;g!==null;){if(tv(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var k=h.stateNode,A=Zf(i);cc(i,A,k);break;case 5:var I=h.stateNode;h.flags&32&&(Ss(I,""),h.flags&=-33);var W=Zf(i);cc(i,W,I);break;case 3:case 4:var J=h.stateNode.containerInfo,ce=Zf(i);Qf(i,ce,J);break;default:throw Error(r(161))}}catch(me){dt(i,i.return,me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function uv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;uv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Oi(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)rv(i,s.alternate,s),s=s.sibling}function Vr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:cr(4,s,s.return),Vr(s);break;case 1:ai(s,s.return);var h=s.stateNode;typeof h.componentWillUnmount=="function"&&J_(s,s.return,h),Vr(s);break;case 27:go(s.stateNode);case 26:case 5:ai(s,s.return),Vr(s);break;case 22:s.memoizedState===null&&Vr(s);break;case 30:Vr(s);break;default:Vr(s)}i=i.sibling}}function Bi(i,s,h){for(h=h&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var g=s.alternate,k=i,A=s,I=A.flags;switch(A.tag){case 0:case 11:case 15:Bi(k,A,h),ro(4,A);break;case 1:if(Bi(k,A,h),g=A,k=g.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(ce){dt(g,g.return,ce)}if(g=A,k=g.updateQueue,k!==null){var W=g.stateNode;try{var J=k.shared.hiddenCallbacks;if(J!==null)for(k.shared.hiddenCallbacks=null,k=0;k<J.length;k++)P0(J[k],W)}catch(ce){dt(g,g.return,ce)}}h&&I&64&&Q_(A),so(A,A.return);break;case 27:nv(A);case 26:case 5:Bi(k,A,h),h&&g===null&&I&4&&ev(A),so(A,A.return);break;case 12:Bi(k,A,h);break;case 31:Bi(k,A,h),h&&I&4&&ov(k,A);break;case 13:Bi(k,A,h),h&&I&4&&lv(k,A);break;case 22:A.memoizedState===null&&Bi(k,A,h),so(A,A.return);break;case 30:break;default:Bi(k,A,h)}s=s.sibling}}function ed(i,s){var h=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==h&&(i!=null&&i.refCount++,h!=null&&qa(h))}function td(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i))}function Wn(i,s,h,g){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hv(i,s,h,g),s=s.sibling}function hv(i,s,h,g){var k=s.flags;switch(s.tag){case 0:case 11:case 15:Wn(i,s,h,g),k&2048&&ro(9,s);break;case 1:Wn(i,s,h,g);break;case 3:Wn(i,s,h,g),k&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i)));break;case 12:if(k&2048){Wn(i,s,h,g),i=s.stateNode;try{var A=s.memoizedProps,I=A.id,W=A.onPostCommit;typeof W=="function"&&W(I,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(J){dt(s,s.return,J)}}else Wn(i,s,h,g);break;case 31:Wn(i,s,h,g);break;case 13:Wn(i,s,h,g);break;case 23:break;case 22:A=s.stateNode,I=s.alternate,s.memoizedState!==null?A._visibility&2?Wn(i,s,h,g):ao(i,s):A._visibility&2?Wn(i,s,h,g):(A._visibility|=2,Ps(i,s,h,g,(s.subtreeFlags&10256)!==0||!1)),k&2048&&ed(I,s);break;case 24:Wn(i,s,h,g),k&2048&&td(s.alternate,s);break;default:Wn(i,s,h,g)}}function Ps(i,s,h,g,k){for(k=k&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var A=i,I=s,W=h,J=g,ce=I.flags;switch(I.tag){case 0:case 11:case 15:Ps(A,I,W,J,k),ro(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?Ps(A,I,W,J,k):ao(A,I):(me._visibility|=2,Ps(A,I,W,J,k)),k&&ce&2048&&ed(I.alternate,I);break;case 24:Ps(A,I,W,J,k),k&&ce&2048&&td(I.alternate,I);break;default:Ps(A,I,W,J,k)}s=s.sibling}}function ao(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var h=i,g=s,k=g.flags;switch(g.tag){case 22:ao(h,g),k&2048&&ed(g.alternate,g);break;case 24:ao(h,g),k&2048&&td(g.alternate,g);break;default:ao(h,g)}s=s.sibling}}var oo=8192;function Us(i,s,h){if(i.subtreeFlags&oo)for(i=i.child;i!==null;)fv(i,s,h),i=i.sibling}function fv(i,s,h){switch(i.tag){case 26:Us(i,s,h),i.flags&oo&&i.memoizedState!==null&&Jk(h,Yn,i.memoizedState,i.memoizedProps);break;case 5:Us(i,s,h);break;case 3:case 4:var g=Yn;Yn=Cc(i.stateNode.containerInfo),Us(i,s,h),Yn=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=oo,oo=16777216,Us(i,s,h),oo=g):Us(i,s,h));break;default:Us(i,s,h)}}function dv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function lo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(i),i=i.sibling}function pv(i){switch(i.tag){case 0:case 11:case 15:lo(i),i.flags&2048&&cr(9,i,i.return);break;case 3:lo(i);break;case 12:lo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,hc(i)):lo(i);break;default:lo(i)}}function hc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:cr(8,s,s.return),hc(s);break;case 22:h=s.stateNode,h._visibility&2&&(h._visibility&=-3,hc(s));break;default:hc(s)}i=i.sibling}}function gv(i,s){for(;Vt!==null;){var h=Vt;switch(h.tag){case 0:case 11:case 15:cr(8,h,s);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:qa(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Vt=g;else e:for(h=i;Vt!==null;){g=Vt;var k=g.sibling,A=g.return;if(sv(g),g===h){Vt=null;break e}if(k!==null){k.return=A,Vt=k;break e}Vt=A}}}var pk={getCacheForType:function(i){var s=Xt(Ot),h=s.data.get(i);return h===void 0&&(h=i(),s.data.set(i,h)),h},cacheSignal:function(){return Xt(Ot).controller.signal}},gk=typeof WeakMap=="function"?WeakMap:Map,ot=0,_t=null,Ye=null,Ke=0,ft=0,wn=null,ur=!1,$s=!1,nd=!1,Ii=0,Rt=0,hr=0,Yr=0,id=0,Cn=0,Gs=0,co=null,fn=null,rd=!1,fc=0,mv=0,dc=1/0,pc=null,fr=null,Gt=0,dr=null,qs=null,zi=0,sd=0,ad=null,_v=null,uo=0,od=null;function En(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:G.T!==null?dd():yl()}function vv(){if(Cn===0)if((Ke&536870912)===0||Qe){var i=_i;_i<<=1,(_i&3932160)===0&&(_i=262144),Cn=i}else Cn=536870912;return i=Sn.current,i!==null&&(i.flags|=32),Cn}function dn(i,s,h){(i===_t&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),pr(i,Ke,Cn,!1)),qe(i,h),((ot&2)===0||i!==_t)&&(i===_t&&((ot&2)===0&&(Yr|=h),Rt===4&&pr(i,Ke,Cn,!1)),oi(i))}function yv(i,s,h){if((ot&6)!==0)throw Error(r(327));var g=!h&&(s&127)===0&&(s&i.expiredLanes)===0||ni(i,s),k=g?vk(i,s):cd(i,s,!0),A=g;do{if(k===0){$s&&!g&&pr(i,s,0,!1);break}else{if(h=i.current.alternate,A&&!mk(h)){k=cd(i,s,!1),A=!1;continue}if(k===2){if(A=s,i.errorRecoveryDisabledLanes&A)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){s=I;e:{var W=i;k=co;var J=W.current.memoizedState.isDehydrated;if(J&&(Vs(W,I).flags|=256),I=cd(W,I,!1),I!==2){if(nd&&!J){W.errorRecoveryDisabledLanes|=A,Yr|=A,k=4;break e}A=fn,fn=k,A!==null&&(fn===null?fn=A:fn.push.apply(fn,A))}k=I}if(A=!1,k!==2)continue}}if(k===1){Vs(i,0),pr(i,s,0,!0);break}e:{switch(g=i,A=k,A){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:pr(g,s,Cn,!ur);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(k=fc+300-Fe(),10<k)){if(pr(g,s,Cn,!ur),yi(g,0,!0)!==0)break e;zi=s,g.timeoutHandle=Kv(bv.bind(null,g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,"Throttled",-0,0),k);break e}bv(g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,null,-0,0)}}break}while(!0);oi(i)}function bv(i,s,h,g,k,A,I,W,J,ce,me,ve,ue,pe){if(i.timeoutHandle=-1,ve=s.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},fv(s,A,ve);var Te=(A&62914560)===A?fc-Fe():(A&4194048)===A?mv-Fe():0;if(Te=eA(ve,Te),Te!==null){zi=A,i.cancelPendingCommit=Te(Nv.bind(null,i,s,A,h,g,k,I,W,J,me,ve,null,ue,pe)),pr(i,A,I,!ce);return}}Nv(i,s,A,h,g,k,I,W,J)}function mk(i){for(var s=i;;){var h=s.tag;if((h===0||h===11||h===15)&&s.flags&16384&&(h=s.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var k=h[g],A=k.getSnapshot;k=k.value;try{if(!yn(A(),k))return!1}catch{return!1}}if(h=s.child,s.subtreeFlags&16384&&h!==null)h.return=s,s=h;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function pr(i,s,h,g){s&=~id,s&=~Yr,i.suspendedLanes|=s,i.pingedLanes&=~s,g&&(i.warmLanes|=s),g=i.expirationTimes;for(var k=s;0<k;){var A=31-st(k),I=1<<A;g[A]=-1,k&=~I}h!==0&&bi(i,h,s)}function gc(){return(ot&6)===0?(ho(0),!1):!0}function ld(){if(Ye!==null){if(ft===0)var i=Ye.return;else i=Ye,Ai=zr=null,Cf(i),Bs=null,Ya=0,i=Ye;for(;i!==null;)Z_(i.alternate,i),i=i.return;Ye=null}}function Vs(i,s){var h=i.timeoutHandle;h!==-1&&(i.timeoutHandle=-1,Bk(h)),h=i.cancelPendingCommit,h!==null&&(i.cancelPendingCommit=null,h()),zi=0,ld(),_t=i,Ye=h=Ei(i.current,null),Ke=s,ft=0,wn=null,ur=!1,$s=ni(i,s),nd=!1,Gs=Cn=id=Yr=hr=Rt=0,fn=co=null,rd=!1,(s&8)!==0&&(s|=s&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=s;0<g;){var k=31-st(g),A=1<<k;s|=i[k],g&=~A}return Ii=s,Bl(),h}function Sv(i,s){Pe=null,G.H=to,s===Os||s===Gl?(s=I0(),ft=3):s===ff?(s=I0(),ft=4):ft=s===Ff?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wn=s,Ye===null&&(Rt=1,rc(i,In(s,i.current)))}function xv(){var i=Sn.current;return i===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?i===Pn:!1}function wv(){var i=G.H;return G.H=to,i===null?to:i}function Cv(){var i=G.A;return G.A=pk,i}function mc(){Rt=4,ur||(Ke&4194048)!==Ke&&Sn.current!==null||($s=!0),(hr&134217727)===0&&(Yr&134217727)===0||_t===null||pr(_t,Ke,Cn,!1)}function cd(i,s,h){var g=ot;ot|=2;var k=wv(),A=Cv();(_t!==i||Ke!==s)&&(pc=null,Vs(i,s)),s=!1;var I=Rt;e:do try{if(ft!==0&&Ye!==null){var W=Ye,J=wn;switch(ft){case 8:ld(),I=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(s=!0);var ce=ft;if(ft=0,wn=null,Ys(i,W,J,ce),h&&$s){I=0;break e}break;default:ce=ft,ft=0,wn=null,Ys(i,W,J,ce)}}_k(),I=Rt;break}catch(me){Sv(i,me)}while(!0);return s&&i.shellSuspendCounter++,Ai=zr=null,ot=g,G.H=k,G.A=A,Ye===null&&(_t=null,Ke=0,Bl()),I}function _k(){for(;Ye!==null;)Ev(Ye)}function vk(i,s){var h=ot;ot|=2;var g=wv(),k=Cv();_t!==i||Ke!==s?(pc=null,dc=Fe()+500,Vs(i,s)):$s=ni(i,s);e:do try{if(ft!==0&&Ye!==null){s=Ye;var A=wn;t:switch(ft){case 1:ft=0,wn=null,Ys(i,s,A,1);break;case 2:case 9:if(O0(A)){ft=0,wn=null,kv(s);break}s=function(){ft!==2&&ft!==9||_t!==i||(ft=7),oi(i)},A.then(s,s);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:O0(A)?(ft=0,wn=null,kv(s)):(ft=0,wn=null,Ys(i,s,A,7));break;case 5:var I=null;switch(Ye.tag){case 26:I=Ye.memoizedState;case 5:case 27:var W=Ye;if(I?hy(I):W.stateNode.complete){ft=0,wn=null;var J=W.sibling;if(J!==null)Ye=J;else{var ce=W.return;ce!==null?(Ye=ce,_c(ce)):Ye=null}break t}}ft=0,wn=null,Ys(i,s,A,5);break;case 6:ft=0,wn=null,Ys(i,s,A,6);break;case 8:ld(),Rt=6;break e;default:throw Error(r(462))}}yk();break}catch(me){Sv(i,me)}while(!0);return Ai=zr=null,G.H=g,G.A=k,ot=h,Ye!==null?0:(_t=null,Ke=0,Bl(),Rt)}function yk(){for(;Ye!==null&&!Pt();)Ev(Ye)}function Ev(i){var s=X_(i.alternate,i,Ii);i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function kv(i){var s=i,h=s.alternate;switch(s.tag){case 15:case 0:s=$_(h,s,s.pendingProps,s.type,void 0,Ke);break;case 11:s=$_(h,s,s.pendingProps,s.type.render,s.ref,Ke);break;case 5:Cf(s);default:Z_(h,s),s=Ye=C0(s,Ii),s=X_(h,s,Ii)}i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function Ys(i,s,h,g){Ai=zr=null,Cf(s),Bs=null,Ya=0;var k=s.return;try{if(ok(i,k,s,h,Ke)){Rt=1,rc(i,In(h,i.current)),Ye=null;return}}catch(A){if(k!==null)throw Ye=k,A;Rt=1,rc(i,In(h,i.current)),Ye=null;return}s.flags&32768?(Qe||g===1?i=!0:$s||(Ke&536870912)!==0?i=!1:(ur=i=!0,(g===2||g===9||g===3||g===6)&&(g=Sn.current,g!==null&&g.tag===13&&(g.flags|=16384))),Av(s,i)):_c(s)}function _c(i){var s=i;do{if((s.flags&32768)!==0){Av(s,ur);return}i=s.return;var h=uk(s.alternate,s,Ii);if(h!==null){Ye=h;return}if(s=s.sibling,s!==null){Ye=s;return}Ye=s=i}while(s!==null);Rt===0&&(Rt=5)}function Av(i,s){do{var h=hk(i.alternate,i);if(h!==null){h.flags&=32767,Ye=h;return}if(h=i.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!s&&(i=i.sibling,i!==null)){Ye=i;return}Ye=i=h}while(i!==null);Rt=6,Ye=null}function Nv(i,s,h,g,k,A,I,W,J){i.cancelPendingCommit=null;do vc();while(Gt!==0);if((ot&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(A=s.lanes|s.childLanes,A|=Kh,at(i,h,A,I,W,J),i===_t&&(Ye=_t=null,Ke=0),qs=s,dr=i,zi=h,sd=A,ad=k,_v=g,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,wk(Se,function(){return jv(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||g){g=G.T,G.T=null,k=X.p,X.p=2,I=ot,ot|=4;try{fk(i,s,h)}finally{ot=I,X.p=k,G.T=g}}Gt=1,Tv(),Rv(),Dv()}}function Tv(){if(Gt===1){Gt=0;var i=dr,s=qs,h=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||h){h=G.T,G.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{cv(s,i);var A=Sd,I=g0(i.containerInfo),W=A.focusedElem,J=A.selectionRange;if(I!==W&&W&&W.ownerDocument&&p0(W.ownerDocument.documentElement,W)){if(J!==null&&qh(W)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in W)W.selectionStart=ce,W.selectionEnd=Math.min(me,W.value.length);else{var ve=W.ownerDocument||document,ue=ve&&ve.defaultView||window;if(ue.getSelection){var pe=ue.getSelection(),Te=W.textContent.length,Be=Math.min(J.start,Te),mt=J.end===void 0?Be:Math.min(J.end,Te);!pe.extend&&Be>mt&&(I=mt,mt=Be,Be=I);var se=d0(W,Be),te=d0(W,mt);if(se&&te&&(pe.rangeCount!==1||pe.anchorNode!==se.node||pe.anchorOffset!==se.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var le=ve.createRange();le.setStart(se.node,se.offset),pe.removeAllRanges(),Be>mt?(pe.addRange(le),pe.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),pe.addRange(le))}}}}for(ve=[],pe=W;pe=pe.parentNode;)pe.nodeType===1&&ve.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<ve.length;W++){var _e=ve[W];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Rc=!!bd,Sd=bd=null}finally{ot=k,X.p=g,G.T=h}}i.current=s,Gt=2}}function Rv(){if(Gt===2){Gt=0;var i=dr,s=qs,h=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||h){h=G.T,G.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{rv(i,s.alternate,s)}finally{ot=k,X.p=g,G.T=h}}Gt=3}}function Dv(){if(Gt===4||Gt===3){Gt=0,ht();var i=dr,s=qs,h=zi,g=_v;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gt=5:(Gt=0,qs=dr=null,Mv(i,i.pendingLanes));var k=i.pendingLanes;if(k===0&&(fr=null),Aa(h),s=s.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Nt,s,void 0,(s.current.flags&128)===128)}catch{}if(g!==null){s=G.T,k=X.p,X.p=2,G.T=null;try{for(var A=i.onRecoverableError,I=0;I<g.length;I++){var W=g[I];A(W.value,{componentStack:W.stack})}}finally{G.T=s,X.p=k}}(zi&3)!==0&&vc(),oi(i),k=i.pendingLanes,(h&261930)!==0&&(k&42)!==0?i===od?uo++:(uo=0,od=i):uo=0,ho(0)}}function Mv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,qa(s)))}function vc(){return Tv(),Rv(),Dv(),jv()}function jv(){if(Gt!==5)return!1;var i=dr,s=sd;sd=0;var h=Aa(zi),g=G.T,k=X.p;try{X.p=32>h?32:h,G.T=null,h=ad,ad=null;var A=dr,I=zi;if(Gt=0,qs=dr=null,zi=0,(ot&6)!==0)throw Error(r(331));var W=ot;if(ot|=4,pv(A.current),hv(A,A.current,I,h),ot=W,ho(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Nt,A)}catch{}return!0}finally{X.p=k,G.T=g,Mv(i,s)}}function Lv(i,s,h){s=In(h,s),s=Hf(i.stateNode,s,2),i=ar(i,s,2),i!==null&&(qe(i,2),oi(i))}function dt(i,s,h){if(i.tag===3)Lv(i,i,h);else for(;s!==null;){if(s.tag===3){Lv(s,i,h);break}else if(s.tag===1){var g=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(fr===null||!fr.has(g))){i=In(h,i),h=O_(2),g=ar(s,h,2),g!==null&&(B_(h,g,s,i),qe(g,2),oi(g));break}}s=s.return}}function ud(i,s,h){var g=i.pingCache;if(g===null){g=i.pingCache=new gk;var k=new Set;g.set(s,k)}else k=g.get(s),k===void 0&&(k=new Set,g.set(s,k));k.has(h)||(nd=!0,k.add(h),i=bk.bind(null,i,s,h),s.then(i,i))}function bk(i,s,h){var g=i.pingCache;g!==null&&g.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,_t===i&&(Ke&h)===h&&(Rt===4||Rt===3&&(Ke&62914560)===Ke&&300>Fe()-fc?(ot&2)===0&&Vs(i,0):id|=h,Gs===Ke&&(Gs=0)),oi(i)}function Ov(i,s){s===0&&(s=we()),i=Or(i,s),i!==null&&(qe(i,s),oi(i))}function Sk(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),Ov(i,h)}function xk(i,s){var h=0;switch(i.tag){case 31:case 13:var g=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(s),Ov(i,h)}function wk(i,s){return Ge(i,s)}var yc=null,Ws=null,hd=!1,bc=!1,fd=!1,gr=0;function oi(i){i!==Ws&&i.next===null&&(Ws===null?yc=Ws=i:Ws=Ws.next=i),bc=!0,hd||(hd=!0,Ek())}function ho(i,s){if(!fd&&bc){fd=!0;do for(var h=!1,g=yc;g!==null;){if(i!==0){var k=g.pendingLanes;if(k===0)var A=0;else{var I=g.suspendedLanes,W=g.pingedLanes;A=(1<<31-st(42|i)+1)-1,A&=k&~(I&~W),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Hv(g,A))}else A=Ke,A=yi(g,g===_t?A:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(A&3)===0||ni(g,A)||(h=!0,Hv(g,A));g=g.next}while(h);fd=!1}}function Ck(){Bv()}function Bv(){bc=hd=!1;var i=0;gr!==0&&Ok()&&(i=gr);for(var s=Fe(),h=null,g=yc;g!==null;){var k=g.next,A=Iv(g,s);A===0?(g.next=null,h===null?yc=k:h.next=k,k===null&&(Ws=h)):(h=g,(i!==0||(A&3)!==0)&&(bc=!0)),g=k}Gt!==0&&Gt!==5||ho(i),gr!==0&&(gr=0)}function Iv(i,s){for(var h=i.suspendedLanes,g=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0<A;){var I=31-st(A),W=1<<I,J=k[I];J===-1?((W&h)===0||(W&g)!==0)&&(k[I]=oe(W,s)):J<=s&&(i.expiredLanes|=W),A&=~W}if(s=_t,h=Ke,h=yi(i,i===s?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,h===0||i===s&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&ct(g),i.callbackNode=null,i.callbackPriority=0;if((h&3)===0||ni(i,h)){if(s=h&-h,s===i.callbackPriority)return s;switch(g!==null&&ct(g),Aa(h)){case 2:case 8:h=de;break;case 32:h=Se;break;case 268435456:h=De;break;default:h=Se}return g=zv.bind(null,i),h=Ge(h,g),i.callbackPriority=s,i.callbackNode=h,s}return g!==null&&g!==null&&ct(g),i.callbackPriority=2,i.callbackNode=null,2}function zv(i,s){if(Gt!==0&&Gt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var h=i.callbackNode;if(vc()&&i.callbackNode!==h)return null;var g=Ke;return g=yi(i,i===_t?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(yv(i,g,s),Iv(i,Fe()),i.callbackNode!=null&&i.callbackNode===h?zv.bind(null,i):null)}function Hv(i,s){if(vc())return null;yv(i,s,!0)}function Ek(){Ik(function(){(ot&6)!==0?Ge(ie,Ck):Bv()})}function dd(){if(gr===0){var i=js;i===0&&(i=mi,mi<<=1,(mi&261888)===0&&(mi=256)),gr=i}return gr}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Nl(""+i)}function Pv(i,s){var h=s.ownerDocument.createElement("input");return h.name=s.name,h.value=s.value,i.id&&h.setAttribute("form",i.id),s.parentNode.insertBefore(h,s),i=new FormData(i),h.parentNode.removeChild(h),i}function kk(i,s,h,g,k){if(s==="submit"&&h&&h.stateNode===k){var A=Fv((k[Qt]||null).action),I=g.submitter;I&&(s=(s=I[Qt]||null)?Fv(s.formAction):I.getAttribute("formAction"),s!==null&&(A=s,I=null));var W=new Ml("action","action",null,g,k);i.push({event:W,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(gr!==0){var J=I?Pv(k,I):new FormData(k);jf(h,{pending:!0,data:J,method:k.method,action:A},null,J)}}else typeof A=="function"&&(W.preventDefault(),J=I?Pv(k,I):new FormData(k),jf(h,{pending:!0,data:J,method:k.method,action:A},A,J))},currentTarget:k}]})}}for(var pd=0;pd<Xh.length;pd++){var gd=Xh[pd],Ak=gd.toLowerCase(),Nk=gd[0].toUpperCase()+gd.slice(1);Vn(Ak,"on"+Nk)}Vn(v0,"onAnimationEnd"),Vn(y0,"onAnimationIteration"),Vn(b0,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(GE,"onTransitionRun"),Vn(qE,"onTransitionStart"),Vn(VE,"onTransitionCancel"),Vn(S0,"onTransitionEnd"),Zi("onMouseEnter",["mouseout","mouseover"]),Zi("onMouseLeave",["mouseout","mouseover"]),Zi("onPointerEnter",["pointerout","pointerover"]),Zi("onPointerLeave",["pointerout","pointerover"]),xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function Uv(i,s){s=(s&4)!==0;for(var h=0;h<i.length;h++){var g=i[h],k=g.event;g=g.listeners;e:{var A=void 0;if(s)for(var I=g.length-1;0<=I;I--){var W=g[I],J=W.instance,ce=W.currentTarget;if(W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}else for(I=0;I<g.length;I++){if(W=g[I],J=W.instance,ce=W.currentTarget,W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}}}}function We(i,s){var h=s[ms];h===void 0&&(h=s[ms]=new Set);var g=i+"__bubble";h.has(g)||($v(s,i,2,!1),h.add(g))}function md(i,s,h){var g=0;s&&(g|=4),$v(h,i,g,s)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function _d(i){if(!i[Sc]){i[Sc]=!0,wl.forEach(function(h){h!=="selectionchange"&&(Tk.has(h)||md(h,!1,i),md(h,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Sc]||(s[Sc]=!0,md("selectionchange",!1,s))}}function $v(i,s,h,g){switch(vy(s)){case 2:var k=iA;break;case 8:k=rA;break;default:k=Md}h=k.bind(null,s,h,i),k=void 0,!Bh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(k=!0),g?k!==void 0?i.addEventListener(s,h,{capture:!0,passive:k}):i.addEventListener(s,h,!0):k!==void 0?i.addEventListener(s,h,{passive:k}):i.addEventListener(s,h,!1)}function vd(i,s,h,g,k){var A=g;if((s&1)===0&&(s&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var W=g.stateNode.containerInfo;if(W===k)break;if(I===4)for(I=g.return;I!==null;){var J=I.tag;if((J===3||J===4)&&I.stateNode.containerInfo===k)return;I=I.return}for(;W!==null;){if(I=Yi(W),I===null)return;if(J=I.tag,J===5||J===6||J===26||J===27){g=A=I;continue e}W=W.parentNode}}g=g.return}Wm(function(){var ce=A,me=Lh(h),ve=[];e:{var ue=x0.get(i);if(ue!==void 0){var pe=Ml,Te=i;switch(i){case"keypress":if(Rl(h)===0)break e;case"keydown":case"keyup":pe=xE;break;case"focusin":Te="focus",pe=Fh;break;case"focusout":Te="blur",pe=Fh;break;case"beforeblur":case"afterblur":pe=Fh;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=uE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=EE;break;case v0:case y0:case b0:pe=dE;break;case S0:pe=AE;break;case"scroll":case"scrollend":pe=lE;break;case"wheel":pe=TE;break;case"copy":case"cut":case"paste":pe=gE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Jm;break;case"toggle":case"beforetoggle":pe=DE}var Be=(s&4)!==0,mt=!Be&&(i==="scroll"||i==="scrollend"),se=Be?ue!==null?ue+"Capture":null:ue;Be=[];for(var te=ce,le;te!==null;){var _e=te;if(le=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||le===null||se===null||(_e=La(te,se),_e!=null&&Be.push(po(te,_e,le))),mt)break;te=te.return}0<Be.length&&(ue=new pe(ue,Te,null,h,me),ve.push({event:ue,listeners:Be}))}}if((s&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",ue&&h!==jh&&(Te=h.relatedTarget||h.fromElement)&&(Yi(Te)||Te[Si]))break e;if((pe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,pe?(Te=h.relatedTarget||h.toElement,pe=ce,Te=Te?Yi(Te):null,Te!==null&&(mt=l(Te),Be=Te.tag,Te!==mt||Be!==5&&Be!==27&&Be!==6)&&(Te=null)):(pe=null,Te=ce),pe!==Te)){if(Be=Zm,_e="onMouseLeave",se="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(Be=Jm,_e="onPointerLeave",se="onPointerEnter",te="pointer"),mt=pe==null?ue:Xi(pe),le=Te==null?ue:Xi(Te),ue=new Be(_e,te+"leave",pe,h,me),ue.target=mt,ue.relatedTarget=le,_e=null,Yi(me)===ce&&(Be=new Be(se,te+"enter",Te,h,me),Be.target=le,Be.relatedTarget=mt,_e=Be),mt=_e,pe&&Te)t:{for(Be=Rk,se=pe,te=Te,le=0,_e=se;_e;_e=Be(_e))le++;_e=0;for(var Le=te;Le;Le=Be(Le))_e++;for(;0<le-_e;)se=Be(se),le--;for(;0<_e-le;)te=Be(te),_e--;for(;le--;){if(se===te||te!==null&&se===te.alternate){Be=se;break t}se=Be(se),te=Be(te)}Be=null}else Be=null;pe!==null&&Gv(ve,ue,pe,Be,!1),Te!==null&&mt!==null&&Gv(ve,mt,Te,Be,!0)}}e:{if(ue=ce?Xi(ce):window,pe=ue.nodeName&&ue.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ue.type==="file")var nt=o0;else if(s0(ue))if(l0)nt=PE;else{nt=HE;var Re=zE}else pe=ue.nodeName,!pe||pe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Mh(ce.elementType)&&(nt=o0):nt=FE;if(nt&&(nt=nt(i,ce))){a0(ve,nt,h,me);break e}Re&&Re(i,ue,ce),i==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Ma(ue,"number",ue.value)}switch(Re=ce?Xi(ce):window,i){case"focusin":(s0(Re)||Re.contentEditable==="true")&&(Es=Re,Vh=ce,Ua=null);break;case"focusout":Ua=Vh=Es=null;break;case"mousedown":Yh=!0;break;case"contextmenu":case"mouseup":case"dragend":Yh=!1,m0(ve,h,me);break;case"selectionchange":if($E)break;case"keydown":case"keyup":m0(ve,h,me)}var Ue;if(Uh)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Cs?i0(i,h)&&(Ze="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ze="onCompositionStart");Ze&&(e0&&h.locale!=="ko"&&(Cs||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Cs&&(Ue=Xm()):(Ji=me,Ih="value"in Ji?Ji.value:Ji.textContent,Cs=!0)),Re=xc(ce,Ze),0<Re.length&&(Ze=new Qm(Ze,i,null,h,me),ve.push({event:Ze,listeners:Re}),Ue?Ze.data=Ue:(Ue=r0(h),Ue!==null&&(Ze.data=Ue)))),(Ue=jE?LE(i,h):OE(i,h))&&(Ze=xc(ce,"onBeforeInput"),0<Ze.length&&(Re=new Qm("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:Ze}),Re.data=Ue)),kk(ve,i,ce,h,me)}Uv(ve,s)})}function po(i,s,h){return{instance:i,listener:s,currentTarget:h}}function xc(i,s){for(var h=s+"Capture",g=[];i!==null;){var k=i,A=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||A===null||(k=La(i,h),k!=null&&g.unshift(po(i,k,A)),k=La(i,s),k!=null&&g.push(po(i,k,A))),i.tag===3)return g;i=i.return}return[]}function Rk(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gv(i,s,h,g,k){for(var A=s._reactName,I=[];h!==null&&h!==g;){var W=h,J=W.alternate,ce=W.stateNode;if(W=W.tag,J!==null&&J===g)break;W!==5&&W!==26&&W!==27||ce===null||(J=ce,k?(ce=La(h,A),ce!=null&&I.unshift(po(h,ce,J))):k||(ce=La(h,A),ce!=null&&I.push(po(h,ce,J)))),h=h.return}I.length!==0&&i.push({event:s,listeners:I})}var Dk=/\r\n?/g,Mk=/\u0000|\uFFFD/g;function qv(i){return(typeof i=="string"?i:""+i).replace(Dk,` -`).replace(Mk,"")}function Vv(i,s){return s=qv(s),qv(i)===s}function gt(i,s,h,g,k,A){switch(h){case"children":typeof g=="string"?s==="body"||s==="textarea"&&g===""||Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&s!=="body"&&Ss(i,""+g);break;case"className":vs(i,"class",g);break;case"tabIndex":vs(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,h,g);break;case"style":Vm(i,g,A);break;case"data":if(s!=="object"){vs(i,"data",g);break}case"src":case"href":if(g===""&&(s!=="a"||h!=="href")){i.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(h==="formAction"?(s!=="input"&>(i,s,"name",k.name,k,null),gt(i,s,"formEncType",k.formEncType,k,null),gt(i,s,"formMethod",k.formMethod,k,null),gt(i,s,"formTarget",k.formTarget,k,null)):(gt(i,s,"encType",k.encType,k,null),gt(i,s,"method",k.method,k,null),gt(i,s,"target",k.target,k,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"onClick":g!=null&&(i.onclick=wi);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}h=Nl(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""+g):i.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""):i.removeAttribute(h);break;case"capture":case"download":g===!0?i.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,g):i.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(h,g):i.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(h):i.setAttribute(h,g);break;case"popover":We("beforetoggle",i),We("toggle",i),_s(i,"popover",g);break;case"xlinkActuate":qn(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":qn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":qn(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":qn(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":qn(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":qn(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":qn(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":qn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":qn(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":_s(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=aE.get(h)||h,_s(i,h,g))}}function yd(i,s,h,g,k,A){switch(h){case"style":Vm(i,g,A);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"children":typeof g=="string"?Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&Ss(i,""+g);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"onClick":g!=null&&(i.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cl.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(k=h.endsWith("Capture"),s=h.slice(2,k?h.length-7:void 0),A=i[Qt]||null,A=A!=null?A[h]:null,typeof A=="function"&&i.removeEventListener(s,A,k),typeof g=="function")){typeof A!="function"&&A!==null&&(h in i?i[h]=null:i.hasAttribute(h)&&i.removeAttribute(h)),i.addEventListener(s,g,k);break e}h in i?i[h]=g:g===!0?i.setAttribute(h,""):_s(i,h,g)}}}function Zt(i,s,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var g=!1,k=!1,A;for(A in h)if(h.hasOwnProperty(A)){var I=h[A];if(I!=null)switch(A){case"src":g=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,A,I,h,null)}}k&>(i,s,"srcSet",h.srcSet,h,null),g&>(i,s,"src",h.src,h,null);return;case"input":We("invalid",i);var W=A=I=k=null,J=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":k=me;break;case"type":I=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":A=me;break;case"defaultValue":W=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:gt(i,s,g,me,h,null)}}bs(i,A,W,J,ce,I,k,!1);return;case"select":We("invalid",i),g=I=A=null;for(k in h)if(h.hasOwnProperty(k)&&(W=h[k],W!=null))switch(k){case"value":A=W;break;case"defaultValue":I=W;break;case"multiple":g=W;default:gt(i,s,k,W,h,null)}s=A,h=I,i.multiple=!!g,s!=null?Qi(i,!!g,s,!1):h!=null&&Qi(i,!!g,h,!0);return;case"textarea":We("invalid",i),A=k=g=null;for(I in h)if(h.hasOwnProperty(I)&&(W=h[I],W!=null))switch(I){case"value":g=W;break;case"defaultValue":k=W;break;case"children":A=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:gt(i,s,I,W,h,null)}Gm(i,g,k,A);return;case"option":for(J in h)if(h.hasOwnProperty(J)&&(g=h[J],g!=null))switch(J){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:gt(i,s,J,g,h,null)}return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(g=0;g<fo.length;g++)We(fo[g],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,ce,g,h,null)}return;default:if(Mh(s)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&yd(i,s,me,g,h,void 0));return}}for(W in h)h.hasOwnProperty(W)&&(g=h[W],g!=null&>(i,s,W,g,h,null))}function jk(i,s,h,g){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,A=null,I=null,W=null,J=null,ce=null,me=null;for(pe in h){var ve=h[pe];if(h.hasOwnProperty(pe)&&ve!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":J=ve;default:g.hasOwnProperty(pe)||gt(i,s,pe,null,g,ve)}}for(var ue in g){var pe=g[ue];if(ve=h[ue],g.hasOwnProperty(ue)&&(pe!=null||ve!=null))switch(ue){case"type":A=pe;break;case"name":k=pe;break;case"checked":ce=pe;break;case"defaultChecked":me=pe;break;case"value":I=pe;break;case"defaultValue":W=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,s));break;default:pe!==ve&>(i,s,ue,pe,g,ve)}}Da(i,I,W,J,ce,me,A,k);return;case"select":pe=I=W=ue=null;for(A in h)if(J=h[A],h.hasOwnProperty(A)&&J!=null)switch(A){case"value":break;case"multiple":pe=J;default:g.hasOwnProperty(A)||gt(i,s,A,null,g,J)}for(k in g)if(A=g[k],J=h[k],g.hasOwnProperty(k)&&(A!=null||J!=null))switch(k){case"value":ue=A;break;case"defaultValue":W=A;break;case"multiple":I=A;default:A!==J&>(i,s,k,A,g,J)}s=W,h=I,g=pe,ue!=null?Qi(i,!!h,ue,!1):!!g!=!!h&&(s!=null?Qi(i,!!h,s,!0):Qi(i,!!h,h?[]:"",!1));return;case"textarea":pe=ue=null;for(W in h)if(k=h[W],h.hasOwnProperty(W)&&k!=null&&!g.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:gt(i,s,W,null,g,k)}for(I in g)if(k=g[I],A=h[I],g.hasOwnProperty(I)&&(k!=null||A!=null))switch(I){case"value":ue=k;break;case"defaultValue":pe=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==A&>(i,s,I,k,g,A)}ja(i,ue,pe);return;case"option":for(var Te in h)if(ue=h[Te],h.hasOwnProperty(Te)&&ue!=null&&!g.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,s,Te,null,g,ue)}for(J in g)if(ue=g[J],pe=h[J],g.hasOwnProperty(J)&&ue!==pe&&(ue!=null||pe!=null))switch(J){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:gt(i,s,J,ue,g,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in h)ue=h[Be],h.hasOwnProperty(Be)&&ue!=null&&!g.hasOwnProperty(Be)&>(i,s,Be,null,g,ue);for(ce in g)if(ue=g[ce],pe=h[ce],g.hasOwnProperty(ce)&&ue!==pe&&(ue!=null||pe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:gt(i,s,ce,ue,g,pe)}return;default:if(Mh(s)){for(var mt in h)ue=h[mt],h.hasOwnProperty(mt)&&ue!==void 0&&!g.hasOwnProperty(mt)&&yd(i,s,mt,void 0,g,ue);for(me in g)ue=g[me],pe=h[me],!g.hasOwnProperty(me)||ue===pe||ue===void 0&&pe===void 0||yd(i,s,me,ue,g,pe);return}}for(var se in h)ue=h[se],h.hasOwnProperty(se)&&ue!=null&&!g.hasOwnProperty(se)&>(i,s,se,null,g,ue);for(ve in g)ue=g[ve],pe=h[ve],!g.hasOwnProperty(ve)||ue===pe||ue==null&&pe==null||gt(i,s,ve,ue,g,pe)}function Yv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lk(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var k=h[g],A=k.transferSize,I=k.initiatorType,W=k.duration;if(A&&W&&Yv(I)){for(I=0,W=k.responseEnd,g+=1;g<h.length;g++){var J=h[g],ce=J.startTime;if(ce>W)break;var me=J.transferSize,ve=J.initiatorType;me&&Yv(ve)&&(J=J.responseEnd,I+=me*(J<W?1:(W-ce)/(J-ce)))}if(--g,s+=8*(A+I)/(k.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var bd=null,Sd=null;function wc(i){return i.nodeType===9?i:i.ownerDocument}function Wv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function xd(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wd=null;function Ok(){var i=window.event;return i&&i.type==="popstate"?i===wd?!1:(wd=i,!0):(wd=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,Bk=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,Ik=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(i){return Zv.resolve(null).then(i).catch(zk)}:Kv;function zk(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Qv(i,s){var h=s,g=0;do{var k=h.nextSibling;if(i.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"||h==="/&"){if(g===0){i.removeChild(k),Qs(s);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")go(i.ownerDocument.documentElement);else if(h==="head"){h=i.ownerDocument.head,go(h);for(var A=h.firstChild;A;){var I=A.nextSibling,W=A.nodeName;A[Rr]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&A.rel.toLowerCase()==="stylesheet"||h.removeChild(A),A=I}}else h==="body"&&go(i.ownerDocument.body);h=k}while(h);Qs(s)}function Jv(i,s){var h=i;i=0;do{var g=h.nextSibling;if(h.nodeType===1?s?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(s?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(i===0)break;i--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||i++;h=g}while(h)}function Cd(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var h=s;switch(s=s.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Cd(h),Na(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}i.removeChild(h)}}function Hk(i,s,h,g){for(;i.nodeType===1;){var k=h;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Rr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(A=i.getAttribute("rel"),A==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(A!==k.rel||i.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||i.getAttribute("title")!==(k.title==null?null:k.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(A=i.getAttribute("src"),(A!==(k.src==null?null:k.src)||i.getAttribute("type")!==(k.type==null?null:k.type)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&A&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var A=k.name==null?null:""+k.name;if(k.type==="hidden"&&i.getAttribute("name")===A)return i}else return i;if(i=Un(i.nextSibling),i===null)break}return null}function Fk(i,s,h){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!h||(i=Un(i.nextSibling),i===null))return null;return i}function ey(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Un(i.nextSibling),i===null))return null;return i}function Ed(i){return i.data==="$?"||i.data==="$~"}function kd(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Pk(i,s){var h=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||h.readyState!=="loading")s();else{var g=function(){s(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Un(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Ad=null;function ty(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"||h==="/&"){if(s===0)return Un(i.nextSibling);s--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||s++}i=i.nextSibling}return null}function ny(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(s===0)return i;s--}else h!=="/$"&&h!=="/&"||s++}i=i.previousSibling}return null}function iy(i,s,h){switch(s=wc(h),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function go(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Na(i)}var $n=new Map,ry=new Set;function Cc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Hi=X.d;X.d={f:Uk,r:$k,D:Gk,C:qk,L:Vk,m:Yk,X:Xk,S:Wk,M:Kk};function Uk(){var i=Hi.f(),s=gc();return i||s}function $k(i){var s=Wi(i);s!==null&&s.tag===5&&s.type==="form"?S_(s):Hi.r(i)}var Xs=typeof document>"u"?null:document;function sy(i,s,h){var g=Xs;if(g&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),ry.has(k)||(ry.add(k),i={rel:i,crossOrigin:h,href:s},g.querySelector(k)===null&&(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Gk(i){Hi.D(i),sy("dns-prefetch",i,null)}function qk(i,s){Hi.C(i,s),sy("preconnect",i,s)}function Vk(i,s,h){Hi.L(i,s,h);var g=Xs;if(g&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=Ks(i);break;case"script":A=Zs(i)}$n.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),$n.set(A,i),g.querySelector(k)!==null||s==="style"&&g.querySelector(mo(A))||s==="script"&&g.querySelector(_o(A))||(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Yk(i,s){Hi.m(i,s);var h=Xs;if(h&&i){var g=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(g)+'"][href="'+on(i)+'"]',A=k;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Zs(i)}if(!$n.has(A)&&(i=d({rel:"modulepreload",href:i},s),$n.set(A,i),h.querySelector(k)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(_o(A)))return}g=h.createElement("link"),Zt(g,"link",i),Lt(g),h.head.appendChild(g)}}}function Wk(i,s,h){Hi.S(i,s,h);var g=Xs;if(g&&i){var k=Ki(g).hoistableStyles,A=Ks(i);s=s||"default";var I=k.get(A);if(!I){var W={loading:0,preload:null};if(I=g.querySelector(mo(A)))W.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=$n.get(A))&&Nd(i,h);var J=I=g.createElement("link");Lt(J),Zt(J,"link",i),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){W.loading|=1}),J.addEventListener("error",function(){W.loading|=2}),W.loading|=4,Ec(I,s,g)}I={type:"stylesheet",instance:I,count:1,state:W},k.set(A,I)}}}function Xk(i,s){Hi.X(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function Kk(i,s){Hi.M(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function ay(i,s,h,g){var k=(k=ae.current)?Cc(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=Ks(h.href),h=Ki(k).hoistableStyles,g=h.get(s),g||(g={type:"style",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Ks(h.href);var A=Ki(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(mo(i)))&&!A._p&&(I.instance=A,I.state.loading=5),$n.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},$n.set(i,h),A||Zk(k,i,h,I.state))),s&&g===null)throw Error(r(528,""));return I}if(s&&g!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Zs(h),h=Ki(k).hoistableScripts,g=h.get(s),g||(g={type:"script",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+on(i)+'"'}function mo(i){return'link[rel="stylesheet"]['+i+"]"}function oy(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function Zk(i,s,h,g){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?g.loading=1:(s=i.createElement("link"),g.preload=s,s.addEventListener("load",function(){return g.loading|=1}),s.addEventListener("error",function(){return g.loading|=2}),Zt(s,"link",h),Lt(s),i.head.appendChild(s))}function Zs(i){return'[src="'+on(i)+'"]'}function _o(i){return"script[async]"+i}function ly(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var g=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(g)return s.instance=g,Lt(g),g;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Lt(g),Zt(g,"style",k),Ec(g,h.precedence,i),s.instance=g;case"stylesheet":k=Ks(h.href);var A=i.querySelector(mo(k));if(A)return s.state.loading|=4,s.instance=A,Lt(A),A;g=oy(h),(k=$n.get(k))&&Nd(g,k),A=(i.ownerDocument||i).createElement("link"),Lt(A);var I=A;return I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),s.state.loading|=4,Ec(A,h.precedence,i),s.instance=A;case"script":return A=Zs(h.src),(k=i.querySelector(_o(A)))?(s.instance=k,Lt(k),k):(g=h,(k=$n.get(A))&&(g=d({},h),Td(g,k)),i=i.ownerDocument||i,k=i.createElement("script"),Lt(k),Zt(k,"link",g),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(g=s.instance,s.state.loading|=4,Ec(g,h.precedence,i));return s.instance}function Ec(i,s,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=g.length?g[g.length-1]:null,A=k,I=0;I<g.length;I++){var W=g[I];if(W.dataset.precedence===s)A=W;else if(A!==k)break}A?A.parentNode.insertBefore(i,A.nextSibling):(s=h.nodeType===9?h.head:h,s.insertBefore(i,s.firstChild))}function Nd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Td(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var kc=null;function cy(i,s,h){if(kc===null){var g=new Map,k=kc=new Map;k.set(h,g)}else k=kc,g=k.get(h),g||(g=new Map,k.set(h,g));if(g.has(i))return g;for(g.set(i,null),h=h.getElementsByTagName(i),k=0;k<h.length;k++){var A=h[k];if(!(A[Rr]||A[$t]||i==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(s)||"";I=i+I;var W=g.get(I);W?W.push(A):g.set(I,[A])}}return g}function uy(i,s,h){i=i.ownerDocument||i,i.head.insertBefore(h,s==="title"?i.querySelector("head > title"):null)}function Qk(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function hy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Jk(i,s,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=Ks(g.href),A=s.querySelector(mo(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ac.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Lt(A);return}A=s.ownerDocument||s,g=oy(g),(k=$n.get(k))&&Nd(g,k),A=A.createElement("link"),Lt(A);var I=A;I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Ac.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Rd=0;function eA(i,s){return i.stylesheets&&i.count===0&&Tc(i,i.stylesheets),0<i.count||0<i.imgCount?function(h){var g=setTimeout(function(){if(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend){var A=i.unsuspend;i.unsuspend=null,A()}},6e4+s);0<i.imgBytes&&Rd===0&&(Rd=62500*Lk());var k=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend)){var A=i.unsuspend;i.unsuspend=null,A()}},(i.imgBytes>Rd?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(k)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Nc=null;function Tc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Nc=new Map,s.forEach(tA,i),Nc=null,Ac.call(i))}function tA(i,s){if(!(s.state.loading&4)){var h=Nc.get(i);if(h)var g=h.get(null);else{h=new Map,Nc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<k.length;A++){var I=k[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(h.set(I.dataset.precedence,I),g=I)}g&&h.set(null,g)}k=s.instance,I=k.getAttribute("data-precedence"),A=h.get(I)||g,A===g&&h.set(null,k),h.set(I,k),this.count++,g=Ac.bind(this),k.addEventListener("load",g),k.addEventListener("error",g),A?A.parentNode.insertBefore(k,A.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(k,i.firstChild)),s.state.loading|=4}}var vo={$$typeof:y,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function nA(i,s,h,g,k,A,I,W,J){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=g,this.onUncaughtError=k,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function fy(i,s,h,g,k,A,I,W,J,ce,me,ve){return i=new nA(i,s,h,I,J,ce,me,ve,W),s=1,A===!0&&(s|=24),A=bn(3,null,null,s),i.current=A,A.stateNode=i,s=cf(),s.refCount++,i.pooledCache=s,s.refCount++,A.memoizedState={element:g,isDehydrated:h,cache:s},df(A),i}function dy(i){return i?(i=Ns,i):Ns}function py(i,s,h,g,k,A){k=dy(k),g.context===null?g.context=k:g.pendingContext=k,g=sr(s),g.payload={element:h},A=A===void 0?null:A,A!==null&&(g.callback=A),h=ar(i,g,s),h!==null&&(dn(h,i,s),Xa(h,i,s))}function gy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<s?h:s}}function Dd(i,s){gy(i,s),(i=i.alternate)&&gy(i,s)}function my(i){if(i.tag===13||i.tag===31){var s=Or(i,67108864);s!==null&&dn(s,i,67108864),Dd(i,67108864)}}function _y(i){if(i.tag===13||i.tag===31){var s=En();s=ka(s);var h=Or(i,s);h!==null&&dn(h,i,s),Dd(i,s)}}var Rc=!0;function iA(i,s,h,g){var k=G.T;G.T=null;var A=X.p;try{X.p=2,Md(i,s,h,g)}finally{X.p=A,G.T=k}}function rA(i,s,h,g){var k=G.T;G.T=null;var A=X.p;try{X.p=8,Md(i,s,h,g)}finally{X.p=A,G.T=k}}function Md(i,s,h,g){if(Rc){var k=jd(g);if(k===null)vd(i,s,g,Dc,h),yy(i,g);else if(aA(k,i,s,h,g))g.stopPropagation();else if(yy(i,g),s&4&&-1<sA.indexOf(i)){for(;k!==null;){var A=Wi(k);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=On(A.pendingLanes);if(I!==0){var W=A;for(W.pendingLanes|=2,W.entangledLanes|=2;I;){var J=1<<31-st(I);W.entanglements[1]|=J,I&=~J}oi(A),(ot&6)===0&&(dc=Fe()+500,ho(0))}}break;case 31:case 13:W=Or(A,2),W!==null&&dn(W,A,2),gc(),Dd(A,2)}if(A=jd(g),A===null&&vd(i,s,g,Dc,h),A===k)break;k=A}k!==null&&g.stopPropagation()}else vd(i,s,g,null,h)}}function jd(i){return i=Lh(i),Ld(i)}var Dc=null;function Ld(i){if(Dc=null,i=Yi(i),i!==null){var s=l(i);if(s===null)i=null;else{var h=s.tag;if(h===13){if(i=u(s),i!==null)return i;i=null}else if(h===31){if(i=o(s),i!==null)return i;i=null}else if(h===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dc=i,null}function vy(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case ie:return 2;case de:return 8;case Se:case Ae:return 32;case De:return 268435456;default:return 32}default:return 32}}var Od=!1,_r=null,vr=null,yr=null,yo=new Map,bo=new Map,br=[],sA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yy(i,s){switch(i){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":yo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(s.pointerId)}}function So(i,s,h,g,k,A){return i===null||i.nativeEvent!==A?(i={blockedOn:s,domEventName:h,eventSystemFlags:g,nativeEvent:A,targetContainers:[k]},s!==null&&(s=Wi(s),s!==null&&my(s)),i):(i.eventSystemFlags|=g,s=i.targetContainers,k!==null&&s.indexOf(k)===-1&&s.push(k),i)}function aA(i,s,h,g,k){switch(s){case"focusin":return _r=So(_r,i,s,h,g,k),!0;case"dragenter":return vr=So(vr,i,s,h,g,k),!0;case"mouseover":return yr=So(yr,i,s,h,g,k),!0;case"pointerover":var A=k.pointerId;return yo.set(A,So(yo.get(A)||null,i,s,h,g,k)),!0;case"gotpointercapture":return A=k.pointerId,bo.set(A,So(bo.get(A)||null,i,s,h,g,k)),!0}return!1}function by(i){var s=Yi(i.target);if(s!==null){var h=l(s);if(h!==null){if(s=h.tag,s===13){if(s=u(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===31){if(s=o(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var h=jd(i.nativeEvent);if(h===null){h=i.nativeEvent;var g=new h.constructor(h.type,h);jh=g,h.target.dispatchEvent(g),jh=null}else return s=Wi(h),s!==null&&my(s),i.blockedOn=h,!1;s.shift()}return!0}function Sy(i,s,h){Mc(i)&&h.delete(s)}function oA(){Od=!1,_r!==null&&Mc(_r)&&(_r=null),vr!==null&&Mc(vr)&&(vr=null),yr!==null&&Mc(yr)&&(yr=null),yo.forEach(Sy),bo.forEach(Sy)}function jc(i,s){i.blockedOn===s&&(i.blockedOn=null,Od||(Od=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,oA)))}var Lc=null;function xy(i){Lc!==i&&(Lc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lc===i&&(Lc=null);for(var s=0;s<i.length;s+=3){var h=i[s],g=i[s+1],k=i[s+2];if(typeof g!="function"){if(Ld(g||h)===null)continue;break}var A=Wi(h);A!==null&&(i.splice(s,3),s-=3,jf(A,{pending:!0,data:k,method:h.method,action:g},g,k))}}))}function Qs(i){function s(J){return jc(J,i)}_r!==null&&jc(_r,i),vr!==null&&jc(vr,i),yr!==null&&jc(yr,i),yo.forEach(s),bo.forEach(s);for(var h=0;h<br.length;h++){var g=br[h];g.blockedOn===i&&(g.blockedOn=null)}for(;0<br.length&&(h=br[0],h.blockedOn===null);)by(h),h.blockedOn===null&&br.shift();if(h=(i.ownerDocument||i).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var k=h[g],A=h[g+1],I=k[Qt]||null;if(typeof A=="function")I||xy(h);else if(I){var W=null;if(A&&A.hasAttribute("formAction")){if(k=A,I=A[Qt]||null)W=I.formAction;else if(Ld(k)!==null)continue}else W=I.action;typeof W=="function"?h[g+1]=W:(h.splice(g,3),g-=3),xy(h)}}}function wy(){function i(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return k=I})},focusReset:"manual",scroll:"manual"})}function s(){k!==null&&(k(),k=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,k=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),k!==null&&(k(),k=null)}}}function Bd(i){this._internalRoot=i}Oc.prototype.render=Bd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var h=s.current,g=En();py(h,g,i,s,null,null)},Oc.prototype.unmount=Bd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;py(i.current,2,null,i,null,null),gc(),s[Si]=null}};function Oc(i){this._internalRoot=i}Oc.prototype.unstable_scheduleHydration=function(i){if(i){var s=yl();i={blockedOn:null,target:i,priority:s};for(var h=0;h<br.length&&s!==0&&s<br[h].priority;h++);br.splice(h,0,i),h===0&&by(i)}};var Cy=t.version;if(Cy!=="19.2.7")throw Error(r(527,Cy,"19.2.7"));X.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var lA={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{Nt=Bc.inject(lA),Et=Bc}catch{}}return wo.createRoot=function(i,s){if(!a(i))throw Error(r(299));var h=!1,g="",k=D_,A=M_,I=j_;return s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(k=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(I=s.onRecoverableError)),s=fy(i,1,!1,null,null,h,g,null,k,A,I,wy),i[Si]=s.current,_d(i),new Bd(s)},wo.hydrateRoot=function(i,s,h){if(!a(i))throw Error(r(299));var g=!1,k="",A=D_,I=M_,W=j_,J=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onUncaughtError!==void 0&&(A=h.onUncaughtError),h.onCaughtError!==void 0&&(I=h.onCaughtError),h.onRecoverableError!==void 0&&(W=h.onRecoverableError),h.formState!==void 0&&(J=h.formState)),s=fy(i,1,!0,s,h??null,g,k,J,A,I,W,wy),s.context=dy(null),h=s.current,g=En(),g=ka(g),k=sr(g),k.callback=null,ar(h,k,g),h=g,s.current.lanes=h,qe(s,h),oi(s),i[Si]=s.current,_d(i),new Oc(s)},wo.version="19.2.7",wo}var Ly;function vA(){if(Ly)return Hd.exports;Ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hd.exports=_A(),Hd.exports}var yA=vA();/** - * @license lucide-react v1.24.0 - ISC +`+g.stack}}var bt=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,Pt=e.unstable_shouldYield,ht=e.unstable_requestPaint,Fe=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,De=e.unstable_IdlePriority,Ve=e.log,Ie=e.unstable_setDisableYieldValue,Nt=null,Ct=null;function qt(i){if(typeof Ve=="function"&&Ie(i),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Nt,i)}catch{}}var st=Math.clz32?Math.clz32:ps,Ln=Math.log,Ut=Math.LN2;function ps(i){return i>>>=0,i===0?32:31-(Ln(i)/Ut|0)|0}var gi=256,mi=262144,_i=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function vi(i,s,h){var g=i.pendingLanes;if(g===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var W=g&134217727;return W!==0?(g=W&~A,g!==0?k=On(g):(I&=W,I!==0?k=On(I):h||(h=W&~i,h!==0&&(k=On(h))))):(W=g&~A,W!==0?k=On(W):I!==0?k=On(I):h||(h=g&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ni(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function oe(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function we(){var i=_i;return _i<<=1,(_i&62914560)===0&&(_i=4194304),i}function Ne(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function qe(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function at(i,s,h,g,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var W=i.entanglements,J=i.expirationTimes,ce=i.hiddenUpdates;for(h=I&~h;0<h;){var me=31-st(h),ve=1<<me;W[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var pe=ue[me];pe!==null&&(pe.lane&=-536870913)}h&=~ve}g!==0&&yi(i,g,0),A!==0&&k===0&&i.tag!==0&&(i.suspendedLanes|=A&~(I&~s))}function yi(i,s,h){i.pendingLanes|=s,i.suspendedLanes&=~s;var g=31-st(s);i.entangledLanes|=s,i.entanglements[g]=i.entanglements[g]|1073741824|h&261930}function nn(i,s){var h=i.entangledLanes|=s;for(i=i.entanglements;h;){var g=31-st(h),k=1<<g;k&s|i[g]&s&&(i[g]|=s),h&=~k}}function gs(i,s){var h=s&-s;return h=(h&42)!==0?1:ka(h),(h&(i.suspendedLanes|s))!==0?0:h}function ka(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Aa(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yl(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:vy(i.type))}function bl(i,s){var h=X.p;try{return X.p=i,s()}finally{X.p=h}}var ii=Math.random().toString(36).slice(2),$t="__reactFiber$"+ii,Qt="__reactProps$"+ii,bi="__reactContainer$"+ii,ms="__reactEvents$"+ii,Sl="__reactListeners$"+ii,Nh="__reactHandles$"+ii,xl="__reactResources$"+ii,Rr="__reactMarker$"+ii;function Na(i){delete i[$t],delete i[Qt],delete i[ms],delete i[Sl],delete i[Nh]}function Yi(i){var s=i[$t];if(s)return s;for(var h=i.parentNode;h;){if(s=h[bi]||h[$t]){if(h=s.alternate,s.child!==null||h!==null&&h.child!==null)for(i=ny(i);i!==null;){if(h=i[$t])return h;i=ny(i)}return s}i=h,h=i.parentNode}return null}function Wi(i){if(i=i[$t]||i[bi]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Xi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ki(i){var s=i[xl];return s||(s=i[xl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[Rr]=!0}var wl=new Set,Cl={};function Si(i,s){Zi(i,s),Zi(i+"Capture",s)}function Zi(i,s){for(Cl[i]=s,i=0;i<s.length;i++)wl.add(s[i])}var Th=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),El={},Ta={};function Rh(i){return bt.call(Ta,i)?!0:bt.call(El,i)?!1:Th.test(i)?Ta[i]=!0:(El[i]=!0,!1)}function _s(i,s,h){if(Rh(s))if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var g=s.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+h)}}function vs(i,s,h){if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+h)}}function qn(i,s,h,g){if(g===null)i.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(s,h,""+g)}}function an(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function kl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Dh(i,s,h){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var k=g.get,A=g.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return k.call(this)},set:function(I){h=""+I,A.call(this,I)}}),Object.defineProperty(i,s,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ra(i){if(!i._valueTracker){var s=kl(i)?"checked":"value";i._valueTracker=Dh(i,s,""+i[s])}}function Dr(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var h=s.getValue(),g="";return i&&(g=kl(i)?i.checked?"true":"false":i.value),i=g,i!==h?(s.setValue(i),!0):!1}function ys(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Al=/[\n"\\]/g;function on(i){return i.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Da(i,s,h,g,k,A,I,W){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?Ma(i,I,an(s)):h!=null?Ma(i,I,an(h)):g!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+an(W):i.removeAttribute("name")}function bs(i,s,h,g,k,A,I,W){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Ra(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,W||s===i.value||(i.value=s),i.defaultValue=s}g=g??k,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=W?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ra(i)}function Ma(i,s,h){s==="number"&&ys(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function Qi(i,s,h,g){if(i=i.options,s){s={};for(var k=0;k<h.length;k++)s["$"+h[k]]=!0;for(h=0;h<i.length;h++)k=s.hasOwnProperty("$"+i[h].value),i[h].selected!==k&&(i[h].selected=k),k&&g&&(i[h].defaultSelected=!0)}else{for(h=""+an(h),s=null,k=0;k<i.length;k++){if(i[k].value===h){i[k].selected=!0,g&&(i[k].defaultSelected=!0);return}s!==null||i[k].disabled||(s=i[k])}s!==null&&(s.selected=!0)}}function ja(i,s,h){if(s!=null&&(s=""+an(s),s!==i.value&&(i.value=s),h==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=h!=null?""+an(h):""}function Gm(i,s,h,g){if(s==null){if(g!=null){if(h!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),s=h}h=an(s),i.defaultValue=h,g=i.textContent,g===h&&g!==""&&g!==null&&(i.value=g),Ra(i)}function Ss(i,s){if(s){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=s;return}}i.textContent=s}var tE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qm(i,s,h){var g=s.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":g?i.setProperty(s,h):typeof h!="number"||h===0||tE.has(s)?s==="float"?i.cssFloat=h:i[s]=(""+h).trim():i[s]=h+"px"}function Vm(i,s,h){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||s!=null&&s.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var k in s)g=s[k],s.hasOwnProperty(k)&&h[k]!==g&&qm(i,k,g)}else for(var A in s)s.hasOwnProperty(A)&&qm(i,A,s[A])}function Mh(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),iE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(i){return iE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function xi(){}var jh=null;function Lh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xs=null,ws=null;function Ym(i){var s=Wi(i);if(s&&(i=s.stateNode)){var h=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Da(i,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),s=h.name,h.type==="radio"&&s!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+on(""+s)+'"][type="radio"]'),s=0;s<h.length;s++){var g=h[s];if(g!==i&&g.form===i.form){var k=g[Qt]||null;if(!k)throw Error(r(90));Da(g,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(s=0;s<h.length;s++)g=h[s],g.form===i.form&&Dr(g)}break e;case"textarea":ja(i,h.value,h.defaultValue);break e;case"select":s=h.value,s!=null&&Qi(i,!!h.multiple,s,!1)}}}var Oh=!1;function Wm(i,s,h){if(Oh)return i(s,h);Oh=!0;try{var g=i(s);return g}finally{if(Oh=!1,(xs!==null||ws!==null)&&(gc(),xs&&(s=xs,i=ws,ws=xs=null,Ym(s),i)))for(s=0;s<i.length;s++)Ym(i[s])}}function La(i,s){var h=i.stateNode;if(h===null)return null;var g=h[Qt]||null;if(g===null)return null;h=g[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(r(231,s,typeof h));return h}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(wi)try{var Oa={};Object.defineProperty(Oa,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{Bh=!1}var Ji=null,Ih=null,Tl=null;function Xm(){if(Tl)return Tl;var i,s=Ih,h=s.length,g,k="value"in Ji?Ji.value:Ji.textContent,A=k.length;for(i=0;i<h&&s[i]===k[i];i++);var I=h-i;for(g=1;g<=I&&s[h-g]===k[A-g];g++);return Tl=k.slice(i,1<g?1-g:void 0)}function Rl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Dl(){return!0}function Km(){return!1}function ln(i){function s(h,g,k,A,I){this._reactName=h,this._targetInst=k,this.type=g,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(h=i[W],this[W]=h?h(A):A[W]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Dl:Km,this.isPropagationStopped=Km,this}return d(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Dl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Dl)},persist:function(){},isPersistent:Dl}),s}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=ln(Mr),Ba=d({},Mr,{view:0,detail:0}),rE=ln(Ba),zh,Hh,Ia,jl=d({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ia&&(Ia&&i.type==="mousemove"?(zh=i.screenX-Ia.screenX,Hh=i.screenY-Ia.screenY):Hh=zh=0,Ia=i),zh)},movementY:function(i){return"movementY"in i?i.movementY:Hh}}),Zm=ln(jl),sE=d({},jl,{dataTransfer:0}),aE=ln(sE),oE=d({},Ba,{relatedTarget:0}),Fh=ln(oE),lE=d({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),cE=ln(lE),uE=d({},Mr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),hE=ln(uE),fE=d({},Mr,{data:0}),Qm=ln(fE),dE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mE(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=gE[i])?!!s[i]:!1}function Ph(){return mE}var _E=d({},Ba,{key:function(i){if(i.key){var s=dE[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Rl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?pE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(i){return i.type==="keypress"?Rl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Rl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),vE=ln(_E),yE=d({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=ln(yE),bE=d({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),SE=ln(bE),xE=d({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),wE=ln(xE),CE=d({},jl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),EE=ln(CE),kE=d({},Mr,{newState:0,oldState:0}),AE=ln(kE),NE=[9,13,27,32],Uh=wi&&"CompositionEvent"in window,za=null;wi&&"documentMode"in document&&(za=document.documentMode);var TE=wi&&"TextEvent"in window&&!za,e0=wi&&(!Uh||za&&8<za&&11>=za),t0=" ",n0=!1;function i0(i,s){switch(i){case"keyup":return NE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Cs=!1;function RE(i,s){switch(i){case"compositionend":return r0(s);case"keypress":return s.which!==32?null:(n0=!0,t0);case"textInput":return i=s.data,i===t0&&n0?null:i;default:return null}}function DE(i,s){if(Cs)return i==="compositionend"||!Uh&&i0(i,s)?(i=Xm(),Tl=Ih=Ji=null,Cs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return e0&&s.locale!=="ko"?null:s.data;default:return null}}var ME={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!ME[i.type]:s==="textarea"}function a0(i,s,h,g){xs?ws?ws.push(g):ws=[g]:xs=g,s=xc(s,"onChange"),0<s.length&&(h=new Ml("onChange","change",null,h,g),i.push({event:h,listeners:s}))}var Ha=null,Fa=null;function jE(i){Uv(i,0)}function Ll(i){var s=Xi(i);if(Dr(s))return i}function o0(i,s){if(i==="change")return s}var l0=!1;if(wi){var $h;if(wi){var Gh="oninput"in document;if(!Gh){var c0=document.createElement("div");c0.setAttribute("oninput","return;"),Gh=typeof c0.oninput=="function"}$h=Gh}else $h=!1;l0=$h&&(!document.documentMode||9<document.documentMode)}function u0(){Ha&&(Ha.detachEvent("onpropertychange",h0),Fa=Ha=null)}function h0(i){if(i.propertyName==="value"&&Ll(Fa)){var s=[];a0(s,Fa,i,Lh(i)),Wm(jE,s)}}function LE(i,s,h){i==="focusin"?(u0(),Ha=s,Fa=h,Ha.attachEvent("onpropertychange",h0)):i==="focusout"&&u0()}function OE(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ll(Fa)}function BE(i,s){if(i==="click")return Ll(s)}function IE(i,s){if(i==="input"||i==="change")return Ll(s)}function zE(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var yn=typeof Object.is=="function"?Object.is:zE;function Pa(i,s){if(yn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var h=Object.keys(i),g=Object.keys(s);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var k=h[g];if(!bt.call(s,k)||!yn(i[k],s[k]))return!1}return!0}function f0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function d0(i,s){var h=f0(i);i=0;for(var g;h;){if(h.nodeType===3){if(g=i+h.textContent.length,i<=s&&g>=s)return{node:h,offset:s-i};i=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=f0(h)}}function p0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?p0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function g0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=ys(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=ys(i.document)}return s}function qh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var HE=wi&&"documentMode"in document&&11>=document.documentMode,Es=null,Vh=null,Ua=null,Yh=!1;function m0(i,s,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yh||Es==null||Es!==ys(g)||(g=Es,"selectionStart"in g&&qh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ua&&Pa(Ua,g)||(Ua=g,g=xc(Vh,"onSelect"),0<g.length&&(s=new Ml("onSelect","select",null,s,h),i.push({event:s,listeners:g}),s.target=Es)))}function jr(i,s){var h={};return h[i.toLowerCase()]=s.toLowerCase(),h["Webkit"+i]="webkit"+s,h["Moz"+i]="moz"+s,h}var ks={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Wh={},_0={};wi&&(_0=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Lr(i){if(Wh[i])return Wh[i];if(!ks[i])return i;var s=ks[i],h;for(h in s)if(s.hasOwnProperty(h)&&h in _0)return Wh[i]=s[h];return i}var v0=Lr("animationend"),y0=Lr("animationiteration"),b0=Lr("animationstart"),FE=Lr("transitionrun"),PE=Lr("transitionstart"),UE=Lr("transitioncancel"),S0=Lr("transitionend"),x0=new Map,Xh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xh.push("scrollEnd");function Vn(i,s){x0.set(i,s),Si(s,[i])}var Ol=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Bn=[],As=0,Kh=0;function Bl(){for(var i=As,s=Kh=As=0;s<i;){var h=Bn[s];Bn[s++]=null;var g=Bn[s];Bn[s++]=null;var k=Bn[s];Bn[s++]=null;var A=Bn[s];if(Bn[s++]=null,g!==null&&k!==null){var I=g.pending;I===null?k.next=k:(k.next=I.next,I.next=k),g.pending=k}A!==0&&w0(h,k,A)}}function Il(i,s,h,g){Bn[As++]=i,Bn[As++]=s,Bn[As++]=h,Bn[As++]=g,Kh|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Zh(i,s,h,g){return Il(i,s,h,g),zl(i)}function Or(i,s){return Il(i,null,null,s),zl(i)}function w0(i,s,h){i.lanes|=h;var g=i.alternate;g!==null&&(g.lanes|=h);for(var k=!1,A=i.return;A!==null;)A.childLanes|=h,g=A.alternate,g!==null&&(g.childLanes|=h),A.tag===22&&(i=A.stateNode,i===null||i._visibility&1||(k=!0)),i=A,A=A.return;return i.tag===3?(A=i.stateNode,k&&s!==null&&(k=31-st(h),i=A.hiddenUpdates,g=i[k],g===null?i[k]=[s]:g.push(s),s.lane=h|536870912),A):null}function zl(i){if(50<uo)throw uo=0,od=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ns={};function $E(i,s,h,g){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(i,s,h,g){return new $E(i,s,h,g)}function Qh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ci(i,s){var h=i.alternate;return h===null?(h=bn(i.tag,s,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=s,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&65011712,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,s=i.dependencies,h.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h.refCleanup=i.refCleanup,h}function C0(i,s){i.flags&=65011714;var h=i.alternate;return h===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=h.childLanes,i.lanes=h.lanes,i.child=h.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=h.memoizedProps,i.memoizedState=h.memoizedState,i.updateQueue=h.updateQueue,i.type=h.type,s=h.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Hl(i,s,h,g,k,A){var I=0;if(g=i,typeof i=="function")Qh(i)&&(I=1);else if(typeof i=="string")I=Wk(i,h,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case j:return i=bn(31,h,s,k),i.elementType=j,i.lanes=A,i;case C:return Br(h.children,k,A,s);case b:I=8,k|=24;break;case S:return i=bn(12,h,s,k|2),i.elementType=S,i.lanes=A,i;case R:return i=bn(13,h,s,k),i.elementType=R,i.lanes=A,i;case N:return i=bn(19,h,s,k),i.elementType=N,i.lanes=A,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case y:I=10;break e;case x:I=9;break e;case E:I=11;break e;case D:I=14;break e;case T:I=16,g=null;break e}I=29,h=Error(r(130,i===null?"null":typeof i,"")),g=null}return s=bn(I,h,s,k),s.elementType=i,s.type=g,s.lanes=A,s}function Br(i,s,h,g){return i=bn(7,i,g,s),i.lanes=h,i}function Jh(i,s,h){return i=bn(6,i,null,s),i.lanes=h,i}function E0(i){var s=bn(18,null,null,0);return s.stateNode=i,s}function ef(i,s,h){return s=bn(4,i.children!==null?i.children:[],i.key,s),s.lanes=h,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var k0=new WeakMap;function In(i,s){if(typeof i=="object"&&i!==null){var h=k0.get(i);return h!==void 0?h:(s={value:i,source:s,stack:rt(s)},k0.set(i,s),s)}return{value:i,source:s,stack:rt(s)}}var Ts=[],Rs=0,Fl=null,$a=0,zn=[],Hn=0,er=null,ri=1,si="";function Ei(i,s){Ts[Rs++]=$a,Ts[Rs++]=Fl,Fl=i,$a=s}function A0(i,s,h){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,er=i;var g=ri;i=si;var k=32-st(g)-1;g&=~(1<<k),h+=1;var A=32-st(s)+k;if(30<A){var I=k-k%5;A=(g&(1<<I)-1).toString(32),g>>=I,k-=I,ri=1<<32-st(s)+k|h<<k|g,si=A+i}else ri=1<<A|h<<k|g,si=i}function tf(i){i.return!==null&&(Ei(i,1),A0(i,1,0))}function nf(i){for(;i===Fl;)Fl=Ts[--Rs],Ts[Rs]=null,$a=Ts[--Rs],Ts[Rs]=null;for(;i===er;)er=zn[--Hn],zn[Hn]=null,si=zn[--Hn],zn[Hn]=null,ri=zn[--Hn],zn[Hn]=null}function N0(i,s){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,ri=s.id,si=s.overflow,er=i}var Wt=null,St=null,Qe=!1,tr=null,Fn=!1,rf=Error(r(519));function nr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(In(s,i)),rf}function T0(i){var s=i.stateNode,h=i.type,g=i.memoizedProps;switch(s[$t]=i,s[Qt]=g,h){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(h=0;h<fo.length;h++)We(fo[h],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),bs(s,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),Gm(s,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||s.textContent===""+h||g.suppressHydrationWarning===!0||Vv(s.textContent,h)?(g.popover!=null&&(We("beforetoggle",s),We("toggle",s)),g.onScroll!=null&&We("scroll",s),g.onScrollEnd!=null&&We("scrollend",s),g.onClick!=null&&(s.onclick=xi),s=!0):s=!1,s||nr(i,!0)}function R0(i){for(Wt=i.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Wt=Wt.return}}function Ds(i){if(i!==Wt)return!1;if(!Qe)return R0(i),Qe=!0,!1;var s=i.tag,h;if((h=s!==3&&s!==27)&&((h=s===5)&&(h=i.type,h=!(h!=="form"&&h!=="button")||xd(i.type,i.memoizedProps)),h=!h),h&&St&&nr(i),R0(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else s===27?(s=St,mr(i.type)?(i=Ad,Ad=null,St=i):St=s):St=Wt?Un(i.stateNode.nextSibling):null;return!0}function Ir(){St=Wt=null,Qe=!1}function sf(){var i=tr;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),tr=null),i}function Ga(i){tr===null?tr=[i]:tr.push(i)}var af=O(null),zr=null,ki=null;function ir(i,s,h){F(af,s._currentValue),s._currentValue=h}function Ai(i){i._currentValue=af.current,$(af)}function of(i,s,h){for(;i!==null;){var g=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),i===h)break;i=i.return}}function lf(i,s,h,g){var k=i.child;for(k!==null&&(k.return=i);k!==null;){var A=k.dependencies;if(A!==null){var I=k.child;A=A.firstContext;e:for(;A!==null;){var W=A;A=k;for(var J=0;J<s.length;J++)if(W.context===s[J]){A.lanes|=h,W=A.alternate,W!==null&&(W.lanes|=h),of(A.return,h,i),g||(I=null);break e}A=W.next}}else if(k.tag===18){if(I=k.return,I===null)throw Error(r(341));I.lanes|=h,A=I.alternate,A!==null&&(A.lanes|=h),of(I,h,i),I=null}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===i){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}}function Ms(i,s,h,g){i=null;for(var k=s,A=!1;k!==null;){if(!A){if((k.flags&524288)!==0)A=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var I=k.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var W=k.type;yn(k.pendingProps.value,I.value)||(i!==null?i.push(W):i=[W])}}else if(k===Z.current){if(I=k.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(i!==null?i.push(vo):i=[vo])}k=k.return}i!==null&&lf(s,i,h,g),s.flags|=262144}function Pl(i){for(i=i.firstContext;i!==null;){if(!yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Hr(i){zr=i,ki=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Xt(i){return D0(zr,i)}function Ul(i,s){return zr===null&&Hr(i),D0(i,s)}function D0(i,s){var h=s._currentValue;if(s={context:s,memoizedValue:h,next:null},ki===null){if(i===null)throw Error(r(308));ki=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ki=ki.next=s;return h}var GE=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(h,g){i.push(g)}};this.abort=function(){s.aborted=!0,i.forEach(function(h){return h()})}},qE=e.unstable_scheduleCallback,VE=e.unstable_NormalPriority,Ot={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cf(){return{controller:new GE,data:new Map,refCount:0}}function qa(i){i.refCount--,i.refCount===0&&qE(VE,function(){i.controller.abort()})}var Va=null,uf=0,js=0,Ls=null;function YE(i,s){if(Va===null){var h=Va=[];uf=0,js=dd(),Ls={status:"pending",value:void 0,then:function(g){h.push(g)}}}return uf++,s.then(M0,M0),s}function M0(){if(--uf===0&&Va!==null){Ls!==null&&(Ls.status="fulfilled");var i=Va;Va=null,js=0,Ls=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function WE(i,s){var h=[],g={status:"pending",value:null,reason:null,then:function(k){h.push(k)}};return i.then(function(){g.status="fulfilled",g.value=s;for(var k=0;k<h.length;k++)(0,h[k])(s)},function(k){for(g.status="rejected",g.reason=k,k=0;k<h.length;k++)(0,h[k])(void 0)}),g}var j0=q.S;q.S=function(i,s){mv=Fe(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&YE(i,s),j0!==null&&j0(i,s)};var Fr=O(null);function hf(){var i=Fr.current;return i!==null?i:_t.pooledCache}function $l(i,s){s===null?F(Fr,Fr.current):F(Fr,s.pool)}function L0(){var i=hf();return i===null?null:{parent:Ot._currentValue,pool:i}}var Os=Error(r(460)),ff=Error(r(474)),Gl=Error(r(542)),ql={then:function(){}};function O0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function B0(i,s,h){switch(h=i[h],h===void 0?i.push(s):h!==s&&(s.then(xi,xi),s=h),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i;default:if(typeof s.status=="string")s.then(xi,xi);else{if(i=_t,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var k=s;k.status="fulfilled",k.value=g}},function(g){if(s.status==="pending"){var k=s;k.status="rejected",k.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i}throw Ur=s,Os}}function Pr(i){try{var s=i._init;return s(i._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ur=h,Os):h}}var Ur=null;function I0(){if(Ur===null)throw Error(r(459));var i=Ur;return Ur=null,i}function z0(i){if(i===Os||i===Gl)throw Error(r(483))}var Bs=null,Ya=0;function Vl(i){var s=Ya;return Ya+=1,Bs===null&&(Bs=[]),B0(Bs,i,s)}function Wa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Yl(i,s){throw s.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function H0(i){function s(se,te){if(i){var le=se.deletions;le===null?(se.deletions=[te],se.flags|=16):le.push(te)}}function h(se,te){if(!i)return null;for(;te!==null;)s(se,te),te=te.sibling;return null}function g(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function k(se,te){return se=Ci(se,te),se.index=0,se.sibling=null,se}function A(se,te,le){return se.index=le,i?(le=se.alternate,le!==null?(le=le.index,le<te?(se.flags|=67108866,te):le):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function I(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function W(se,te,le,_e){return te===null||te.tag!==6?(te=Jh(le,se.mode,_e),te.return=se,te):(te=k(te,le),te.return=se,te)}function J(se,te,le,_e){var Le=le.type;return Le===C?me(se,te,le.props.children,_e,le.key):te!==null&&(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type)?(te=k(te,le.props),Wa(te,le),te.return=se,te):(te=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(te,le),te.return=se,te)}function ce(se,te,le,_e){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=ef(le,se.mode,_e),te.return=se,te):(te=k(te,le.children||[]),te.return=se,te)}function me(se,te,le,_e,Le){return te===null||te.tag!==7?(te=Br(le,se.mode,_e,Le),te.return=se,te):(te=k(te,le),te.return=se,te)}function ve(se,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Jh(""+te,se.mode,le),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return le=Hl(te.type,te.key,te.props,null,se.mode,le),Wa(le,te),le.return=se,le;case w:return te=ef(te,se.mode,le),te.return=se,te;case T:return te=Pr(te),ve(se,te,le)}if(Y(te)||G(te))return te=Br(te,se.mode,le,null),te.return=se,te;if(typeof te.then=="function")return ve(se,Vl(te),le);if(te.$$typeof===y)return ve(se,Ul(se,te),le);Yl(se,te)}return null}function ue(se,te,le,_e){var Le=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Le!==null?null:W(se,te,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return le.key===Le?J(se,te,le,_e):null;case w:return le.key===Le?ce(se,te,le,_e):null;case T:return le=Pr(le),ue(se,te,le,_e)}if(Y(le)||G(le))return Le!==null?null:me(se,te,le,_e,null);if(typeof le.then=="function")return ue(se,te,Vl(le),_e);if(le.$$typeof===y)return ue(se,te,Ul(se,le),_e);Yl(se,le)}return null}function pe(se,te,le,_e,Le){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return se=se.get(le)||null,W(te,se,""+_e,Le);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return se=se.get(_e.key===null?le:_e.key)||null,J(te,se,_e,Le);case w:return se=se.get(_e.key===null?le:_e.key)||null,ce(te,se,_e,Le);case T:return _e=Pr(_e),pe(se,te,le,_e,Le)}if(Y(_e)||G(_e))return se=se.get(le)||null,me(te,se,_e,Le,null);if(typeof _e.then=="function")return pe(se,te,le,Vl(_e),Le);if(_e.$$typeof===y)return pe(se,te,le,Ul(te,_e),Le);Yl(te,_e)}return null}function Te(se,te,le,_e){for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null;Re!==null&&Ue<le.length;Ue++){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var it=ue(se,Re,le[Ue],_e);if(it===null){Re===null&&(Re=Ze);break}i&&Re&&it.alternate===null&&s(se,Re),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it,Re=Ze}if(Ue===le.length)return h(se,Re),Qe&&Ei(se,Ue),Le;if(Re===null){for(;Ue<le.length;Ue++)Re=ve(se,le[Ue],_e),Re!==null&&(te=A(Re,te,Ue),nt===null?Le=Re:nt.sibling=Re,nt=Re);return Qe&&Ei(se,Ue),Le}for(Re=g(Re);Ue<le.length;Ue++)Ze=pe(Re,se,Ue,le[Ue],_e),Ze!==null&&(i&&Ze.alternate!==null&&Re.delete(Ze.key===null?Ue:Ze.key),te=A(Ze,te,Ue),nt===null?Le=Ze:nt.sibling=Ze,nt=Ze);return i&&Re.forEach(function(Sr){return s(se,Sr)}),Qe&&Ei(se,Ue),Le}function Be(se,te,le,_e){if(le==null)throw Error(r(151));for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null,it=le.next();Re!==null&&!it.done;Ue++,it=le.next()){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var Sr=ue(se,Re,it.value,_e);if(Sr===null){Re===null&&(Re=Ze);break}i&&Re&&Sr.alternate===null&&s(se,Re),te=A(Sr,te,Ue),nt===null?Le=Sr:nt.sibling=Sr,nt=Sr,Re=Ze}if(it.done)return h(se,Re),Qe&&Ei(se,Ue),Le;if(Re===null){for(;!it.done;Ue++,it=le.next())it=ve(se,it.value,_e),it!==null&&(te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return Qe&&Ei(se,Ue),Le}for(Re=g(Re);!it.done;Ue++,it=le.next())it=pe(Re,se,Ue,it.value,_e),it!==null&&(i&&it.alternate!==null&&Re.delete(it.key===null?Ue:it.key),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return i&&Re.forEach(function(sA){return s(se,sA)}),Qe&&Ei(se,Ue),Le}function mt(se,te,le,_e){if(typeof le=="object"&&le!==null&&le.type===C&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case v:e:{for(var Le=le.key;te!==null;){if(te.key===Le){if(Le=le.type,Le===C){if(te.tag===7){h(se,te.sibling),_e=k(te,le.props.children),_e.return=se,se=_e;break e}}else if(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type){h(se,te.sibling),_e=k(te,le.props),Wa(_e,le),_e.return=se,se=_e;break e}h(se,te);break}else s(se,te);te=te.sibling}le.type===C?(_e=Br(le.props.children,se.mode,_e,le.key),_e.return=se,se=_e):(_e=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(_e,le),_e.return=se,se=_e)}return I(se);case w:e:{for(Le=le.key;te!==null;){if(te.key===Le)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){h(se,te.sibling),_e=k(te,le.children||[]),_e.return=se,se=_e;break e}else{h(se,te);break}else s(se,te);te=te.sibling}_e=ef(le,se.mode,_e),_e.return=se,se=_e}return I(se);case T:return le=Pr(le),mt(se,te,le,_e)}if(Y(le))return Te(se,te,le,_e);if(G(le)){if(Le=G(le),typeof Le!="function")throw Error(r(150));return le=Le.call(le),Be(se,te,le,_e)}if(typeof le.then=="function")return mt(se,te,Vl(le),_e);if(le.$$typeof===y)return mt(se,te,Ul(se,le),_e);Yl(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(h(se,te.sibling),_e=k(te,le),_e.return=se,se=_e):(h(se,te),_e=Jh(le,se.mode,_e),_e.return=se,se=_e),I(se)):h(se,te)}return function(se,te,le,_e){try{Ya=0;var Le=mt(se,te,le,_e);return Bs=null,Le}catch(Re){if(Re===Os||Re===Gl)throw Re;var nt=bn(29,Re,null,se.mode);return nt.lanes=_e,nt.return=se,nt}finally{}}}var $r=H0(!0),F0=H0(!1),rr=!1;function df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function sr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ar(i,s,h){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(ot&2)!==0){var k=g.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),g.pending=s,s=zl(i),w0(i,null,h),s}return Il(i,g,s,h),zl(i)}function Xa(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}function gf(i,s){var h=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:g.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:g.shared,callbacks:g.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var mf=!1;function Ka(){if(mf){var i=Ls;if(i!==null)throw i}}function Za(i,s,h,g){mf=!1;var k=i.updateQueue;rr=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,W=k.shared.pending;if(W!==null){k.shared.pending=null;var J=W,ce=J.next;J.next=null,I===null?A=ce:I.next=ce,I=J;var me=i.alternate;me!==null&&(me=me.updateQueue,W=me.lastBaseUpdate,W!==I&&(W===null?me.firstBaseUpdate=ce:W.next=ce,me.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,me=ce=J=null,W=A;do{var ue=W.lane&-536870913,pe=ue!==W.lane;if(pe?(Ke&ue)===ue:(g&ue)===ue){ue!==0&&ue===js&&(mf=!0),me!==null&&(me=me.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Te=i,Be=W;ue=s;var mt=h;switch(Be.tag){case 1:if(Te=Be.payload,typeof Te=="function"){ve=Te.call(mt,ve,ue);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Be.payload,ue=typeof Te=="function"?Te.call(mt,ve,ue):Te,ue==null)break e;ve=d({},ve,ue);break e;case 2:rr=!0}}ue=W.callback,ue!==null&&(i.flags|=64,pe&&(i.flags|=8192),pe=k.callbacks,pe===null?k.callbacks=[ue]:pe.push(ue))}else pe={lane:ue,tag:W.tag,payload:W.payload,callback:W.callback,next:null},me===null?(ce=me=pe,J=ve):me=me.next=pe,I|=ue;if(W=W.next,W===null){if(W=k.shared.pending,W===null)break;pe=W,W=pe.next,pe.next=null,k.lastBaseUpdate=pe,k.shared.pending=null}}while(!0);me===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=ce,k.lastBaseUpdate=me,A===null&&(k.shared.lanes=0),hr|=I,i.lanes=I,i.memoizedState=ve}}function P0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function U0(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;i<h.length;i++)P0(h[i],s)}var Is=O(null),Wl=O(0);function $0(i,s){i=Bi,F(Wl,i),F(Is,s),Bi=i|s.baseLanes}function _f(){F(Wl,Bi),F(Is,Is.current)}function vf(){Bi=Wl.current,$(Is),$(Wl)}var Sn=O(null),Pn=null;function or(i){var s=i.alternate;F(Mt,Mt.current&1),F(Sn,i),Pn===null&&(s===null||Is.current!==null||s.memoizedState!==null)&&(Pn=i)}function yf(i){F(Mt,Mt.current),F(Sn,i),Pn===null&&(Pn=i)}function G0(i){i.tag===22?(F(Mt,Mt.current),F(Sn,i),Pn===null&&(Pn=i)):lr()}function lr(){F(Mt,Mt.current),F(Sn,Sn.current)}function xn(i){$(Sn),Pn===i&&(Pn=null),$(Mt)}var Mt=O(0);function Xl(i){for(var s=i;s!==null;){if(s.tag===13){var h=s.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ed(h)||kd(h)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ni=0,Pe=null,pt=null,Bt=null,Kl=!1,zs=!1,Gr=!1,Zl=0,Qa=0,Hs=null,XE=0;function Tt(){throw Error(r(321))}function bf(i,s){if(s===null)return!1;for(var h=0;h<s.length&&h<i.length;h++)if(!yn(i[h],s[h]))return!1;return!0}function Sf(i,s,h,g,k,A){return Ni=A,Pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,q.H=i===null||i.memoizedState===null?A_:Bf,Gr=!1,A=h(g,k),Gr=!1,zs&&(A=V0(s,h,g,k)),q0(i),A}function q0(i){q.H=to;var s=pt!==null&&pt.next!==null;if(Ni=0,Bt=pt=Pe=null,Kl=!1,Qa=0,Hs=null,s)throw Error(r(300));i===null||It||(i=i.dependencies,i!==null&&Pl(i)&&(It=!0))}function V0(i,s,h,g){Pe=i;var k=0;do{if(zs&&(Hs=null),Qa=0,zs=!1,25<=k)throw Error(r(301));if(k+=1,Bt=pt=null,i.updateQueue!=null){var A=i.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}q.H=N_,A=s(h,g)}while(zs);return A}function KE(){var i=q.H,s=i.useState()[0];return s=typeof s.then=="function"?Ja(s):s,i=i.useState()[0],(pt!==null?pt.memoizedState:null)!==i&&(Pe.flags|=1024),s}function xf(){var i=Zl!==0;return Zl=0,i}function wf(i,s,h){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~h}function Cf(i){if(Kl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Kl=!1}Ni=0,Bt=pt=Pe=null,zs=!1,Qa=Zl=0,Hs=null}function rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i,Bt}function jt(){if(pt===null){var i=Pe.alternate;i=i!==null?i.memoizedState:null}else i=pt.next;var s=Bt===null?Pe.memoizedState:Bt.next;if(s!==null)Bt=s,pt=i;else{if(i===null)throw Pe.alternate===null?Error(r(467)):Error(r(310));pt=i,i={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i}return Bt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var s=Qa;return Qa+=1,Hs===null&&(Hs=[]),i=B0(Hs,i,s),s=Pe,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,q.H=s===null||s.memoizedState===null?A_:Bf),i}function Jl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===y)return Xt(i)}throw Error(r(438,String(i)))}function Ef(i){var s=null,h=Pe.updateQueue;if(h!==null&&(s=h.memoCache),s==null){var g=Pe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(s={data:g.data.map(function(k){return k.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),h===null&&(h=Ql(),Pe.updateQueue=h),h.memoCache=s,h=s.data[s.index],h===void 0)for(h=s.data[s.index]=Array(i),g=0;g<i;g++)h[g]=B;return s.index++,h}function Ti(i,s){return typeof s=="function"?s(i):s}function ec(i){var s=jt();return kf(s,pt,i)}function kf(i,s,h){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var k=i.baseQueue,A=g.pending;if(A!==null){if(k!==null){var I=k.next;k.next=A.next,A.next=I}s.baseQueue=k=A,g.pending=null}if(A=i.baseState,k===null)i.memoizedState=A;else{s=k.next;var W=I=null,J=null,ce=s,me=!1;do{var ve=ce.lane&-536870913;if(ve!==ce.lane?(Ke&ve)===ve:(Ni&ve)===ve){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ve===js&&(me=!0);else if((Ni&ue)===ue){ce=ce.next,ue===js&&(me=!0);continue}else ve={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ve,I=A):J=J.next=ve,Pe.lanes|=ue,hr|=ue;ve=ce.action,Gr&&h(A,ve),A=ce.hasEagerState?ce.eagerState:h(A,ve)}else ue={lane:ve,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ue,I=A):J=J.next=ue,Pe.lanes|=ve,hr|=ve;ce=ce.next}while(ce!==null&&ce!==s);if(J===null?I=A:J.next=W,!yn(A,i.memoizedState)&&(It=!0,me&&(h=Ls,h!==null)))throw h;i.memoizedState=A,i.baseState=I,i.baseQueue=J,g.lastRenderedState=A}return k===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Af(i){var s=jt(),h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=i;var g=h.dispatch,k=h.pending,A=s.memoizedState;if(k!==null){h.pending=null;var I=k=k.next;do A=i(A,I.action),I=I.next;while(I!==k);yn(A,s.memoizedState)||(It=!0),s.memoizedState=A,s.baseQueue===null&&(s.baseState=A),h.lastRenderedState=A}return[A,g]}function Y0(i,s,h){var g=Pe,k=jt(),A=Qe;if(A){if(h===void 0)throw Error(r(407));h=h()}else h=s();var I=!yn((pt||k).memoizedState,h);if(I&&(k.memoizedState=h,It=!0),k=k.queue,Rf(K0.bind(null,g,k,i),[i]),k.getSnapshot!==s||I||Bt!==null&&Bt.memoizedState.tag&1){if(g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,k,h,s),null),_t===null)throw Error(r(349));A||(Ni&127)!==0||W0(g,s,h)}return h}function W0(i,s,h){i.flags|=16384,i={getSnapshot:s,value:h},s=Pe.updateQueue,s===null?(s=Ql(),Pe.updateQueue=s,s.stores=[i]):(h=s.stores,h===null?s.stores=[i]:h.push(i))}function X0(i,s,h,g){s.value=h,s.getSnapshot=g,Z0(s)&&Q0(i)}function K0(i,s,h){return h(function(){Z0(s)&&Q0(i)})}function Z0(i){var s=i.getSnapshot;i=i.value;try{var h=s();return!yn(i,h)}catch{return!0}}function Q0(i){var s=Or(i,2);s!==null&&dn(s,i,2)}function Nf(i){var s=rn();if(typeof i=="function"){var h=i;if(i=h(),Gr){qt(!0);try{h()}finally{qt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:i},s}function J0(i,s,h,g){return i.baseState=h,kf(i,pt,typeof g=="function"?g:Ti)}function ZE(i,s,h,g,k){if(ic(i))throw Error(r(485));if(i=s.action,i!==null){var A={payload:k,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};q.T!==null?h(!0):A.isTransition=!1,g(A),h=s.pending,h===null?(A.next=s.pending=A,e_(s,A)):(A.next=h.next,s.pending=h.next=A)}}function e_(i,s){var h=s.action,g=s.payload,k=i.state;if(s.isTransition){var A=q.T,I={};q.T=I;try{var W=h(k,g),J=q.S;J!==null&&J(I,W),t_(i,s,W)}catch(ce){Tf(i,s,ce)}finally{A!==null&&I.types!==null&&(A.types=I.types),q.T=A}}else try{A=h(k,g),t_(i,s,A)}catch(ce){Tf(i,s,ce)}}function t_(i,s,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){n_(i,s,g)},function(g){return Tf(i,s,g)}):n_(i,s,h)}function n_(i,s,h){s.status="fulfilled",s.value=h,i_(s),i.state=h,s=i.pending,s!==null&&(h=s.next,h===s?i.pending=null:(h=h.next,s.next=h,e_(i,h)))}function Tf(i,s,h){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do s.status="rejected",s.reason=h,i_(s),s=s.next;while(s!==g)}i.action=null}function i_(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function r_(i,s){return s}function s_(i,s){if(Qe){var h=_t.formState;if(h!==null){e:{var g=Pe;if(Qe){if(St){t:{for(var k=St,A=Fn;k.nodeType!==8;){if(!A){k=null;break t}if(k=Un(k.nextSibling),k===null){k=null;break t}}A=k.data,k=A==="F!"||A==="F"?k:null}if(k){St=Un(k.nextSibling),g=k.data==="F!";break e}}nr(g)}g=!1}g&&(s=h[0])}}return h=rn(),h.memoizedState=h.baseState=s,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r_,lastRenderedState:s},h.queue=g,h=C_.bind(null,Pe,g),g.dispatch=h,g=Nf(!1),A=Of.bind(null,Pe,!1,g.queue),g=rn(),k={state:s,dispatch:null,action:i,pending:null},g.queue=k,h=ZE.bind(null,Pe,k,A,h),k.dispatch=h,g.memoizedState=i,[s,h,!1]}function a_(i){var s=jt();return o_(s,pt,i)}function o_(i,s,h){if(s=kf(i,s,r_)[0],i=ec(Ti)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var g=Ja(s)}catch(I){throw I===Os?Gl:I}else g=s;s=jt();var k=s.queue,A=k.dispatch;return h!==s.memoizedState&&(Pe.flags|=2048,Fs(9,{destroy:void 0},QE.bind(null,k,h),null)),[g,A,i]}function QE(i,s){i.action=s}function l_(i){var s=jt(),h=pt;if(h!==null)return o_(s,h,i);jt(),s=s.memoizedState,h=jt();var g=h.queue.dispatch;return h.memoizedState=i,[s,g,!1]}function Fs(i,s,h,g){return i={tag:i,create:h,deps:g,inst:s,next:null},s=Pe.updateQueue,s===null&&(s=Ql(),Pe.updateQueue=s),h=s.lastEffect,h===null?s.lastEffect=i.next=i:(g=h.next,h.next=i,i.next=g,s.lastEffect=i),i}function c_(){return jt().memoizedState}function tc(i,s,h,g){var k=rn();Pe.flags|=i,k.memoizedState=Fs(1|s,{destroy:void 0},h,g===void 0?null:g)}function nc(i,s,h,g){var k=jt();g=g===void 0?null:g;var A=k.memoizedState.inst;pt!==null&&g!==null&&bf(g,pt.memoizedState.deps)?k.memoizedState=Fs(s,A,h,g):(Pe.flags|=i,k.memoizedState=Fs(1|s,A,h,g))}function u_(i,s){tc(8390656,8,i,s)}function Rf(i,s){nc(2048,8,i,s)}function JE(i){Pe.flags|=4;var s=Pe.updateQueue;if(s===null)s=Ql(),Pe.updateQueue=s,s.events=[i];else{var h=s.events;h===null?s.events=[i]:h.push(i)}}function h_(i){var s=jt().memoizedState;return JE({ref:s,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function f_(i,s){return nc(4,2,i,s)}function d_(i,s){return nc(4,4,i,s)}function p_(i,s){if(typeof s=="function"){i=i();var h=s(i);return function(){typeof h=="function"?h():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function g_(i,s,h){h=h!=null?h.concat([i]):null,nc(4,4,p_.bind(null,s,i),h)}function Df(){}function m_(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;return s!==null&&bf(s,g[1])?g[0]:(h.memoizedState=[i,s],i)}function __(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;if(s!==null&&bf(s,g[1]))return g[0];if(g=i(),Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g}function Mf(i,s,h){return h===void 0||(Ni&1073741824)!==0&&(Ke&261930)===0?i.memoizedState=s:(i.memoizedState=h,i=vv(),Pe.lanes|=i,hr|=i,h)}function v_(i,s,h,g){return yn(h,s)?h:Is.current!==null?(i=Mf(i,h,g),yn(i,s)||(It=!0),i):(Ni&42)===0||(Ni&1073741824)!==0&&(Ke&261930)===0?(It=!0,i.memoizedState=h):(i=vv(),Pe.lanes|=i,hr|=i,s)}function y_(i,s,h,g,k){var A=X.p;X.p=A!==0&&8>A?A:8;var I=q.T,W={};q.T=W,Of(i,!1,s,h);try{var J=k(),ce=q.S;if(ce!==null&&ce(W,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=WE(J,g);eo(i,s,me,En(i))}else eo(i,s,g,En(i))}catch(ve){eo(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&W.types!==null&&(I.types=W.types),q.T=I}}function ek(){}function jf(i,s,h,g){if(i.tag!==5)throw Error(r(476));var k=b_(i).queue;y_(i,k,s,K,h===null?ek:function(){return S_(i),h(g)})}function b_(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function S_(i){var s=b_(i);s.next===null&&(s=i.alternate.memoizedState),eo(i,s.next.queue,{},En())}function Lf(){return Xt(vo)}function x_(){return jt().memoizedState}function w_(){return jt().memoizedState}function tk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=sr(h);var g=ar(s,i,h);g!==null&&(dn(g,s,h),Xa(g,s,h)),s={cache:cf()},i.payload=s;return}s=s.return}}function nk(i,s,h){var g=En();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ic(i)?E_(s,h):(h=Zh(i,s,h,g),h!==null&&(dn(h,i,g),k_(h,s,g)))}function C_(i,s,h){var g=En();eo(i,s,h,g)}function eo(i,s,h,g){var k={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ic(i))E_(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,W=A(I,h);if(k.hasEagerState=!0,k.eagerState=W,yn(W,I))return Il(i,s,k,0),_t===null&&Bl(),!1}catch{}finally{}if(h=Zh(i,s,k,g),h!==null)return dn(h,i,g),k_(h,s,g),!0}return!1}function Of(i,s,h,g){if(g={lane:2,revertLane:dd(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ic(i)){if(s)throw Error(r(479))}else s=Zh(i,h,g,2),s!==null&&dn(s,i,2)}function ic(i){var s=i.alternate;return i===Pe||s!==null&&s===Pe}function E_(i,s){zs=Kl=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function k_(i,s,h){if((h&4194048)!==0){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}var to={readContext:Xt,use:Jl,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};to.useEffectEvent=Tt;var A_={readContext:Xt,use:Jl,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Xt,useEffect:u_,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,tc(4194308,4,p_.bind(null,s,i),h)},useLayoutEffect:function(i,s){return tc(4194308,4,i,s)},useInsertionEffect:function(i,s){tc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var g=i();if(Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g},useReducer:function(i,s,h){var g=rn();if(h!==void 0){var k=h(s);if(Gr){qt(!0);try{h(s)}finally{qt(!1)}}}else k=s;return g.memoizedState=g.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},g.queue=i,i=i.dispatch=nk.bind(null,Pe,i),[g.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Nf(i);var s=i.queue,h=C_.bind(null,Pe,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:Df,useDeferredValue:function(i,s){var h=rn();return Mf(h,i,s)},useTransition:function(){var i=Nf(!1);return i=y_.bind(null,Pe,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var g=Pe,k=rn();if(Qe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),_t===null)throw Error(r(349));(Ke&127)!==0||W0(g,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,u_(K0.bind(null,g,A,i),[i]),g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,A,h,s),null),h},useId:function(){var i=rn(),s=_t.identifierPrefix;if(Qe){var h=si,g=ri;h=(g&~(1<<32-st(g)-1)).toString(32)+h,s="_"+s+"R_"+h,h=Zl++,0<h&&(s+="H"+h.toString(32)),s+="_"}else h=XE++,s="_"+s+"r_"+h.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Lf,useFormState:s_,useActionState:s_,useOptimistic:function(i){var s=rn();s.memoizedState=s.baseState=i;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=h,s=Of.bind(null,Pe,!0,h),h.dispatch=s,[i,s]},useMemoCache:Ef,useCacheRefresh:function(){return rn().memoizedState=tk.bind(null,Pe)},useEffectEvent:function(i){var s=rn(),h={impl:i};return s.memoizedState=h,function(){if((ot&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Bf={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:ec,useRef:c_,useState:function(){return ec(Ti)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=ec(Ti)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:a_,useActionState:a_,useOptimistic:function(i,s){var h=jt();return J0(h,pt,i,s)},useMemoCache:Ef,useCacheRefresh:w_};Bf.useEffectEvent=h_;var N_={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:Af,useRef:c_,useState:function(){return Af(Ti)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return pt===null?Mf(h,i,s):v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=Af(Ti)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:l_,useActionState:l_,useOptimistic:function(i,s){var h=jt();return pt!==null?J0(h,pt,i,s):(h.baseState=i,[i,h.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:w_};N_.useEffectEvent=h_;function If(i,s,h,g){s=i.memoizedState,h=h(g,s),h=h==null?s:d({},s,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var zf={enqueueSetState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueReplaceState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.tag=1,k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var h=En(),g=sr(h);g.tag=2,s!=null&&(g.callback=s),s=ar(i,g,h),s!==null&&(dn(s,i,h),Xa(s,i,h))}};function T_(i,s,h,g,k,A,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,A,I):s.prototype&&s.prototype.isPureReactComponent?!Pa(h,g)||!Pa(k,A):!0}function R_(i,s,h,g){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(h,g),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(h,g),s.state!==i&&zf.enqueueReplaceState(s,s.state,null)}function qr(i,s){var h=s;if("ref"in s){h={};for(var g in s)g!=="ref"&&(h[g]=s[g])}if(i=i.defaultProps){h===s&&(h=d({},h));for(var k in i)h[k]===void 0&&(h[k]=i[k])}return h}function D_(i){Ol(i)}function M_(i){console.error(i)}function j_(i){Ol(i)}function rc(i,s){try{var h=i.onUncaughtError;h(s.value,{componentStack:s.stack})}catch(g){setTimeout(function(){throw g})}}function L_(i,s,h){try{var g=i.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Hf(i,s,h){return h=sr(h),h.tag=3,h.payload={element:null},h.callback=function(){rc(i,s)},h}function O_(i){return i=sr(i),i.tag=3,i}function B_(i,s,h,g){var k=h.type.getDerivedStateFromError;if(typeof k=="function"){var A=g.value;i.payload=function(){return k(A)},i.callback=function(){L_(s,h,g)}}var I=h.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){L_(s,h,g),typeof k!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var W=g.stack;this.componentDidCatch(g.value,{componentStack:W!==null?W:""})})}function ik(i,s,h,g,k){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(s=h.alternate,s!==null&&Ms(s,h,k,!0),h=Sn.current,h!==null){switch(h.tag){case 31:case 13:return Pn===null?mc():h.alternate===null&&Rt===0&&(Rt=3),h.flags&=-257,h.flags|=65536,h.lanes=k,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?h.updateQueue=new Set([g]):s.add(g),ud(i,g,k)),!1;case 22:return h.flags|=65536,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=s):(h=s.retryQueue,h===null?s.retryQueue=new Set([g]):h.add(g)),ud(i,g,k)),!1}throw Error(r(435,h.tag))}return ud(i,g,k),mc(),!1}if(Qe)return s=Sn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=k,g!==rf&&(i=Error(r(422),{cause:g}),Ga(In(i,h)))):(g!==rf&&(s=Error(r(423),{cause:g}),Ga(In(s,h))),i=i.current.alternate,i.flags|=65536,k&=-k,i.lanes|=k,g=In(g,h),k=Hf(i.stateNode,g,k),gf(i,k),Rt!==4&&(Rt=2)),!1;var A=Error(r(520),{cause:g});if(A=In(A,h),co===null?co=[A]:co.push(A),Rt!==4&&(Rt=2),s===null)return!0;g=In(g,h),h=s;do{switch(h.tag){case 3:return h.flags|=65536,i=k&-k,h.lanes|=i,i=Hf(h.stateNode,g,i),gf(h,i),!1;case 1:if(s=h.type,A=h.stateNode,(h.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(fr===null||!fr.has(A))))return h.flags|=65536,k&=-k,h.lanes|=k,k=O_(k),B_(k,i,h,g),gf(h,k),!1}h=h.return}while(h!==null);return!1}var Ff=Error(r(461)),It=!1;function Kt(i,s,h,g){s.child=i===null?F0(s,null,h,g):$r(s,i.child,h,g)}function I_(i,s,h,g,k){h=h.render;var A=s.ref;if("ref"in g){var I={};for(var W in g)W!=="ref"&&(I[W]=g[W])}else I=g;return Hr(s),g=Sf(i,s,h,I,A,k),W=xf(),i!==null&&!It?(wf(i,s,k),Ri(i,s,k)):(Qe&&W&&tf(s),s.flags|=1,Kt(i,s,g,k),s.child)}function z_(i,s,h,g,k){if(i===null){var A=h.type;return typeof A=="function"&&!Qh(A)&&A.defaultProps===void 0&&h.compare===null?(s.tag=15,s.type=A,H_(i,s,A,g,k)):(i=Hl(h.type,null,g,s,s.mode,k),i.ref=s.ref,i.return=s,s.child=i)}if(A=i.child,!Wf(i,k)){var I=A.memoizedProps;if(h=h.compare,h=h!==null?h:Pa,h(I,g)&&i.ref===s.ref)return Ri(i,s,k)}return s.flags|=1,i=Ci(A,g),i.ref=s.ref,i.return=s,s.child=i}function H_(i,s,h,g,k){if(i!==null){var A=i.memoizedProps;if(Pa(A,g)&&i.ref===s.ref)if(It=!1,s.pendingProps=g=A,Wf(i,k))(i.flags&131072)!==0&&(It=!0);else return s.lanes=i.lanes,Ri(i,s,k)}return Pf(i,s,h,g,k)}function F_(i,s,h,g){var k=g.children,A=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((s.flags&128)!==0){if(A=A!==null?A.baseLanes|h:h,i!==null){for(g=s.child=i.child,k=0;g!==null;)k=k|g.lanes|g.childLanes,g=g.sibling;g=k&~A}else g=0,s.child=null;return P_(i,s,A,h,g)}if((h&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&$l(s,A!==null?A.cachePool:null),A!==null?$0(s,A):_f(),G0(s);else return g=s.lanes=536870912,P_(i,s,A!==null?A.baseLanes|h:h,h,g)}else A!==null?($l(s,A.cachePool),$0(s,A),lr(),s.memoizedState=null):(i!==null&&$l(s,null),_f(),lr());return Kt(i,s,k,h),s.child}function no(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function P_(i,s,h,g,k){var A=hf();return A=A===null?null:{parent:Ot._currentValue,pool:A},s.memoizedState={baseLanes:h,cachePool:A},i!==null&&$l(s,null),_f(),G0(s),i!==null&&Ms(i,s,g,!0),s.childLanes=k,null}function sc(i,s){return s=oc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function U_(i,s,h){return $r(s,i.child,null,h),i=sc(s,s.pendingProps),i.flags|=2,xn(s),s.memoizedState=null,i}function rk(i,s,h){var g=s.pendingProps,k=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Qe){if(g.mode==="hidden")return i=sc(s,g),s.lanes=536870912,no(null,i);if(yf(s),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return s.lanes=536870912,null}return sc(s,g)}var A=i.memoizedState;if(A!==null){var I=A.dehydrated;if(yf(s),k)if(s.flags&256)s.flags&=-257,s=U_(i,s,h);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(It||Ms(i,s,h,!1),k=(h&i.childLanes)!==0,It||k){if(g=_t,g!==null&&(I=gs(g,h),I!==0&&I!==A.retryLane))throw A.retryLane=I,Or(i,I),dn(g,i,I),Ff;mc(),s=U_(i,s,h)}else i=A.treeContext,St=Un(I.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=sc(s,g),s.flags|=4096;return s}return i=Ci(i.child,{mode:g.mode,children:g.children}),i.ref=s.ref,s.child=i,i.return=s,i}function ac(i,s){var h=s.ref;if(h===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(i===null||i.ref!==h)&&(s.flags|=4194816)}}function Pf(i,s,h,g,k){return Hr(s),h=Sf(i,s,h,g,void 0,k),g=xf(),i!==null&&!It?(wf(i,s,k),Ri(i,s,k)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,k),s.child)}function $_(i,s,h,g,k,A){return Hr(s),s.updateQueue=null,h=V0(s,g,h,k),q0(i),g=xf(),i!==null&&!It?(wf(i,s,A),Ri(i,s,A)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,A),s.child)}function G_(i,s,h,g,k){if(Hr(s),s.stateNode===null){var A=Ns,I=h.contextType;typeof I=="object"&&I!==null&&(A=Xt(I)),A=new h(g,A),s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=zf,s.stateNode=A,A._reactInternals=s,A=s.stateNode,A.props=g,A.state=s.memoizedState,A.refs={},df(s),I=h.contextType,A.context=typeof I=="object"&&I!==null?Xt(I):Ns,A.state=s.memoizedState,I=h.getDerivedStateFromProps,typeof I=="function"&&(If(s,h,I,g),A.state=s.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(I=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),I!==A.state&&zf.enqueueReplaceState(A,A.state,null),Za(s,g,A,k),Ka(),A.state=s.memoizedState),typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!0}else if(i===null){A=s.stateNode;var W=s.memoizedProps,J=qr(h,W);A.props=J;var ce=A.context,me=h.contextType;I=Ns,typeof me=="object"&&me!==null&&(I=Xt(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof A.getSnapshotBeforeUpdate=="function",W=s.pendingProps!==W,me||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(W||ce!==I)&&R_(s,A,g,I),rr=!1;var ue=s.memoizedState;A.state=ue,Za(s,g,A,k),Ka(),ce=s.memoizedState,W||ue!==ce||rr?(typeof ve=="function"&&(If(s,h,ve,g),ce=s.memoizedState),(J=rr||T_(s,h,J,g,ue,ce,I))?(me||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(s.flags|=4194308)):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=g,s.memoizedState=ce),A.props=g,A.state=ce,A.context=I,g=J):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!1)}else{A=s.stateNode,pf(i,s),I=s.memoizedProps,me=qr(h,I),A.props=me,ve=s.pendingProps,ue=A.context,ce=h.contextType,J=Ns,typeof ce=="object"&&ce!==null&&(J=Xt(ce)),W=h.getDerivedStateFromProps,(ce=typeof W=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==ve||ue!==J)&&R_(s,A,g,J),rr=!1,ue=s.memoizedState,A.state=ue,Za(s,g,A,k),Ka();var pe=s.memoizedState;I!==ve||ue!==pe||rr||i!==null&&i.dependencies!==null&&Pl(i.dependencies)?(typeof W=="function"&&(If(s,h,W,g),pe=s.memoizedState),(me=rr||T_(s,h,me,g,ue,pe,J)||i!==null&&i.dependencies!==null&&Pl(i.dependencies))?(ce||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,pe,J),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,pe,J)),typeof A.componentDidUpdate=="function"&&(s.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),s.memoizedProps=g,s.memoizedState=pe),A.props=g,A.state=pe,A.context=J,g=me):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),g=!1)}return A=g,ac(i,s),g=(s.flags&128)!==0,A||g?(A=s.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:A.render(),s.flags|=1,i!==null&&g?(s.child=$r(s,i.child,null,k),s.child=$r(s,null,h,k)):Kt(i,s,h,k),s.memoizedState=A.state,i=s.child):i=Ri(i,s,k),i}function q_(i,s,h,g){return Ir(),s.flags|=256,Kt(i,s,h,g),s.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $f(i){return{baseLanes:i,cachePool:L0()}}function Gf(i,s,h){return i=i!==null?i.childLanes&~h:0,s&&(i|=Cn),i}function V_(i,s,h){var g=s.pendingProps,k=!1,A=(s.flags&128)!==0,I;if((I=A)||(I=i!==null&&i.memoizedState===null?!1:(Mt.current&2)!==0),I&&(k=!0,s.flags&=-129),I=(s.flags&32)!==0,s.flags&=-33,i===null){if(Qe){if(k?or(s):lr(),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return kd(i)?s.lanes=32:s.lanes=536870912,null}var W=g.children;return g=g.fallback,k?(lr(),k=s.mode,W=oc({mode:"hidden",children:W},k),g=Br(g,k,h,null),W.return=s,g.return=s,W.sibling=g,s.child=W,g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(null,g)):(or(s),qf(s,W))}var J=i.memoizedState;if(J!==null&&(W=J.dehydrated,W!==null)){if(A)s.flags&256?(or(s),s.flags&=-257,s=Vf(i,s,h)):s.memoizedState!==null?(lr(),s.child=i.child,s.flags|=128,s=null):(lr(),W=g.fallback,k=s.mode,g=oc({mode:"visible",children:g.children},k),W=Br(W,k,h,null),W.flags|=2,g.return=s,W.return=s,g.sibling=W,s.child=g,$r(s,i.child,null,h),g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,s=no(null,g));else if(or(s),kd(W)){if(I=W.nextSibling&&W.nextSibling.dataset,I)var ce=I.dgst;I=ce,g=Error(r(419)),g.stack="",g.digest=I,Ga({value:g,source:null,stack:null}),s=Vf(i,s,h)}else if(It||Ms(i,s,h,!1),I=(h&i.childLanes)!==0,It||I){if(I=_t,I!==null&&(g=gs(I,h),g!==0&&g!==J.retryLane))throw J.retryLane=g,Or(i,g),dn(I,i,g),Ff;Ed(W)||mc(),s=Vf(i,s,h)}else Ed(W)?(s.flags|=192,s.child=i.child,s=null):(i=J.treeContext,St=Un(W.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=qf(s,g.children),s.flags|=4096);return s}return k?(lr(),W=g.fallback,k=s.mode,J=i.child,ce=J.sibling,g=Ci(J,{mode:"hidden",children:g.children}),g.subtreeFlags=J.subtreeFlags&65011712,ce!==null?W=Ci(ce,W):(W=Br(W,k,h,null),W.flags|=2),W.return=s,g.return=s,g.sibling=W,s.child=g,no(null,g),g=s.child,W=i.child.memoizedState,W===null?W=$f(h):(k=W.cachePool,k!==null?(J=Ot._currentValue,k=k.parent!==J?{parent:J,pool:J}:k):k=L0(),W={baseLanes:W.baseLanes|h,cachePool:k}),g.memoizedState=W,g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(i.child,g)):(or(s),h=i.child,i=h.sibling,h=Ci(h,{mode:"visible",children:g.children}),h.return=s,h.sibling=null,i!==null&&(I=s.deletions,I===null?(s.deletions=[i],s.flags|=16):I.push(i)),s.child=h,s.memoizedState=null,h)}function qf(i,s){return s=oc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function oc(i,s){return i=bn(22,i,null,s),i.lanes=0,i}function Vf(i,s,h){return $r(s,i.child,null,h),i=qf(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Y_(i,s,h){i.lanes|=s;var g=i.alternate;g!==null&&(g.lanes|=s),of(i.return,s,h)}function Yf(i,s,h,g,k,A){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:k,treeForkCount:A}:(I.isBackwards=s,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=h,I.tailMode=k,I.treeForkCount=A)}function W_(i,s,h){var g=s.pendingProps,k=g.revealOrder,A=g.tail;g=g.children;var I=Mt.current,W=(I&2)!==0;if(W?(I=I&1|2,s.flags|=128):I&=1,F(Mt,I),Kt(i,s,g,h),g=Qe?$a:0,!W&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Y_(i,h,s);else if(i.tag===19)Y_(i,h,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(k){case"forwards":for(h=s.child,k=null;h!==null;)i=h.alternate,i!==null&&Xl(i)===null&&(k=h),h=h.sibling;h=k,h===null?(k=s.child,s.child=null):(k=h.sibling,h.sibling=null),Yf(s,!1,k,h,A,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,k=s.child,s.child=null;k!==null;){if(i=k.alternate,i!==null&&Xl(i)===null){s.child=k;break}i=k.sibling,k.sibling=h,h=k,k=i}Yf(s,!0,h,null,A,g);break;case"together":Yf(s,!1,null,null,void 0,g);break;default:s.memoizedState=null}return s.child}function Ri(i,s,h){if(i!==null&&(s.dependencies=i.dependencies),hr|=s.lanes,(h&s.childLanes)===0)if(i!==null){if(Ms(i,s,h,!1),(h&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,h=Ci(i,i.pendingProps),s.child=h,h.return=s;i.sibling!==null;)i=i.sibling,h=h.sibling=Ci(i,i.pendingProps),h.return=s;h.sibling=null}return s.child}function Wf(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Pl(i)))}function sk(i,s,h){switch(s.tag){case 3:P(s,s.stateNode.containerInfo),ir(s,Ot,i.memoizedState.cache),Ir();break;case 27:case 5:ne(s);break;case 4:P(s,s.stateNode.containerInfo);break;case 10:ir(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,yf(s),null;break;case 13:var g=s.memoizedState;if(g!==null)return g.dehydrated!==null?(or(s),s.flags|=128,null):(h&s.child.childLanes)!==0?V_(i,s,h):(or(s),i=Ri(i,s,h),i!==null?i.sibling:null);or(s);break;case 19:var k=(i.flags&128)!==0;if(g=(h&s.childLanes)!==0,g||(Ms(i,s,h,!1),g=(h&s.childLanes)!==0),k){if(g)return W_(i,s,h);s.flags|=128}if(k=s.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),F(Mt,Mt.current),g)break;return null;case 22:return s.lanes=0,F_(i,s,h,s.pendingProps);case 24:ir(s,Ot,i.memoizedState.cache)}return Ri(i,s,h)}function X_(i,s,h){if(i!==null)if(i.memoizedProps!==s.pendingProps)It=!0;else{if(!Wf(i,h)&&(s.flags&128)===0)return It=!1,sk(i,s,h);It=(i.flags&131072)!==0}else It=!1,Qe&&(s.flags&1048576)!==0&&A0(s,$a,s.index);switch(s.lanes=0,s.tag){case 16:e:{var g=s.pendingProps;if(i=Pr(s.elementType),s.type=i,typeof i=="function")Qh(i)?(g=qr(i,g),s.tag=1,s=G_(null,s,i,g,h)):(s.tag=0,s=Pf(null,s,i,g,h));else{if(i!=null){var k=i.$$typeof;if(k===E){s.tag=11,s=I_(null,s,i,g,h);break e}else if(k===D){s.tag=14,s=z_(null,s,i,g,h);break e}}throw s=H(i)||i,Error(r(306,s,""))}}return s;case 0:return Pf(i,s,s.type,s.pendingProps,h);case 1:return g=s.type,k=qr(g,s.pendingProps),G_(i,s,g,k,h);case 3:e:{if(P(s,s.stateNode.containerInfo),i===null)throw Error(r(387));g=s.pendingProps;var A=s.memoizedState;k=A.element,pf(i,s),Za(s,g,null,h);var I=s.memoizedState;if(g=I.cache,ir(s,Ot,g),g!==A.cache&&lf(s,[Ot],h,!0),Ka(),g=I.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:I.cache},s.updateQueue.baseState=A,s.memoizedState=A,s.flags&256){s=q_(i,s,g,h);break e}else if(g!==k){k=In(Error(r(424)),s),Ga(k),s=q_(i,s,g,h);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(St=Un(i.firstChild),Wt=s,Qe=!0,tr=null,Fn=!0,h=F0(s,null,g,h),s.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Ir(),g===k){s=Ri(i,s,h);break e}Kt(i,s,g,h)}s=s.child}return s;case 26:return ac(i,s),i===null?(h=ay(s.type,null,s.pendingProps,null))?s.memoizedState=h:Qe||(h=s.type,i=s.pendingProps,g=wc(ae.current).createElement(h),g[$t]=s,g[Qt]=i,Zt(g,h,i),Lt(g),s.stateNode=g):s.memoizedState=ay(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ne(s),i===null&&Qe&&(g=s.stateNode=iy(s.type,s.pendingProps,ae.current),Wt=s,Fn=!0,k=St,mr(s.type)?(Ad=k,St=Un(g.firstChild)):St=k),Kt(i,s,s.pendingProps.children,h),ac(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Qe&&((k=g=St)&&(g=Ok(g,s.type,s.pendingProps,Fn),g!==null?(s.stateNode=g,Wt=s,St=Un(g.firstChild),Fn=!1,k=!0):k=!1),k||nr(s)),ne(s),k=s.type,A=s.pendingProps,I=i!==null?i.memoizedProps:null,g=A.children,xd(k,A)?g=null:I!==null&&xd(k,I)&&(s.flags|=32),s.memoizedState!==null&&(k=Sf(i,s,KE,null,null,h),vo._currentValue=k),ac(i,s),Kt(i,s,g,h),s.child;case 6:return i===null&&Qe&&((i=h=St)&&(h=Bk(h,s.pendingProps,Fn),h!==null?(s.stateNode=h,Wt=s,St=null,i=!0):i=!1),i||nr(s)),null;case 13:return V_(i,s,h);case 4:return P(s,s.stateNode.containerInfo),g=s.pendingProps,i===null?s.child=$r(s,null,g,h):Kt(i,s,g,h),s.child;case 11:return I_(i,s,s.type,s.pendingProps,h);case 7:return Kt(i,s,s.pendingProps,h),s.child;case 8:return Kt(i,s,s.pendingProps.children,h),s.child;case 12:return Kt(i,s,s.pendingProps.children,h),s.child;case 10:return g=s.pendingProps,ir(s,s.type,g.value),Kt(i,s,g.children,h),s.child;case 9:return k=s.type._context,g=s.pendingProps.children,Hr(s),k=Xt(k),g=g(k),s.flags|=1,Kt(i,s,g,h),s.child;case 14:return z_(i,s,s.type,s.pendingProps,h);case 15:return H_(i,s,s.type,s.pendingProps,h);case 19:return W_(i,s,h);case 31:return rk(i,s,h);case 22:return F_(i,s,h,s.pendingProps);case 24:return Hr(s),g=Xt(Ot),i===null?(k=hf(),k===null&&(k=_t,A=cf(),k.pooledCache=A,A.refCount++,A!==null&&(k.pooledCacheLanes|=h),k=A),s.memoizedState={parent:g,cache:k},df(s),ir(s,Ot,k)):((i.lanes&h)!==0&&(pf(i,s),Za(s,null,null,h),Ka()),k=i.memoizedState,A=s.memoizedState,k.parent!==g?(k={parent:g,cache:g},s.memoizedState=k,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=k),ir(s,Ot,g)):(g=A.cache,ir(s,Ot,g),g!==k.cache&&lf(s,[Ot],h,!0))),Kt(i,s,s.pendingProps.children,h),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Di(i){i.flags|=4}function Xf(i,s,h,g,k){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(k&335544128)===k)if(i.stateNode.complete)i.flags|=8192;else if(xv())i.flags|=8192;else throw Ur=ql,ff}else i.flags&=-16777217}function K_(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!hy(s))if(xv())i.flags|=8192;else throw Ur=ql,ff}function lc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?we():536870912,i.lanes|=s,Gs|=s)}function io(i,s){if(!Qe)switch(i.tailMode){case"hidden":s=i.tail;for(var h=null;s!==null;)s.alternate!==null&&(h=s),s=s.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,h=0,g=0;if(s)for(var k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags&65011712,g|=k.flags&65011712,k.return=i,k=k.sibling;else for(k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags,g|=k.flags,k.return=i,k=k.sibling;return i.subtreeFlags|=g,i.childLanes=h,s}function ak(i,s,h){var g=s.pendingProps;switch(nf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(s),null;case 1:return xt(s),null;case 3:return h=s.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),s.memoizedState.cache!==g&&(s.flags|=2048),Ai(Ot),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Ds(s)?Di(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sf())),xt(s),null;case 26:var k=s.type,A=s.memoizedState;return i===null?(Di(s),A!==null?(xt(s),K_(s,A)):(xt(s),Xf(s,k,null,g,h))):A?A!==i.memoizedState?(Di(s),xt(s),K_(s,A)):(xt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==g&&Di(s),xt(s),Xf(s,k,i,g,h)),null;case 27:if(ge(s),h=ae.current,k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}i=Q.current,Ds(s)?T0(s):(i=iy(k,g,h),s.stateNode=i,Di(s))}return xt(s),null;case 5:if(ge(s),k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}if(A=Q.current,Ds(s))T0(s);else{var I=wc(ae.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?A.multiple=!0:g.size&&(A.size=g.size);break;default:A=typeof g.is=="string"?I.createElement(k,{is:g.is}):I.createElement(k)}}A[$t]=s,A[Qt]=g;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Zt(A,k,g),k){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Di(s)}}return xt(s),Xf(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(typeof g!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Ds(s)){if(i=s.stateNode,h=s.memoizedProps,g=null,k=Wt,k!==null)switch(k.tag){case 27:case 5:g=k.memoizedProps}i[$t]=s,i=!!(i.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||Vv(i.nodeValue,h)),i||nr(s,!0)}else i=wc(i).createTextNode(g),i[$t]=s,s.stateNode=i}return xt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(g=Ds(s),h!==null){if(i===null){if(!g)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),i=!1}else h=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return xt(s),null;case 13:if(g=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Ds(s),g!==null&&g.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),k=!1}else k=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=g!==null,i=i!==null&&i.memoizedState!==null,h&&(g=s.child,k=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(k=g.alternate.memoizedState.cachePool.pool),A=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(A=g.memoizedState.cachePool.pool),A!==k&&(g.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),lc(s,s.updateQueue),xt(s),null);case 4:return ee(),i===null&&_d(s.stateNode.containerInfo),xt(s),null;case 10:return Ai(s.type),xt(s),null;case 19:if($(Mt),g=s.memoizedState,g===null)return xt(s),null;if(k=(s.flags&128)!==0,A=g.rendering,A===null)if(k)io(g,!1);else{if(Rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Xl(i),A!==null){for(s.flags|=128,io(g,!1),i=A.updateQueue,s.updateQueue=i,lc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)C0(h,i),h=h.sibling;return F(Mt,Mt.current&1|2),Qe&&Ei(s,g.treeForkCount),s.child}i=i.sibling}g.tail!==null&&Fe()>dc&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304)}else{if(!k)if(i=Xl(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,lc(s,i),io(g,!0),g.tail===null&&g.tailMode==="hidden"&&!A.alternate&&!Qe)return xt(s),null}else 2*Fe()-g.renderingStartTime>dc&&h!==536870912&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304);g.isBackwards?(A.sibling=s.child,s.child=A):(i=g.last,i!==null?i.sibling=A:s.child=A,g.last=A)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Fe(),i.sibling=null,h=Mt.current,F(Mt,k?h&1|2:h&1),Qe&&Ei(s,g.treeForkCount),i):(xt(s),null);case 22:case 23:return xn(s),vf(),g=s.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(s.flags|=8192):g&&(s.flags|=8192),g?(h&536870912)!==0&&(s.flags&128)===0&&(xt(s),s.subtreeFlags&6&&(s.flags|=8192)):xt(s),h=s.updateQueue,h!==null&&lc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==h&&(s.flags|=2048),i!==null&&$(Fr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ai(Ot),xt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function ok(i,s){switch(nf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ai(Ot),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return $(Mt),null;case 4:return ee(),null;case 10:return Ai(s.type),null;case 22:case 23:return xn(s),vf(),i!==null&&$(Fr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ai(Ot),null;case 25:return null;default:return null}}function Z_(i,s){switch(nf(s),s.tag){case 3:Ai(Ot),ee();break;case 26:case 27:case 5:ge(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:$(Mt);break;case 10:Ai(s.type);break;case 22:case 23:xn(s),vf(),i!==null&&$(Fr);break;case 24:Ai(Ot)}}function ro(i,s){try{var h=s.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var k=g.next;h=k;do{if((h.tag&i)===i){g=void 0;var A=h.create,I=h.inst;g=A(),I.destroy=g}h=h.next}while(h!==k)}}catch(W){dt(s,s.return,W)}}function cr(i,s,h){try{var g=s.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&i)===i){var I=g.inst,W=I.destroy;if(W!==void 0){I.destroy=void 0,k=s;var J=h,ce=W;try{ce()}catch(me){dt(k,J,me)}}}g=g.next}while(g!==A)}}catch(me){dt(s,s.return,me)}}function Q_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{U0(s,h)}catch(g){dt(i,i.return,g)}}}function J_(i,s,h){h.props=qr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(g){dt(i,s,g)}}function so(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof h=="function"?i.refCleanup=h(g):h.current=g}}catch(k){dt(i,s,k)}}function ai(i,s){var h=i.ref,g=i.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(k){dt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){dt(i,s,k)}else h.current=null}function ev(i){var s=i.type,h=i.memoizedProps,g=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(k){dt(i,i.return,k)}}function Kf(i,s,h){try{var g=i.stateNode;Tk(g,i.type,h,s),g[Qt]=s}catch(k){dt(i,i.return,k)}}function tv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function Zf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||tv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qf(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=xi));else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(Qf(i,s,h),i=i.sibling;i!==null;)Qf(i,s,h),i=i.sibling}function cc(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(cc(i,s,h),i=i.sibling;i!==null;)cc(i,s,h),i=i.sibling}function nv(i){var s=i.stateNode,h=i.memoizedProps;try{for(var g=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Zt(s,g,h),s[$t]=i,s[Qt]=h}catch(A){dt(i,i.return,A)}}var Mi=!1,zt=!1,Jf=!1,iv=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function lk(i,s){if(i=i.containerInfo,bd=Rc,i=g0(i),qh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var k=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,W=-1,J=-1,ce=0,me=0,ve=i,ue=null;t:for(;;){for(var pe;ve!==h||k!==0&&ve.nodeType!==3||(W=I+k),ve!==A||g!==0&&ve.nodeType!==3||(J=I+g),ve.nodeType===3&&(I+=ve.nodeValue.length),(pe=ve.firstChild)!==null;)ue=ve,ve=pe;for(;;){if(ve===i)break t;if(ue===h&&++ce===k&&(W=I),ue===A&&++me===g&&(J=I),(pe=ve.nextSibling)!==null)break;ve=ue,ue=ve.parentNode}ve=pe}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Sd={focusedElem:i,selectionRange:h},Rc=!1,Vt=s;Vt!==null;)if(s=Vt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Vt=i;else for(;Vt!==null;){switch(s=Vt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h<i.length;h++)k=i[h],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&A!==null){i=void 0,h=s,k=A.memoizedProps,A=A.memoizedState,g=h.stateNode;try{var Te=qr(h.type,k);i=g.getSnapshotBeforeUpdate(Te,A),g.__reactInternalSnapshotBeforeUpdate=i}catch(Be){dt(h,h.return,Be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,h=i.nodeType,h===9)Cd(i);else if(h===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Cd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Vt=i;break}Vt=s.return}}function rv(i,s,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Li(i,h),g&4&&ro(5,h);break;case 1:if(Li(i,h),g&4)if(i=h.stateNode,s===null)try{i.componentDidMount()}catch(I){dt(h,h.return,I)}else{var k=qr(h.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(k,s,i.__reactInternalSnapshotBeforeUpdate)}catch(I){dt(h,h.return,I)}}g&64&&Q_(h),g&512&&so(h,h.return);break;case 3:if(Li(i,h),g&64&&(i=h.updateQueue,i!==null)){if(s=null,h.child!==null)switch(h.child.tag){case 27:case 5:s=h.child.stateNode;break;case 1:s=h.child.stateNode}try{U0(i,s)}catch(I){dt(h,h.return,I)}}break;case 27:s===null&&g&4&&nv(h);case 26:case 5:Li(i,h),s===null&&g&4&&ev(h),g&512&&so(h,h.return);break;case 12:Li(i,h);break;case 31:Li(i,h),g&4&&ov(i,h);break;case 13:Li(i,h),g&4&&lv(i,h),g&64&&(i=h.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(h=_k.bind(null,h),Ik(i,h))));break;case 22:if(g=h.memoizedState!==null||Mi,!g){s=s!==null&&s.memoizedState!==null||zt,k=Mi;var A=zt;Mi=g,(zt=s)&&!A?Oi(i,h,(h.subtreeFlags&8772)!==0):Li(i,h),Mi=k,zt=A}break;case 30:break;default:Li(i,h)}}function sv(i){var s=i.alternate;s!==null&&(i.alternate=null,sv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Na(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Et=null,cn=!1;function ji(i,s,h){for(h=h.child;h!==null;)av(i,s,h),h=h.sibling}function av(i,s,h){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Nt,h)}catch{}switch(h.tag){case 26:zt||ai(h,s),ji(i,s,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:zt||ai(h,s);var g=Et,k=cn;mr(h.type)&&(Et=h.stateNode,cn=!1),ji(i,s,h),go(h.stateNode),Et=g,cn=k;break;case 5:zt||ai(h,s);case 6:if(g=Et,k=cn,Et=null,ji(i,s,h),Et=g,cn=k,Et!==null)if(cn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(h.stateNode)}catch(A){dt(h,s,A)}else try{Et.removeChild(h.stateNode)}catch(A){dt(h,s,A)}break;case 18:Et!==null&&(cn?(i=Et,Qv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,h.stateNode),Qs(i)):Qv(Et,h.stateNode));break;case 4:g=Et,k=cn,Et=h.stateNode.containerInfo,cn=!0,ji(i,s,h),Et=g,cn=k;break;case 0:case 11:case 14:case 15:cr(2,h,s),zt||cr(4,h,s),ji(i,s,h);break;case 1:zt||(ai(h,s),g=h.stateNode,typeof g.componentWillUnmount=="function"&&J_(h,s,g)),ji(i,s,h);break;case 21:ji(i,s,h);break;case 22:zt=(g=zt)||h.memoizedState!==null,ji(i,s,h),zt=g;break;default:ji(i,s,h)}}function ov(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Qs(i)}catch(h){dt(s,s.return,h)}}}function lv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Qs(i)}catch(h){dt(s,s.return,h)}}function ck(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new iv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new iv),s;default:throw Error(r(435,i.tag))}}function uc(i,s){var h=ck(i);s.forEach(function(g){if(!h.has(g)){h.add(g);var k=vk.bind(null,i,g);g.then(k,k)}})}function un(i,s){var h=s.deletions;if(h!==null)for(var g=0;g<h.length;g++){var k=h[g],A=i,I=s,W=I;e:for(;W!==null;){switch(W.tag){case 27:if(mr(W.type)){Et=W.stateNode,cn=!1;break e}break;case 5:Et=W.stateNode,cn=!1;break e;case 3:case 4:Et=W.stateNode.containerInfo,cn=!0;break e}W=W.return}if(Et===null)throw Error(r(160));av(A,I,k),Et=null,cn=!1,A=k.alternate,A!==null&&(A.return=null),k.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)cv(s,i),s=s.sibling}var Yn=null;function cv(i,s){var h=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),hn(i),g&4&&(cr(3,i,i.return),ro(3,i),cr(5,i,i.return));break;case 1:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&64&&Mi&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(h=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var k=Yn;if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&4){var A=h!==null?h.memoizedState:null;if(g=i.memoizedState,h===null)if(g===null)if(i.stateNode===null){e:{g=i.type,h=i.memoizedProps,k=k.ownerDocument||k;t:switch(g){case"title":A=k.getElementsByTagName("title")[0],(!A||A[Rr]||A[$t]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=k.createElement(g),k.head.insertBefore(A,k.querySelector("head > title"))),Zt(A,g,h),A[$t]=i,Lt(A),g=A;break e;case"link":var I=cy("link","href",k).get(g+(h.href||""));if(I){for(var W=0;W<I.length;W++)if(A=I[W],A.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&A.getAttribute("rel")===(h.rel==null?null:h.rel)&&A.getAttribute("title")===(h.title==null?null:h.title)&&A.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;case"meta":if(I=cy("meta","content",k).get(g+(h.content||""))){for(W=0;W<I.length;W++)if(A=I[W],A.getAttribute("content")===(h.content==null?null:""+h.content)&&A.getAttribute("name")===(h.name==null?null:h.name)&&A.getAttribute("property")===(h.property==null?null:h.property)&&A.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&A.getAttribute("charset")===(h.charSet==null?null:h.charSet)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;default:throw Error(r(468,g))}A[$t]=i,Lt(A),g=A}i.stateNode=g}else uy(k,i.type,i.stateNode);else i.stateNode=ly(k,g,i.memoizedProps);else A!==g?(A===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):A.count--,g===null?uy(k,i.type,i.stateNode):ly(k,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Kf(i,i.memoizedProps,h.memoizedProps)}break;case 27:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),h!==null&&g&4&&Kf(i,i.memoizedProps,h.memoizedProps);break;case 5:if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),i.flags&32){k=i.stateNode;try{Ss(k,"")}catch(Te){dt(i,i.return,Te)}}g&4&&i.stateNode!=null&&(k=i.memoizedProps,Kf(i,k,h!==null?h.memoizedProps:k)),g&1024&&(Jf=!0);break;case 6:if(un(s,i),hn(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,h=i.stateNode;try{h.nodeValue=g}catch(Te){dt(i,i.return,Te)}}break;case 3:if(kc=null,k=Yn,Yn=Cc(s.containerInfo),un(s,i),Yn=k,hn(i),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Qs(s.containerInfo)}catch(Te){dt(i,i.return,Te)}Jf&&(Jf=!1,uv(i));break;case 4:g=Yn,Yn=Cc(i.stateNode.containerInfo),un(s,i),hn(i),Yn=g;break;case 12:un(s,i),hn(i);break;case 31:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 13:un(s,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(fc=Fe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 22:k=i.memoizedState!==null;var J=h!==null&&h.memoizedState!==null,ce=Mi,me=zt;if(Mi=ce||k,zt=me||J,un(s,i),zt=me,Mi=ce,hn(i),g&8192)e:for(s=i.stateNode,s._visibility=k?s._visibility&-2:s._visibility|1,k&&(h===null||J||Mi||zt||Vr(i)),h=null,s=i;;){if(s.tag===5||s.tag===26){if(h===null){J=h=s;try{if(A=J.stateNode,k)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{W=J.stateNode;var ve=J.memoizedProps.style,ue=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;W.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===6){if(h===null){J=s;try{J.stateNode.nodeValue=k?"":J.memoizedProps}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===18){if(h===null){J=s;try{var pe=J.stateNode;k?Jv(pe,!0):Jv(J.stateNode,!1)}catch(Te){dt(J,J.return,Te)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;h===s&&(h=null),s=s.return}h===s&&(h=null),s.sibling.return=s.return,s=s.sibling}g&4&&(g=i.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,uc(i,h))));break;case 19:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 30:break;case 21:break;default:un(s,i),hn(i)}}function hn(i){var s=i.flags;if(s&2){try{for(var h,g=i.return;g!==null;){if(tv(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var k=h.stateNode,A=Zf(i);cc(i,A,k);break;case 5:var I=h.stateNode;h.flags&32&&(Ss(I,""),h.flags&=-33);var W=Zf(i);cc(i,W,I);break;case 3:case 4:var J=h.stateNode.containerInfo,ce=Zf(i);Qf(i,ce,J);break;default:throw Error(r(161))}}catch(me){dt(i,i.return,me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function uv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;uv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Li(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)rv(i,s.alternate,s),s=s.sibling}function Vr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:cr(4,s,s.return),Vr(s);break;case 1:ai(s,s.return);var h=s.stateNode;typeof h.componentWillUnmount=="function"&&J_(s,s.return,h),Vr(s);break;case 27:go(s.stateNode);case 26:case 5:ai(s,s.return),Vr(s);break;case 22:s.memoizedState===null&&Vr(s);break;case 30:Vr(s);break;default:Vr(s)}i=i.sibling}}function Oi(i,s,h){for(h=h&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var g=s.alternate,k=i,A=s,I=A.flags;switch(A.tag){case 0:case 11:case 15:Oi(k,A,h),ro(4,A);break;case 1:if(Oi(k,A,h),g=A,k=g.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(ce){dt(g,g.return,ce)}if(g=A,k=g.updateQueue,k!==null){var W=g.stateNode;try{var J=k.shared.hiddenCallbacks;if(J!==null)for(k.shared.hiddenCallbacks=null,k=0;k<J.length;k++)P0(J[k],W)}catch(ce){dt(g,g.return,ce)}}h&&I&64&&Q_(A),so(A,A.return);break;case 27:nv(A);case 26:case 5:Oi(k,A,h),h&&g===null&&I&4&&ev(A),so(A,A.return);break;case 12:Oi(k,A,h);break;case 31:Oi(k,A,h),h&&I&4&&ov(k,A);break;case 13:Oi(k,A,h),h&&I&4&&lv(k,A);break;case 22:A.memoizedState===null&&Oi(k,A,h),so(A,A.return);break;case 30:break;default:Oi(k,A,h)}s=s.sibling}}function ed(i,s){var h=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==h&&(i!=null&&i.refCount++,h!=null&&qa(h))}function td(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i))}function Wn(i,s,h,g){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hv(i,s,h,g),s=s.sibling}function hv(i,s,h,g){var k=s.flags;switch(s.tag){case 0:case 11:case 15:Wn(i,s,h,g),k&2048&&ro(9,s);break;case 1:Wn(i,s,h,g);break;case 3:Wn(i,s,h,g),k&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i)));break;case 12:if(k&2048){Wn(i,s,h,g),i=s.stateNode;try{var A=s.memoizedProps,I=A.id,W=A.onPostCommit;typeof W=="function"&&W(I,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(J){dt(s,s.return,J)}}else Wn(i,s,h,g);break;case 31:Wn(i,s,h,g);break;case 13:Wn(i,s,h,g);break;case 23:break;case 22:A=s.stateNode,I=s.alternate,s.memoizedState!==null?A._visibility&2?Wn(i,s,h,g):ao(i,s):A._visibility&2?Wn(i,s,h,g):(A._visibility|=2,Ps(i,s,h,g,(s.subtreeFlags&10256)!==0||!1)),k&2048&&ed(I,s);break;case 24:Wn(i,s,h,g),k&2048&&td(s.alternate,s);break;default:Wn(i,s,h,g)}}function Ps(i,s,h,g,k){for(k=k&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var A=i,I=s,W=h,J=g,ce=I.flags;switch(I.tag){case 0:case 11:case 15:Ps(A,I,W,J,k),ro(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?Ps(A,I,W,J,k):ao(A,I):(me._visibility|=2,Ps(A,I,W,J,k)),k&&ce&2048&&ed(I.alternate,I);break;case 24:Ps(A,I,W,J,k),k&&ce&2048&&td(I.alternate,I);break;default:Ps(A,I,W,J,k)}s=s.sibling}}function ao(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var h=i,g=s,k=g.flags;switch(g.tag){case 22:ao(h,g),k&2048&&ed(g.alternate,g);break;case 24:ao(h,g),k&2048&&td(g.alternate,g);break;default:ao(h,g)}s=s.sibling}}var oo=8192;function Us(i,s,h){if(i.subtreeFlags&oo)for(i=i.child;i!==null;)fv(i,s,h),i=i.sibling}function fv(i,s,h){switch(i.tag){case 26:Us(i,s,h),i.flags&oo&&i.memoizedState!==null&&Xk(h,Yn,i.memoizedState,i.memoizedProps);break;case 5:Us(i,s,h);break;case 3:case 4:var g=Yn;Yn=Cc(i.stateNode.containerInfo),Us(i,s,h),Yn=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=oo,oo=16777216,Us(i,s,h),oo=g):Us(i,s,h));break;default:Us(i,s,h)}}function dv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function lo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(i),i=i.sibling}function pv(i){switch(i.tag){case 0:case 11:case 15:lo(i),i.flags&2048&&cr(9,i,i.return);break;case 3:lo(i);break;case 12:lo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,hc(i)):lo(i);break;default:lo(i)}}function hc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:cr(8,s,s.return),hc(s);break;case 22:h=s.stateNode,h._visibility&2&&(h._visibility&=-3,hc(s));break;default:hc(s)}i=i.sibling}}function gv(i,s){for(;Vt!==null;){var h=Vt;switch(h.tag){case 0:case 11:case 15:cr(8,h,s);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:qa(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Vt=g;else e:for(h=i;Vt!==null;){g=Vt;var k=g.sibling,A=g.return;if(sv(g),g===h){Vt=null;break e}if(k!==null){k.return=A,Vt=k;break e}Vt=A}}}var uk={getCacheForType:function(i){var s=Xt(Ot),h=s.data.get(i);return h===void 0&&(h=i(),s.data.set(i,h)),h},cacheSignal:function(){return Xt(Ot).controller.signal}},hk=typeof WeakMap=="function"?WeakMap:Map,ot=0,_t=null,Ye=null,Ke=0,ft=0,wn=null,ur=!1,$s=!1,nd=!1,Bi=0,Rt=0,hr=0,Yr=0,id=0,Cn=0,Gs=0,co=null,fn=null,rd=!1,fc=0,mv=0,dc=1/0,pc=null,fr=null,Gt=0,dr=null,qs=null,Ii=0,sd=0,ad=null,_v=null,uo=0,od=null;function En(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:q.T!==null?dd():yl()}function vv(){if(Cn===0)if((Ke&536870912)===0||Qe){var i=mi;mi<<=1,(mi&3932160)===0&&(mi=262144),Cn=i}else Cn=536870912;return i=Sn.current,i!==null&&(i.flags|=32),Cn}function dn(i,s,h){(i===_t&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),pr(i,Ke,Cn,!1)),qe(i,h),((ot&2)===0||i!==_t)&&(i===_t&&((ot&2)===0&&(Yr|=h),Rt===4&&pr(i,Ke,Cn,!1)),oi(i))}function yv(i,s,h){if((ot&6)!==0)throw Error(r(327));var g=!h&&(s&127)===0&&(s&i.expiredLanes)===0||ni(i,s),k=g?pk(i,s):cd(i,s,!0),A=g;do{if(k===0){$s&&!g&&pr(i,s,0,!1);break}else{if(h=i.current.alternate,A&&!fk(h)){k=cd(i,s,!1),A=!1;continue}if(k===2){if(A=s,i.errorRecoveryDisabledLanes&A)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){s=I;e:{var W=i;k=co;var J=W.current.memoizedState.isDehydrated;if(J&&(Vs(W,I).flags|=256),I=cd(W,I,!1),I!==2){if(nd&&!J){W.errorRecoveryDisabledLanes|=A,Yr|=A,k=4;break e}A=fn,fn=k,A!==null&&(fn===null?fn=A:fn.push.apply(fn,A))}k=I}if(A=!1,k!==2)continue}}if(k===1){Vs(i,0),pr(i,s,0,!0);break}e:{switch(g=i,A=k,A){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:pr(g,s,Cn,!ur);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(k=fc+300-Fe(),10<k)){if(pr(g,s,Cn,!ur),vi(g,0,!0)!==0)break e;Ii=s,g.timeoutHandle=Kv(bv.bind(null,g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,"Throttled",-0,0),k);break e}bv(g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,null,-0,0)}}break}while(!0);oi(i)}function bv(i,s,h,g,k,A,I,W,J,ce,me,ve,ue,pe){if(i.timeoutHandle=-1,ve=s.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xi},fv(s,A,ve);var Te=(A&62914560)===A?fc-Fe():(A&4194048)===A?mv-Fe():0;if(Te=Kk(ve,Te),Te!==null){Ii=A,i.cancelPendingCommit=Te(Nv.bind(null,i,s,A,h,g,k,I,W,J,me,ve,null,ue,pe)),pr(i,A,I,!ce);return}}Nv(i,s,A,h,g,k,I,W,J)}function fk(i){for(var s=i;;){var h=s.tag;if((h===0||h===11||h===15)&&s.flags&16384&&(h=s.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var k=h[g],A=k.getSnapshot;k=k.value;try{if(!yn(A(),k))return!1}catch{return!1}}if(h=s.child,s.subtreeFlags&16384&&h!==null)h.return=s,s=h;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function pr(i,s,h,g){s&=~id,s&=~Yr,i.suspendedLanes|=s,i.pingedLanes&=~s,g&&(i.warmLanes|=s),g=i.expirationTimes;for(var k=s;0<k;){var A=31-st(k),I=1<<A;g[A]=-1,k&=~I}h!==0&&yi(i,h,s)}function gc(){return(ot&6)===0?(ho(0),!1):!0}function ld(){if(Ye!==null){if(ft===0)var i=Ye.return;else i=Ye,ki=zr=null,Cf(i),Bs=null,Ya=0,i=Ye;for(;i!==null;)Z_(i.alternate,i),i=i.return;Ye=null}}function Vs(i,s){var h=i.timeoutHandle;h!==-1&&(i.timeoutHandle=-1,Mk(h)),h=i.cancelPendingCommit,h!==null&&(i.cancelPendingCommit=null,h()),Ii=0,ld(),_t=i,Ye=h=Ci(i.current,null),Ke=s,ft=0,wn=null,ur=!1,$s=ni(i,s),nd=!1,Gs=Cn=id=Yr=hr=Rt=0,fn=co=null,rd=!1,(s&8)!==0&&(s|=s&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=s;0<g;){var k=31-st(g),A=1<<k;s|=i[k],g&=~A}return Bi=s,Bl(),h}function Sv(i,s){Pe=null,q.H=to,s===Os||s===Gl?(s=I0(),ft=3):s===ff?(s=I0(),ft=4):ft=s===Ff?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wn=s,Ye===null&&(Rt=1,rc(i,In(s,i.current)))}function xv(){var i=Sn.current;return i===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?i===Pn:!1}function wv(){var i=q.H;return q.H=to,i===null?to:i}function Cv(){var i=q.A;return q.A=uk,i}function mc(){Rt=4,ur||(Ke&4194048)!==Ke&&Sn.current!==null||($s=!0),(hr&134217727)===0&&(Yr&134217727)===0||_t===null||pr(_t,Ke,Cn,!1)}function cd(i,s,h){var g=ot;ot|=2;var k=wv(),A=Cv();(_t!==i||Ke!==s)&&(pc=null,Vs(i,s)),s=!1;var I=Rt;e:do try{if(ft!==0&&Ye!==null){var W=Ye,J=wn;switch(ft){case 8:ld(),I=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(s=!0);var ce=ft;if(ft=0,wn=null,Ys(i,W,J,ce),h&&$s){I=0;break e}break;default:ce=ft,ft=0,wn=null,Ys(i,W,J,ce)}}dk(),I=Rt;break}catch(me){Sv(i,me)}while(!0);return s&&i.shellSuspendCounter++,ki=zr=null,ot=g,q.H=k,q.A=A,Ye===null&&(_t=null,Ke=0,Bl()),I}function dk(){for(;Ye!==null;)Ev(Ye)}function pk(i,s){var h=ot;ot|=2;var g=wv(),k=Cv();_t!==i||Ke!==s?(pc=null,dc=Fe()+500,Vs(i,s)):$s=ni(i,s);e:do try{if(ft!==0&&Ye!==null){s=Ye;var A=wn;t:switch(ft){case 1:ft=0,wn=null,Ys(i,s,A,1);break;case 2:case 9:if(O0(A)){ft=0,wn=null,kv(s);break}s=function(){ft!==2&&ft!==9||_t!==i||(ft=7),oi(i)},A.then(s,s);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:O0(A)?(ft=0,wn=null,kv(s)):(ft=0,wn=null,Ys(i,s,A,7));break;case 5:var I=null;switch(Ye.tag){case 26:I=Ye.memoizedState;case 5:case 27:var W=Ye;if(I?hy(I):W.stateNode.complete){ft=0,wn=null;var J=W.sibling;if(J!==null)Ye=J;else{var ce=W.return;ce!==null?(Ye=ce,_c(ce)):Ye=null}break t}}ft=0,wn=null,Ys(i,s,A,5);break;case 6:ft=0,wn=null,Ys(i,s,A,6);break;case 8:ld(),Rt=6;break e;default:throw Error(r(462))}}gk();break}catch(me){Sv(i,me)}while(!0);return ki=zr=null,q.H=g,q.A=k,ot=h,Ye!==null?0:(_t=null,Ke=0,Bl(),Rt)}function gk(){for(;Ye!==null&&!Pt();)Ev(Ye)}function Ev(i){var s=X_(i.alternate,i,Bi);i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function kv(i){var s=i,h=s.alternate;switch(s.tag){case 15:case 0:s=$_(h,s,s.pendingProps,s.type,void 0,Ke);break;case 11:s=$_(h,s,s.pendingProps,s.type.render,s.ref,Ke);break;case 5:Cf(s);default:Z_(h,s),s=Ye=C0(s,Bi),s=X_(h,s,Bi)}i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function Ys(i,s,h,g){ki=zr=null,Cf(s),Bs=null,Ya=0;var k=s.return;try{if(ik(i,k,s,h,Ke)){Rt=1,rc(i,In(h,i.current)),Ye=null;return}}catch(A){if(k!==null)throw Ye=k,A;Rt=1,rc(i,In(h,i.current)),Ye=null;return}s.flags&32768?(Qe||g===1?i=!0:$s||(Ke&536870912)!==0?i=!1:(ur=i=!0,(g===2||g===9||g===3||g===6)&&(g=Sn.current,g!==null&&g.tag===13&&(g.flags|=16384))),Av(s,i)):_c(s)}function _c(i){var s=i;do{if((s.flags&32768)!==0){Av(s,ur);return}i=s.return;var h=ak(s.alternate,s,Bi);if(h!==null){Ye=h;return}if(s=s.sibling,s!==null){Ye=s;return}Ye=s=i}while(s!==null);Rt===0&&(Rt=5)}function Av(i,s){do{var h=ok(i.alternate,i);if(h!==null){h.flags&=32767,Ye=h;return}if(h=i.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!s&&(i=i.sibling,i!==null)){Ye=i;return}Ye=i=h}while(i!==null);Rt=6,Ye=null}function Nv(i,s,h,g,k,A,I,W,J){i.cancelPendingCommit=null;do vc();while(Gt!==0);if((ot&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(A=s.lanes|s.childLanes,A|=Kh,at(i,h,A,I,W,J),i===_t&&(Ye=_t=null,Ke=0),qs=s,dr=i,Ii=h,sd=A,ad=k,_v=g,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,yk(Se,function(){return jv(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||g){g=q.T,q.T=null,k=X.p,X.p=2,I=ot,ot|=4;try{lk(i,s,h)}finally{ot=I,X.p=k,q.T=g}}Gt=1,Tv(),Rv(),Dv()}}function Tv(){if(Gt===1){Gt=0;var i=dr,s=qs,h=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||h){h=q.T,q.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{cv(s,i);var A=Sd,I=g0(i.containerInfo),W=A.focusedElem,J=A.selectionRange;if(I!==W&&W&&W.ownerDocument&&p0(W.ownerDocument.documentElement,W)){if(J!==null&&qh(W)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in W)W.selectionStart=ce,W.selectionEnd=Math.min(me,W.value.length);else{var ve=W.ownerDocument||document,ue=ve&&ve.defaultView||window;if(ue.getSelection){var pe=ue.getSelection(),Te=W.textContent.length,Be=Math.min(J.start,Te),mt=J.end===void 0?Be:Math.min(J.end,Te);!pe.extend&&Be>mt&&(I=mt,mt=Be,Be=I);var se=d0(W,Be),te=d0(W,mt);if(se&&te&&(pe.rangeCount!==1||pe.anchorNode!==se.node||pe.anchorOffset!==se.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var le=ve.createRange();le.setStart(se.node,se.offset),pe.removeAllRanges(),Be>mt?(pe.addRange(le),pe.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),pe.addRange(le))}}}}for(ve=[],pe=W;pe=pe.parentNode;)pe.nodeType===1&&ve.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<ve.length;W++){var _e=ve[W];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Rc=!!bd,Sd=bd=null}finally{ot=k,X.p=g,q.T=h}}i.current=s,Gt=2}}function Rv(){if(Gt===2){Gt=0;var i=dr,s=qs,h=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||h){h=q.T,q.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{rv(i,s.alternate,s)}finally{ot=k,X.p=g,q.T=h}}Gt=3}}function Dv(){if(Gt===4||Gt===3){Gt=0,ht();var i=dr,s=qs,h=Ii,g=_v;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gt=5:(Gt=0,qs=dr=null,Mv(i,i.pendingLanes));var k=i.pendingLanes;if(k===0&&(fr=null),Aa(h),s=s.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Nt,s,void 0,(s.current.flags&128)===128)}catch{}if(g!==null){s=q.T,k=X.p,X.p=2,q.T=null;try{for(var A=i.onRecoverableError,I=0;I<g.length;I++){var W=g[I];A(W.value,{componentStack:W.stack})}}finally{q.T=s,X.p=k}}(Ii&3)!==0&&vc(),oi(i),k=i.pendingLanes,(h&261930)!==0&&(k&42)!==0?i===od?uo++:(uo=0,od=i):uo=0,ho(0)}}function Mv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,qa(s)))}function vc(){return Tv(),Rv(),Dv(),jv()}function jv(){if(Gt!==5)return!1;var i=dr,s=sd;sd=0;var h=Aa(Ii),g=q.T,k=X.p;try{X.p=32>h?32:h,q.T=null,h=ad,ad=null;var A=dr,I=Ii;if(Gt=0,qs=dr=null,Ii=0,(ot&6)!==0)throw Error(r(331));var W=ot;if(ot|=4,pv(A.current),hv(A,A.current,I,h),ot=W,ho(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Nt,A)}catch{}return!0}finally{X.p=k,q.T=g,Mv(i,s)}}function Lv(i,s,h){s=In(h,s),s=Hf(i.stateNode,s,2),i=ar(i,s,2),i!==null&&(qe(i,2),oi(i))}function dt(i,s,h){if(i.tag===3)Lv(i,i,h);else for(;s!==null;){if(s.tag===3){Lv(s,i,h);break}else if(s.tag===1){var g=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(fr===null||!fr.has(g))){i=In(h,i),h=O_(2),g=ar(s,h,2),g!==null&&(B_(h,g,s,i),qe(g,2),oi(g));break}}s=s.return}}function ud(i,s,h){var g=i.pingCache;if(g===null){g=i.pingCache=new hk;var k=new Set;g.set(s,k)}else k=g.get(s),k===void 0&&(k=new Set,g.set(s,k));k.has(h)||(nd=!0,k.add(h),i=mk.bind(null,i,s,h),s.then(i,i))}function mk(i,s,h){var g=i.pingCache;g!==null&&g.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,_t===i&&(Ke&h)===h&&(Rt===4||Rt===3&&(Ke&62914560)===Ke&&300>Fe()-fc?(ot&2)===0&&Vs(i,0):id|=h,Gs===Ke&&(Gs=0)),oi(i)}function Ov(i,s){s===0&&(s=we()),i=Or(i,s),i!==null&&(qe(i,s),oi(i))}function _k(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),Ov(i,h)}function vk(i,s){var h=0;switch(i.tag){case 31:case 13:var g=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(s),Ov(i,h)}function yk(i,s){return Ge(i,s)}var yc=null,Ws=null,hd=!1,bc=!1,fd=!1,gr=0;function oi(i){i!==Ws&&i.next===null&&(Ws===null?yc=Ws=i:Ws=Ws.next=i),bc=!0,hd||(hd=!0,Sk())}function ho(i,s){if(!fd&&bc){fd=!0;do for(var h=!1,g=yc;g!==null;){if(i!==0){var k=g.pendingLanes;if(k===0)var A=0;else{var I=g.suspendedLanes,W=g.pingedLanes;A=(1<<31-st(42|i)+1)-1,A&=k&~(I&~W),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Hv(g,A))}else A=Ke,A=vi(g,g===_t?A:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(A&3)===0||ni(g,A)||(h=!0,Hv(g,A));g=g.next}while(h);fd=!1}}function bk(){Bv()}function Bv(){bc=hd=!1;var i=0;gr!==0&&Dk()&&(i=gr);for(var s=Fe(),h=null,g=yc;g!==null;){var k=g.next,A=Iv(g,s);A===0?(g.next=null,h===null?yc=k:h.next=k,k===null&&(Ws=h)):(h=g,(i!==0||(A&3)!==0)&&(bc=!0)),g=k}Gt!==0&&Gt!==5||ho(i),gr!==0&&(gr=0)}function Iv(i,s){for(var h=i.suspendedLanes,g=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0<A;){var I=31-st(A),W=1<<I,J=k[I];J===-1?((W&h)===0||(W&g)!==0)&&(k[I]=oe(W,s)):J<=s&&(i.expiredLanes|=W),A&=~W}if(s=_t,h=Ke,h=vi(i,i===s?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,h===0||i===s&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&ct(g),i.callbackNode=null,i.callbackPriority=0;if((h&3)===0||ni(i,h)){if(s=h&-h,s===i.callbackPriority)return s;switch(g!==null&&ct(g),Aa(h)){case 2:case 8:h=de;break;case 32:h=Se;break;case 268435456:h=De;break;default:h=Se}return g=zv.bind(null,i),h=Ge(h,g),i.callbackPriority=s,i.callbackNode=h,s}return g!==null&&g!==null&&ct(g),i.callbackPriority=2,i.callbackNode=null,2}function zv(i,s){if(Gt!==0&&Gt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var h=i.callbackNode;if(vc()&&i.callbackNode!==h)return null;var g=Ke;return g=vi(i,i===_t?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(yv(i,g,s),Iv(i,Fe()),i.callbackNode!=null&&i.callbackNode===h?zv.bind(null,i):null)}function Hv(i,s){if(vc())return null;yv(i,s,!0)}function Sk(){jk(function(){(ot&6)!==0?Ge(ie,bk):Bv()})}function dd(){if(gr===0){var i=js;i===0&&(i=gi,gi<<=1,(gi&261888)===0&&(gi=256)),gr=i}return gr}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Nl(""+i)}function Pv(i,s){var h=s.ownerDocument.createElement("input");return h.name=s.name,h.value=s.value,i.id&&h.setAttribute("form",i.id),s.parentNode.insertBefore(h,s),i=new FormData(i),h.parentNode.removeChild(h),i}function xk(i,s,h,g,k){if(s==="submit"&&h&&h.stateNode===k){var A=Fv((k[Qt]||null).action),I=g.submitter;I&&(s=(s=I[Qt]||null)?Fv(s.formAction):I.getAttribute("formAction"),s!==null&&(A=s,I=null));var W=new Ml("action","action",null,g,k);i.push({event:W,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(gr!==0){var J=I?Pv(k,I):new FormData(k);jf(h,{pending:!0,data:J,method:k.method,action:A},null,J)}}else typeof A=="function"&&(W.preventDefault(),J=I?Pv(k,I):new FormData(k),jf(h,{pending:!0,data:J,method:k.method,action:A},A,J))},currentTarget:k}]})}}for(var pd=0;pd<Xh.length;pd++){var gd=Xh[pd],wk=gd.toLowerCase(),Ck=gd[0].toUpperCase()+gd.slice(1);Vn(wk,"on"+Ck)}Vn(v0,"onAnimationEnd"),Vn(y0,"onAnimationIteration"),Vn(b0,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(FE,"onTransitionRun"),Vn(PE,"onTransitionStart"),Vn(UE,"onTransitionCancel"),Vn(S0,"onTransitionEnd"),Zi("onMouseEnter",["mouseout","mouseover"]),Zi("onMouseLeave",["mouseout","mouseover"]),Zi("onPointerEnter",["pointerout","pointerover"]),Zi("onPointerLeave",["pointerout","pointerover"]),Si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Si("onBeforeInput",["compositionend","keypress","textInput","paste"]),Si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ek=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function Uv(i,s){s=(s&4)!==0;for(var h=0;h<i.length;h++){var g=i[h],k=g.event;g=g.listeners;e:{var A=void 0;if(s)for(var I=g.length-1;0<=I;I--){var W=g[I],J=W.instance,ce=W.currentTarget;if(W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}else for(I=0;I<g.length;I++){if(W=g[I],J=W.instance,ce=W.currentTarget,W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}}}}function We(i,s){var h=s[ms];h===void 0&&(h=s[ms]=new Set);var g=i+"__bubble";h.has(g)||($v(s,i,2,!1),h.add(g))}function md(i,s,h){var g=0;s&&(g|=4),$v(h,i,g,s)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function _d(i){if(!i[Sc]){i[Sc]=!0,wl.forEach(function(h){h!=="selectionchange"&&(Ek.has(h)||md(h,!1,i),md(h,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Sc]||(s[Sc]=!0,md("selectionchange",!1,s))}}function $v(i,s,h,g){switch(vy(s)){case 2:var k=Jk;break;case 8:k=eA;break;default:k=Md}h=k.bind(null,s,h,i),k=void 0,!Bh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(k=!0),g?k!==void 0?i.addEventListener(s,h,{capture:!0,passive:k}):i.addEventListener(s,h,!0):k!==void 0?i.addEventListener(s,h,{passive:k}):i.addEventListener(s,h,!1)}function vd(i,s,h,g,k){var A=g;if((s&1)===0&&(s&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var W=g.stateNode.containerInfo;if(W===k)break;if(I===4)for(I=g.return;I!==null;){var J=I.tag;if((J===3||J===4)&&I.stateNode.containerInfo===k)return;I=I.return}for(;W!==null;){if(I=Yi(W),I===null)return;if(J=I.tag,J===5||J===6||J===26||J===27){g=A=I;continue e}W=W.parentNode}}g=g.return}Wm(function(){var ce=A,me=Lh(h),ve=[];e:{var ue=x0.get(i);if(ue!==void 0){var pe=Ml,Te=i;switch(i){case"keypress":if(Rl(h)===0)break e;case"keydown":case"keyup":pe=vE;break;case"focusin":Te="focus",pe=Fh;break;case"focusout":Te="blur",pe=Fh;break;case"beforeblur":case"afterblur":pe=Fh;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=aE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=SE;break;case v0:case y0:case b0:pe=cE;break;case S0:pe=wE;break;case"scroll":case"scrollend":pe=rE;break;case"wheel":pe=EE;break;case"copy":case"cut":case"paste":pe=hE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Jm;break;case"toggle":case"beforetoggle":pe=AE}var Be=(s&4)!==0,mt=!Be&&(i==="scroll"||i==="scrollend"),se=Be?ue!==null?ue+"Capture":null:ue;Be=[];for(var te=ce,le;te!==null;){var _e=te;if(le=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||le===null||se===null||(_e=La(te,se),_e!=null&&Be.push(po(te,_e,le))),mt)break;te=te.return}0<Be.length&&(ue=new pe(ue,Te,null,h,me),ve.push({event:ue,listeners:Be}))}}if((s&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",ue&&h!==jh&&(Te=h.relatedTarget||h.fromElement)&&(Yi(Te)||Te[bi]))break e;if((pe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,pe?(Te=h.relatedTarget||h.toElement,pe=ce,Te=Te?Yi(Te):null,Te!==null&&(mt=l(Te),Be=Te.tag,Te!==mt||Be!==5&&Be!==27&&Be!==6)&&(Te=null)):(pe=null,Te=ce),pe!==Te)){if(Be=Zm,_e="onMouseLeave",se="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(Be=Jm,_e="onPointerLeave",se="onPointerEnter",te="pointer"),mt=pe==null?ue:Xi(pe),le=Te==null?ue:Xi(Te),ue=new Be(_e,te+"leave",pe,h,me),ue.target=mt,ue.relatedTarget=le,_e=null,Yi(me)===ce&&(Be=new Be(se,te+"enter",Te,h,me),Be.target=le,Be.relatedTarget=mt,_e=Be),mt=_e,pe&&Te)t:{for(Be=kk,se=pe,te=Te,le=0,_e=se;_e;_e=Be(_e))le++;_e=0;for(var Le=te;Le;Le=Be(Le))_e++;for(;0<le-_e;)se=Be(se),le--;for(;0<_e-le;)te=Be(te),_e--;for(;le--;){if(se===te||te!==null&&se===te.alternate){Be=se;break t}se=Be(se),te=Be(te)}Be=null}else Be=null;pe!==null&&Gv(ve,ue,pe,Be,!1),Te!==null&&mt!==null&&Gv(ve,mt,Te,Be,!0)}}e:{if(ue=ce?Xi(ce):window,pe=ue.nodeName&&ue.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ue.type==="file")var nt=o0;else if(s0(ue))if(l0)nt=IE;else{nt=OE;var Re=LE}else pe=ue.nodeName,!pe||pe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Mh(ce.elementType)&&(nt=o0):nt=BE;if(nt&&(nt=nt(i,ce))){a0(ve,nt,h,me);break e}Re&&Re(i,ue,ce),i==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Ma(ue,"number",ue.value)}switch(Re=ce?Xi(ce):window,i){case"focusin":(s0(Re)||Re.contentEditable==="true")&&(Es=Re,Vh=ce,Ua=null);break;case"focusout":Ua=Vh=Es=null;break;case"mousedown":Yh=!0;break;case"contextmenu":case"mouseup":case"dragend":Yh=!1,m0(ve,h,me);break;case"selectionchange":if(HE)break;case"keydown":case"keyup":m0(ve,h,me)}var Ue;if(Uh)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Cs?i0(i,h)&&(Ze="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ze="onCompositionStart");Ze&&(e0&&h.locale!=="ko"&&(Cs||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Cs&&(Ue=Xm()):(Ji=me,Ih="value"in Ji?Ji.value:Ji.textContent,Cs=!0)),Re=xc(ce,Ze),0<Re.length&&(Ze=new Qm(Ze,i,null,h,me),ve.push({event:Ze,listeners:Re}),Ue?Ze.data=Ue:(Ue=r0(h),Ue!==null&&(Ze.data=Ue)))),(Ue=TE?RE(i,h):DE(i,h))&&(Ze=xc(ce,"onBeforeInput"),0<Ze.length&&(Re=new Qm("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:Ze}),Re.data=Ue)),xk(ve,i,ce,h,me)}Uv(ve,s)})}function po(i,s,h){return{instance:i,listener:s,currentTarget:h}}function xc(i,s){for(var h=s+"Capture",g=[];i!==null;){var k=i,A=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||A===null||(k=La(i,h),k!=null&&g.unshift(po(i,k,A)),k=La(i,s),k!=null&&g.push(po(i,k,A))),i.tag===3)return g;i=i.return}return[]}function kk(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gv(i,s,h,g,k){for(var A=s._reactName,I=[];h!==null&&h!==g;){var W=h,J=W.alternate,ce=W.stateNode;if(W=W.tag,J!==null&&J===g)break;W!==5&&W!==26&&W!==27||ce===null||(J=ce,k?(ce=La(h,A),ce!=null&&I.unshift(po(h,ce,J))):k||(ce=La(h,A),ce!=null&&I.push(po(h,ce,J)))),h=h.return}I.length!==0&&i.push({event:s,listeners:I})}var Ak=/\r\n?/g,Nk=/\u0000|\uFFFD/g;function qv(i){return(typeof i=="string"?i:""+i).replace(Ak,` +`).replace(Nk,"")}function Vv(i,s){return s=qv(s),qv(i)===s}function gt(i,s,h,g,k,A){switch(h){case"children":typeof g=="string"?s==="body"||s==="textarea"&&g===""||Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&s!=="body"&&Ss(i,""+g);break;case"className":vs(i,"class",g);break;case"tabIndex":vs(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,h,g);break;case"style":Vm(i,g,A);break;case"data":if(s!=="object"){vs(i,"data",g);break}case"src":case"href":if(g===""&&(s!=="a"||h!=="href")){i.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(h==="formAction"?(s!=="input"&>(i,s,"name",k.name,k,null),gt(i,s,"formEncType",k.formEncType,k,null),gt(i,s,"formMethod",k.formMethod,k,null),gt(i,s,"formTarget",k.formTarget,k,null)):(gt(i,s,"encType",k.encType,k,null),gt(i,s,"method",k.method,k,null),gt(i,s,"target",k.target,k,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"onClick":g!=null&&(i.onclick=xi);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}h=Nl(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""+g):i.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""):i.removeAttribute(h);break;case"capture":case"download":g===!0?i.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,g):i.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(h,g):i.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(h):i.setAttribute(h,g);break;case"popover":We("beforetoggle",i),We("toggle",i),_s(i,"popover",g);break;case"xlinkActuate":qn(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":qn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":qn(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":qn(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":qn(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":qn(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":qn(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":qn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":qn(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":_s(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=nE.get(h)||h,_s(i,h,g))}}function yd(i,s,h,g,k,A){switch(h){case"style":Vm(i,g,A);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"children":typeof g=="string"?Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&Ss(i,""+g);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"onClick":g!=null&&(i.onclick=xi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cl.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(k=h.endsWith("Capture"),s=h.slice(2,k?h.length-7:void 0),A=i[Qt]||null,A=A!=null?A[h]:null,typeof A=="function"&&i.removeEventListener(s,A,k),typeof g=="function")){typeof A!="function"&&A!==null&&(h in i?i[h]=null:i.hasAttribute(h)&&i.removeAttribute(h)),i.addEventListener(s,g,k);break e}h in i?i[h]=g:g===!0?i.setAttribute(h,""):_s(i,h,g)}}}function Zt(i,s,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var g=!1,k=!1,A;for(A in h)if(h.hasOwnProperty(A)){var I=h[A];if(I!=null)switch(A){case"src":g=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,A,I,h,null)}}k&>(i,s,"srcSet",h.srcSet,h,null),g&>(i,s,"src",h.src,h,null);return;case"input":We("invalid",i);var W=A=I=k=null,J=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":k=me;break;case"type":I=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":A=me;break;case"defaultValue":W=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:gt(i,s,g,me,h,null)}}bs(i,A,W,J,ce,I,k,!1);return;case"select":We("invalid",i),g=I=A=null;for(k in h)if(h.hasOwnProperty(k)&&(W=h[k],W!=null))switch(k){case"value":A=W;break;case"defaultValue":I=W;break;case"multiple":g=W;default:gt(i,s,k,W,h,null)}s=A,h=I,i.multiple=!!g,s!=null?Qi(i,!!g,s,!1):h!=null&&Qi(i,!!g,h,!0);return;case"textarea":We("invalid",i),A=k=g=null;for(I in h)if(h.hasOwnProperty(I)&&(W=h[I],W!=null))switch(I){case"value":g=W;break;case"defaultValue":k=W;break;case"children":A=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:gt(i,s,I,W,h,null)}Gm(i,g,k,A);return;case"option":for(J in h)if(h.hasOwnProperty(J)&&(g=h[J],g!=null))switch(J){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:gt(i,s,J,g,h,null)}return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(g=0;g<fo.length;g++)We(fo[g],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,ce,g,h,null)}return;default:if(Mh(s)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&yd(i,s,me,g,h,void 0));return}}for(W in h)h.hasOwnProperty(W)&&(g=h[W],g!=null&>(i,s,W,g,h,null))}function Tk(i,s,h,g){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,A=null,I=null,W=null,J=null,ce=null,me=null;for(pe in h){var ve=h[pe];if(h.hasOwnProperty(pe)&&ve!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":J=ve;default:g.hasOwnProperty(pe)||gt(i,s,pe,null,g,ve)}}for(var ue in g){var pe=g[ue];if(ve=h[ue],g.hasOwnProperty(ue)&&(pe!=null||ve!=null))switch(ue){case"type":A=pe;break;case"name":k=pe;break;case"checked":ce=pe;break;case"defaultChecked":me=pe;break;case"value":I=pe;break;case"defaultValue":W=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,s));break;default:pe!==ve&>(i,s,ue,pe,g,ve)}}Da(i,I,W,J,ce,me,A,k);return;case"select":pe=I=W=ue=null;for(A in h)if(J=h[A],h.hasOwnProperty(A)&&J!=null)switch(A){case"value":break;case"multiple":pe=J;default:g.hasOwnProperty(A)||gt(i,s,A,null,g,J)}for(k in g)if(A=g[k],J=h[k],g.hasOwnProperty(k)&&(A!=null||J!=null))switch(k){case"value":ue=A;break;case"defaultValue":W=A;break;case"multiple":I=A;default:A!==J&>(i,s,k,A,g,J)}s=W,h=I,g=pe,ue!=null?Qi(i,!!h,ue,!1):!!g!=!!h&&(s!=null?Qi(i,!!h,s,!0):Qi(i,!!h,h?[]:"",!1));return;case"textarea":pe=ue=null;for(W in h)if(k=h[W],h.hasOwnProperty(W)&&k!=null&&!g.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:gt(i,s,W,null,g,k)}for(I in g)if(k=g[I],A=h[I],g.hasOwnProperty(I)&&(k!=null||A!=null))switch(I){case"value":ue=k;break;case"defaultValue":pe=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==A&>(i,s,I,k,g,A)}ja(i,ue,pe);return;case"option":for(var Te in h)if(ue=h[Te],h.hasOwnProperty(Te)&&ue!=null&&!g.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,s,Te,null,g,ue)}for(J in g)if(ue=g[J],pe=h[J],g.hasOwnProperty(J)&&ue!==pe&&(ue!=null||pe!=null))switch(J){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:gt(i,s,J,ue,g,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in h)ue=h[Be],h.hasOwnProperty(Be)&&ue!=null&&!g.hasOwnProperty(Be)&>(i,s,Be,null,g,ue);for(ce in g)if(ue=g[ce],pe=h[ce],g.hasOwnProperty(ce)&&ue!==pe&&(ue!=null||pe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:gt(i,s,ce,ue,g,pe)}return;default:if(Mh(s)){for(var mt in h)ue=h[mt],h.hasOwnProperty(mt)&&ue!==void 0&&!g.hasOwnProperty(mt)&&yd(i,s,mt,void 0,g,ue);for(me in g)ue=g[me],pe=h[me],!g.hasOwnProperty(me)||ue===pe||ue===void 0&&pe===void 0||yd(i,s,me,ue,g,pe);return}}for(var se in h)ue=h[se],h.hasOwnProperty(se)&&ue!=null&&!g.hasOwnProperty(se)&>(i,s,se,null,g,ue);for(ve in g)ue=g[ve],pe=h[ve],!g.hasOwnProperty(ve)||ue===pe||ue==null&&pe==null||gt(i,s,ve,ue,g,pe)}function Yv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rk(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var k=h[g],A=k.transferSize,I=k.initiatorType,W=k.duration;if(A&&W&&Yv(I)){for(I=0,W=k.responseEnd,g+=1;g<h.length;g++){var J=h[g],ce=J.startTime;if(ce>W)break;var me=J.transferSize,ve=J.initiatorType;me&&Yv(ve)&&(J=J.responseEnd,I+=me*(J<W?1:(W-ce)/(J-ce)))}if(--g,s+=8*(A+I)/(k.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var bd=null,Sd=null;function wc(i){return i.nodeType===9?i:i.ownerDocument}function Wv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function xd(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wd=null;function Dk(){var i=window.event;return i&&i.type==="popstate"?i===wd?!1:(wd=i,!0):(wd=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,Mk=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,jk=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(i){return Zv.resolve(null).then(i).catch(Lk)}:Kv;function Lk(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Qv(i,s){var h=s,g=0;do{var k=h.nextSibling;if(i.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"||h==="/&"){if(g===0){i.removeChild(k),Qs(s);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")go(i.ownerDocument.documentElement);else if(h==="head"){h=i.ownerDocument.head,go(h);for(var A=h.firstChild;A;){var I=A.nextSibling,W=A.nodeName;A[Rr]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&A.rel.toLowerCase()==="stylesheet"||h.removeChild(A),A=I}}else h==="body"&&go(i.ownerDocument.body);h=k}while(h);Qs(s)}function Jv(i,s){var h=i;i=0;do{var g=h.nextSibling;if(h.nodeType===1?s?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(s?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(i===0)break;i--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||i++;h=g}while(h)}function Cd(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var h=s;switch(s=s.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Cd(h),Na(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}i.removeChild(h)}}function Ok(i,s,h,g){for(;i.nodeType===1;){var k=h;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Rr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(A=i.getAttribute("rel"),A==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(A!==k.rel||i.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||i.getAttribute("title")!==(k.title==null?null:k.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(A=i.getAttribute("src"),(A!==(k.src==null?null:k.src)||i.getAttribute("type")!==(k.type==null?null:k.type)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&A&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var A=k.name==null?null:""+k.name;if(k.type==="hidden"&&i.getAttribute("name")===A)return i}else return i;if(i=Un(i.nextSibling),i===null)break}return null}function Bk(i,s,h){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!h||(i=Un(i.nextSibling),i===null))return null;return i}function ey(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Un(i.nextSibling),i===null))return null;return i}function Ed(i){return i.data==="$?"||i.data==="$~"}function kd(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Ik(i,s){var h=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||h.readyState!=="loading")s();else{var g=function(){s(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Un(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Ad=null;function ty(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"||h==="/&"){if(s===0)return Un(i.nextSibling);s--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||s++}i=i.nextSibling}return null}function ny(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(s===0)return i;s--}else h!=="/$"&&h!=="/&"||s++}i=i.previousSibling}return null}function iy(i,s,h){switch(s=wc(h),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function go(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Na(i)}var $n=new Map,ry=new Set;function Cc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var zi=X.d;X.d={f:zk,r:Hk,D:Fk,C:Pk,L:Uk,m:$k,X:qk,S:Gk,M:Vk};function zk(){var i=zi.f(),s=gc();return i||s}function Hk(i){var s=Wi(i);s!==null&&s.tag===5&&s.type==="form"?S_(s):zi.r(i)}var Xs=typeof document>"u"?null:document;function sy(i,s,h){var g=Xs;if(g&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),ry.has(k)||(ry.add(k),i={rel:i,crossOrigin:h,href:s},g.querySelector(k)===null&&(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Fk(i){zi.D(i),sy("dns-prefetch",i,null)}function Pk(i,s){zi.C(i,s),sy("preconnect",i,s)}function Uk(i,s,h){zi.L(i,s,h);var g=Xs;if(g&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=Ks(i);break;case"script":A=Zs(i)}$n.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),$n.set(A,i),g.querySelector(k)!==null||s==="style"&&g.querySelector(mo(A))||s==="script"&&g.querySelector(_o(A))||(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function $k(i,s){zi.m(i,s);var h=Xs;if(h&&i){var g=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(g)+'"][href="'+on(i)+'"]',A=k;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Zs(i)}if(!$n.has(A)&&(i=d({rel:"modulepreload",href:i},s),$n.set(A,i),h.querySelector(k)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(_o(A)))return}g=h.createElement("link"),Zt(g,"link",i),Lt(g),h.head.appendChild(g)}}}function Gk(i,s,h){zi.S(i,s,h);var g=Xs;if(g&&i){var k=Ki(g).hoistableStyles,A=Ks(i);s=s||"default";var I=k.get(A);if(!I){var W={loading:0,preload:null};if(I=g.querySelector(mo(A)))W.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=$n.get(A))&&Nd(i,h);var J=I=g.createElement("link");Lt(J),Zt(J,"link",i),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){W.loading|=1}),J.addEventListener("error",function(){W.loading|=2}),W.loading|=4,Ec(I,s,g)}I={type:"stylesheet",instance:I,count:1,state:W},k.set(A,I)}}}function qk(i,s){zi.X(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function Vk(i,s){zi.M(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function ay(i,s,h,g){var k=(k=ae.current)?Cc(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=Ks(h.href),h=Ki(k).hoistableStyles,g=h.get(s),g||(g={type:"style",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Ks(h.href);var A=Ki(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(mo(i)))&&!A._p&&(I.instance=A,I.state.loading=5),$n.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},$n.set(i,h),A||Yk(k,i,h,I.state))),s&&g===null)throw Error(r(528,""));return I}if(s&&g!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Zs(h),h=Ki(k).hoistableScripts,g=h.get(s),g||(g={type:"script",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+on(i)+'"'}function mo(i){return'link[rel="stylesheet"]['+i+"]"}function oy(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function Yk(i,s,h,g){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?g.loading=1:(s=i.createElement("link"),g.preload=s,s.addEventListener("load",function(){return g.loading|=1}),s.addEventListener("error",function(){return g.loading|=2}),Zt(s,"link",h),Lt(s),i.head.appendChild(s))}function Zs(i){return'[src="'+on(i)+'"]'}function _o(i){return"script[async]"+i}function ly(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var g=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(g)return s.instance=g,Lt(g),g;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Lt(g),Zt(g,"style",k),Ec(g,h.precedence,i),s.instance=g;case"stylesheet":k=Ks(h.href);var A=i.querySelector(mo(k));if(A)return s.state.loading|=4,s.instance=A,Lt(A),A;g=oy(h),(k=$n.get(k))&&Nd(g,k),A=(i.ownerDocument||i).createElement("link"),Lt(A);var I=A;return I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),s.state.loading|=4,Ec(A,h.precedence,i),s.instance=A;case"script":return A=Zs(h.src),(k=i.querySelector(_o(A)))?(s.instance=k,Lt(k),k):(g=h,(k=$n.get(A))&&(g=d({},h),Td(g,k)),i=i.ownerDocument||i,k=i.createElement("script"),Lt(k),Zt(k,"link",g),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(g=s.instance,s.state.loading|=4,Ec(g,h.precedence,i));return s.instance}function Ec(i,s,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=g.length?g[g.length-1]:null,A=k,I=0;I<g.length;I++){var W=g[I];if(W.dataset.precedence===s)A=W;else if(A!==k)break}A?A.parentNode.insertBefore(i,A.nextSibling):(s=h.nodeType===9?h.head:h,s.insertBefore(i,s.firstChild))}function Nd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Td(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var kc=null;function cy(i,s,h){if(kc===null){var g=new Map,k=kc=new Map;k.set(h,g)}else k=kc,g=k.get(h),g||(g=new Map,k.set(h,g));if(g.has(i))return g;for(g.set(i,null),h=h.getElementsByTagName(i),k=0;k<h.length;k++){var A=h[k];if(!(A[Rr]||A[$t]||i==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(s)||"";I=i+I;var W=g.get(I);W?W.push(A):g.set(I,[A])}}return g}function uy(i,s,h){i=i.ownerDocument||i,i.head.insertBefore(h,s==="title"?i.querySelector("head > title"):null)}function Wk(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function hy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Xk(i,s,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=Ks(g.href),A=s.querySelector(mo(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ac.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Lt(A);return}A=s.ownerDocument||s,g=oy(g),(k=$n.get(k))&&Nd(g,k),A=A.createElement("link"),Lt(A);var I=A;I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Ac.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Rd=0;function Kk(i,s){return i.stylesheets&&i.count===0&&Tc(i,i.stylesheets),0<i.count||0<i.imgCount?function(h){var g=setTimeout(function(){if(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend){var A=i.unsuspend;i.unsuspend=null,A()}},6e4+s);0<i.imgBytes&&Rd===0&&(Rd=62500*Rk());var k=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend)){var A=i.unsuspend;i.unsuspend=null,A()}},(i.imgBytes>Rd?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(k)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Nc=null;function Tc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Nc=new Map,s.forEach(Zk,i),Nc=null,Ac.call(i))}function Zk(i,s){if(!(s.state.loading&4)){var h=Nc.get(i);if(h)var g=h.get(null);else{h=new Map,Nc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<k.length;A++){var I=k[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(h.set(I.dataset.precedence,I),g=I)}g&&h.set(null,g)}k=s.instance,I=k.getAttribute("data-precedence"),A=h.get(I)||g,A===g&&h.set(null,k),h.set(I,k),this.count++,g=Ac.bind(this),k.addEventListener("load",g),k.addEventListener("error",g),A?A.parentNode.insertBefore(k,A.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(k,i.firstChild)),s.state.loading|=4}}var vo={$$typeof:y,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Qk(i,s,h,g,k,A,I,W,J){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=g,this.onUncaughtError=k,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function fy(i,s,h,g,k,A,I,W,J,ce,me,ve){return i=new Qk(i,s,h,I,J,ce,me,ve,W),s=1,A===!0&&(s|=24),A=bn(3,null,null,s),i.current=A,A.stateNode=i,s=cf(),s.refCount++,i.pooledCache=s,s.refCount++,A.memoizedState={element:g,isDehydrated:h,cache:s},df(A),i}function dy(i){return i?(i=Ns,i):Ns}function py(i,s,h,g,k,A){k=dy(k),g.context===null?g.context=k:g.pendingContext=k,g=sr(s),g.payload={element:h},A=A===void 0?null:A,A!==null&&(g.callback=A),h=ar(i,g,s),h!==null&&(dn(h,i,s),Xa(h,i,s))}function gy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<s?h:s}}function Dd(i,s){gy(i,s),(i=i.alternate)&&gy(i,s)}function my(i){if(i.tag===13||i.tag===31){var s=Or(i,67108864);s!==null&&dn(s,i,67108864),Dd(i,67108864)}}function _y(i){if(i.tag===13||i.tag===31){var s=En();s=ka(s);var h=Or(i,s);h!==null&&dn(h,i,s),Dd(i,s)}}var Rc=!0;function Jk(i,s,h,g){var k=q.T;q.T=null;var A=X.p;try{X.p=2,Md(i,s,h,g)}finally{X.p=A,q.T=k}}function eA(i,s,h,g){var k=q.T;q.T=null;var A=X.p;try{X.p=8,Md(i,s,h,g)}finally{X.p=A,q.T=k}}function Md(i,s,h,g){if(Rc){var k=jd(g);if(k===null)vd(i,s,g,Dc,h),yy(i,g);else if(nA(k,i,s,h,g))g.stopPropagation();else if(yy(i,g),s&4&&-1<tA.indexOf(i)){for(;k!==null;){var A=Wi(k);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=On(A.pendingLanes);if(I!==0){var W=A;for(W.pendingLanes|=2,W.entangledLanes|=2;I;){var J=1<<31-st(I);W.entanglements[1]|=J,I&=~J}oi(A),(ot&6)===0&&(dc=Fe()+500,ho(0))}}break;case 31:case 13:W=Or(A,2),W!==null&&dn(W,A,2),gc(),Dd(A,2)}if(A=jd(g),A===null&&vd(i,s,g,Dc,h),A===k)break;k=A}k!==null&&g.stopPropagation()}else vd(i,s,g,null,h)}}function jd(i){return i=Lh(i),Ld(i)}var Dc=null;function Ld(i){if(Dc=null,i=Yi(i),i!==null){var s=l(i);if(s===null)i=null;else{var h=s.tag;if(h===13){if(i=u(s),i!==null)return i;i=null}else if(h===31){if(i=o(s),i!==null)return i;i=null}else if(h===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dc=i,null}function vy(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case ie:return 2;case de:return 8;case Se:case Ae:return 32;case De:return 268435456;default:return 32}default:return 32}}var Od=!1,_r=null,vr=null,yr=null,yo=new Map,bo=new Map,br=[],tA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yy(i,s){switch(i){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":yo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(s.pointerId)}}function So(i,s,h,g,k,A){return i===null||i.nativeEvent!==A?(i={blockedOn:s,domEventName:h,eventSystemFlags:g,nativeEvent:A,targetContainers:[k]},s!==null&&(s=Wi(s),s!==null&&my(s)),i):(i.eventSystemFlags|=g,s=i.targetContainers,k!==null&&s.indexOf(k)===-1&&s.push(k),i)}function nA(i,s,h,g,k){switch(s){case"focusin":return _r=So(_r,i,s,h,g,k),!0;case"dragenter":return vr=So(vr,i,s,h,g,k),!0;case"mouseover":return yr=So(yr,i,s,h,g,k),!0;case"pointerover":var A=k.pointerId;return yo.set(A,So(yo.get(A)||null,i,s,h,g,k)),!0;case"gotpointercapture":return A=k.pointerId,bo.set(A,So(bo.get(A)||null,i,s,h,g,k)),!0}return!1}function by(i){var s=Yi(i.target);if(s!==null){var h=l(s);if(h!==null){if(s=h.tag,s===13){if(s=u(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===31){if(s=o(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var h=jd(i.nativeEvent);if(h===null){h=i.nativeEvent;var g=new h.constructor(h.type,h);jh=g,h.target.dispatchEvent(g),jh=null}else return s=Wi(h),s!==null&&my(s),i.blockedOn=h,!1;s.shift()}return!0}function Sy(i,s,h){Mc(i)&&h.delete(s)}function iA(){Od=!1,_r!==null&&Mc(_r)&&(_r=null),vr!==null&&Mc(vr)&&(vr=null),yr!==null&&Mc(yr)&&(yr=null),yo.forEach(Sy),bo.forEach(Sy)}function jc(i,s){i.blockedOn===s&&(i.blockedOn=null,Od||(Od=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iA)))}var Lc=null;function xy(i){Lc!==i&&(Lc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lc===i&&(Lc=null);for(var s=0;s<i.length;s+=3){var h=i[s],g=i[s+1],k=i[s+2];if(typeof g!="function"){if(Ld(g||h)===null)continue;break}var A=Wi(h);A!==null&&(i.splice(s,3),s-=3,jf(A,{pending:!0,data:k,method:h.method,action:g},g,k))}}))}function Qs(i){function s(J){return jc(J,i)}_r!==null&&jc(_r,i),vr!==null&&jc(vr,i),yr!==null&&jc(yr,i),yo.forEach(s),bo.forEach(s);for(var h=0;h<br.length;h++){var g=br[h];g.blockedOn===i&&(g.blockedOn=null)}for(;0<br.length&&(h=br[0],h.blockedOn===null);)by(h),h.blockedOn===null&&br.shift();if(h=(i.ownerDocument||i).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var k=h[g],A=h[g+1],I=k[Qt]||null;if(typeof A=="function")I||xy(h);else if(I){var W=null;if(A&&A.hasAttribute("formAction")){if(k=A,I=A[Qt]||null)W=I.formAction;else if(Ld(k)!==null)continue}else W=I.action;typeof W=="function"?h[g+1]=W:(h.splice(g,3),g-=3),xy(h)}}}function wy(){function i(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return k=I})},focusReset:"manual",scroll:"manual"})}function s(){k!==null&&(k(),k=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,k=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),k!==null&&(k(),k=null)}}}function Bd(i){this._internalRoot=i}Oc.prototype.render=Bd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var h=s.current,g=En();py(h,g,i,s,null,null)},Oc.prototype.unmount=Bd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;py(i.current,2,null,i,null,null),gc(),s[bi]=null}};function Oc(i){this._internalRoot=i}Oc.prototype.unstable_scheduleHydration=function(i){if(i){var s=yl();i={blockedOn:null,target:i,priority:s};for(var h=0;h<br.length&&s!==0&&s<br[h].priority;h++);br.splice(h,0,i),h===0&&by(i)}};var Cy=t.version;if(Cy!=="19.2.7")throw Error(r(527,Cy,"19.2.7"));X.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var rA={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{Nt=Bc.inject(rA),Ct=Bc}catch{}}return wo.createRoot=function(i,s){if(!a(i))throw Error(r(299));var h=!1,g="",k=D_,A=M_,I=j_;return s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(k=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(I=s.onRecoverableError)),s=fy(i,1,!1,null,null,h,g,null,k,A,I,wy),i[bi]=s.current,_d(i),new Bd(s)},wo.hydrateRoot=function(i,s,h){if(!a(i))throw Error(r(299));var g=!1,k="",A=D_,I=M_,W=j_,J=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onUncaughtError!==void 0&&(A=h.onUncaughtError),h.onCaughtError!==void 0&&(I=h.onCaughtError),h.onRecoverableError!==void 0&&(W=h.onRecoverableError),h.formState!==void 0&&(J=h.formState)),s=fy(i,1,!0,s,h??null,g,k,J,A,I,W,wy),s.context=dy(null),h=s.current,g=En(),g=ka(g),k=sr(g),k.callback=null,ar(h,k,g),h=g,s.current.lanes=h,qe(s,h),oi(s),i[bi]=s.current,_d(i),new Oc(s)},wo.version="19.2.7",wo}var Ly;function pA(){if(Ly)return Hd.exports;Ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hd.exports=dA(),Hd.exports}var gA=pA();/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** - * @license lucide-react v1.24.0 - ISC + */const HS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v1.24.0 - ISC + */const mA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** - * @license lucide-react v1.24.0 - ISC + */const _A=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oy=e=>{const t=SA(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** - * @license lucide-react v1.24.0 - ISC + */const Oy=e=>{const t=_A(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var $d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v1.24.0 - ISC + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},wA=q.createContext({}),CA=()=>q.useContext(wA),EA=q.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:_="currentColor",className:v=""}=CA()??{},w=r??d?Number(n??p)*24/Number(t??f):n??p;return q.createElement("svg",{ref:c,...$d,width:t??f??$d.width,height:t??f??$d.height,stroke:e??_,strokeWidth:w,className:PS("lucide",v,a),...!l&&!xA(o)&&{"aria-hidden":"true"},...o},[...u.map(([C,b])=>q.createElement(C,b)),...Array.isArray(l)?l:[l]])});/** - * @license lucide-react v1.24.0 - ISC + */const vA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},yA=V.createContext({}),bA=()=>V.useContext(yA),SA=V.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:_="currentColor",className:v=""}=bA()??{},w=r??d?Number(n??p)*24/Number(t??f):n??p;return V.createElement("svg",{ref:c,...$d,width:t??f??$d.width,height:t??f??$d.height,stroke:e??_,strokeWidth:w,className:HS("lucide",v,a),...!l&&!vA(o)&&{"aria-hidden":"true"},...o},[...u.map(([C,b])=>V.createElement(C,b)),...Array.isArray(l)?l:[l]])});/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $e=(e,t)=>{const n=q.forwardRef(({className:r,...a},l)=>q.createElement(EA,{ref:l,iconNode:t,className:PS(`lucide-${bA(Oy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Oy(e),n};/** - * @license lucide-react v1.24.0 - ISC + */const $e=(e,t)=>{const n=V.forwardRef(({className:r,...a},l)=>V.createElement(SA,{ref:l,iconNode:t,className:HS(`lucide-${mA(Oy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Oy(e),n};/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jo=$e("arrow-left",kA);/** - * @license lucide-react v1.24.0 - ISC + */const xA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jo=$e("arrow-left",xA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ic=$e("arrow-right",AA);/** - * @license lucide-react v1.24.0 - ISC + */const wA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ic=$e("arrow-right",wA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],TA=$e("blocks",NA);/** - * @license lucide-react v1.24.0 - ISC + */const CA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],EA=$e("blocks",CA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RA=[["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"}]],DA=$e("boxes",RA);/** - * @license lucide-react v1.24.0 - ISC + */const kA=[["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"}]],AA=$e("boxes",kA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_n=$e("check",MA);/** - * @license lucide-react v1.24.0 - ISC + */const NA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_n=$e("check",NA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cs=$e("chevron-down",jA);/** - * @license lucide-react v1.24.0 - ISC + */const TA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cs=$e("chevron-down",TA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=$e("chevron-right",LA);/** - * @license lucide-react v1.24.0 - ISC + */const RA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=$e("chevron-right",RA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],BA=$e("circle-stop",OA);/** - * @license lucide-react v1.24.0 - ISC + */const DA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],MA=$e("circle-stop",DA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],zA=$e("cloud",IA);/** - * @license lucide-react v1.24.0 - ISC + */const jA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],LA=$e("cloud",jA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],FA=$e("code",HA);/** - * @license lucide-react v1.24.0 - ISC + */const OA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],BA=$e("code",OA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yg=$e("copy",PA);/** - * @license lucide-react v1.24.0 - ISC + */const IA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yg=$e("copy",IA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],US=$e("corner-down-left",UA);/** - * @license lucide-react v1.24.0 - ISC + */const zA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],FS=$e("corner-down-left",zA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $A=[["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"}]],GA=$e("cpu",$A);/** - * @license lucide-react v1.24.0 - ISC + */const HA=[["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"}]],FA=$e("cpu",HA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],VA=$e("ellipsis",qA);/** - * @license lucide-react v1.24.0 - ISC + */const PA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],UA=$e("ellipsis",PA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YA=[["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"}]],$S=$e("external-link",YA);/** - * @license lucide-react v1.24.0 - ISC + */const $A=[["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"}]],PS=$e("external-link",$A);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],GS=$e("file-code",WA);/** - * @license lucide-react v1.24.0 - ISC + */const GA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],US=$e("file-code",GA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],KA=$e("file-text",XA);/** - * @license lucide-react v1.24.0 - ISC + */const qA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],VA=$e("file-text",qA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],QA=$e("file",ZA);/** - * @license lucide-react v1.24.0 - ISC + */const YA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],WA=$e("file",YA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JA=[["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"}]],eN=$e("flask-conical",JA);/** - * @license lucide-react v1.24.0 - ISC + */const XA=[["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"}]],KA=$e("flask-conical",XA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tN=[["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"}]],qS=$e("folder-open",tN);/** - * @license lucide-react v1.24.0 - ISC + */const ZA=[["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"}]],$S=$e("folder-open",ZA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nN=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],VS=$e("folder-tree",nN);/** - * @license lucide-react v1.24.0 - ISC + */const QA=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],GS=$e("folder-tree",QA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iN=[["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"}]],rN=$e("folder",iN);/** - * @license lucide-react v1.24.0 - ISC + */const JA=[["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"}]],eN=$e("folder",JA);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],$u=$e("git-branch",sN);/** - * @license lucide-react v1.24.0 - ISC + */const tN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],$u=$e("git-branch",tN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],oN=$e("hard-drive",aN);/** - * @license lucide-react v1.24.0 - ISC + */const nN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],iN=$e("hard-drive",nN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cN=$e("info",lN);/** - * @license lucide-react v1.24.0 - ISC + */const rN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sN=$e("info",rN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],hN=$e("laptop",uN);/** - * @license lucide-react v1.24.0 - ISC + */const aN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],oN=$e("laptop",aN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fN=[["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"}]],dN=$e("lock",fN);/** - * @license lucide-react v1.24.0 - ISC + */const lN=[["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"}]],cN=$e("lock",lN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],gN=$e("maximize-2",pN);/** - * @license lucide-react v1.24.0 - ISC + */const uN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],hN=$e("maximize-2",uN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],_N=$e("minimize-2",mN);/** - * @license lucide-react v1.24.0 - ISC + */const fN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],dN=$e("minimize-2",fN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],YS=$e("panel-left",vN);/** - * @license lucide-react v1.24.0 - ISC + */const pN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],qS=$e("panel-left",pN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bg=$e("plus",yN);/** - * @license lucide-react v1.24.0 - ISC + */const gN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bg=$e("plus",gN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bN=[["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"}]],Su=$e("refresh-cw",bN);/** - * @license lucide-react v1.24.0 - ISC + */const mN=[["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"}]],Su=$e("refresh-cw",mN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SN=[["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"}]],Sg=$e("rotate-cw",SN);/** - * @license lucide-react v1.24.0 - ISC + */const _N=[["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"}]],Sg=$e("rotate-cw",_N);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],WS=$e("scroll-text",xN);/** - * @license lucide-react v1.24.0 - ISC + */const vN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],VS=$e("scroll-text",vN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ap=$e("server",wN);/** - * @license lucide-react v1.24.0 - ISC + */const yN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ap=$e("server",yN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CN=[["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"}]],EN=$e("sliders-horizontal",CN);/** - * @license lucide-react v1.24.0 - ISC + */const bN=[["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"}]],SN=$e("sliders-horizontal",bN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kN=[["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"}]],AN=$e("square-terminal",kN);/** - * @license lucide-react v1.24.0 - ISC + */const xN=[["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"}]],wN=$e("square-terminal",xN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],XS=$e("terminal",NN);/** - * @license lucide-react v1.24.0 - ISC + */const CN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],YS=$e("terminal",CN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TN=[["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"}]],Gu=$e("trash-2",TN);/** - * @license lucide-react v1.24.0 - ISC + */const EN=[["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"}]],Gu=$e("trash-2",EN);/** + * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fo=$e("x",RN);async function us(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const ut=e=>fetch(e).then(t=>us(t)),Dt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>us(n)),KS=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>us(n)),DN=()=>ut("/api/projects").then(e=>e.projects),MN=e=>Dt("/api/projects",e).then(t=>t.project),jN=e=>ut(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),LN=e=>ut(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),ON=e=>Dt(`/api/projects/${e}/open`).then(t=>t.project),BN=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),IN=e=>ut(`/api/projects/${e}/experiments`).then(t=>t.experiments),zN=e=>ut(`/api/projects/${e}/runs`).then(t=>t.runs),HN=()=>ut("/api/instances").then(e=>e.instances),ZS=e=>Dt(`/api/runs/${e}/cancel`),FN=(e,t)=>ut(`/api/runs/${e}/log?offset=${t}`),PN=e=>ut(`/api/experiments/${e}/commits`).then(t=>t.commits),UN=(e,t)=>ut(`/api/experiments/${e}/commits/${t}/diff`),By=e=>ut(`/api/projects/${e}/working-tree`),QS=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),$N=(e,t,n={})=>ut(`/api/projects/${e}/file?${QS(n,new URLSearchParams({path:t}))}`),GN=(e,t={})=>{const n=QS(t).toString();return ut(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},xg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,qN=()=>ut("/api/settings/hf"),VN=e=>Dt("/api/settings/hf",{token:e}),YN=()=>ut("/api/settings/k8s"),WN=e=>Dt("/api/settings/k8s",e),XN=()=>ut("/api/settings/modal"),KN=()=>Dt("/api/settings/modal/provision"),ZN=()=>ut("/api/settings/env").then(e=>e.vars),JS=(e,t)=>Dt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),QN=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>us(t)).then(t=>t.vars),ex=()=>ut("/api/settings/data-dir"),JN=e=>Dt("/api/settings/data-dir/validate",{path:e}),eT=e=>Dt("/api/settings/data-dir",{path:e}),tT=e=>Dt("/api/settings/data-dir/move",{path:e}),nT=()=>ut("/api/settings/ssh").then(e=>e.hosts),iT=e=>Dt("/api/settings/ssh/preflight",{host:e}),rT=()=>ut("/api/settings/slurm"),sT=e=>Dt("/api/settings/slurm",e),aT=e=>Dt("/api/settings/slurm/preflight",{host:e}),oT=()=>ut("/api/settings/compute"),tx=e=>Dt("/api/settings/compute/default",e),lT=()=>ut("/api/settings/local"),cT=()=>ut("/api/settings/openresearch"),Iy=e=>ut(`/api/projects/${e}/files`),uT=(e,t)=>ut(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),hT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>us(n)),Np=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,nx=()=>ut("/api/settings/git"),fT=e=>Dt("/api/settings/git",e),dT=e=>Dt("/api/settings/git/token",{token:e}),pT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>us(e)),gT=()=>ut("/api/settings/telemetry"),mT=e=>Dt("/api/settings/telemetry",{enabled:e}),_T=e=>Dt("/api/settings/telemetry/consent",{enabled:e}),wg=(e=!1)=>ut(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),vT=()=>ut("/api/skills").then(e=>e.skills);function xu(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const zy=e=>ut(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),yT=(e,t,n={})=>Dt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),bT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>us(t)),ST=(e,t)=>KS(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),xT=(e,t)=>KS(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Hy=e=>ut(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),wT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,CT=(e,t,n={},r)=>Dt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),ET=e=>Dt(`/api/chat/sessions/${e}/interrupt`),kT=(e,t)=>Dt(`/api/chat/sessions/${e}/respond`,t);function Sa(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Fy(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ns(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return r===0?`${e} B`:`${n.toFixed(1)} ${t[r]}`}function Tp(e){return e.length>10?`${e.slice(0,10)}…`:e}function ix(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function rx(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const cu=new Map;function AT(e,t){let n=cu.get(e);return n||(n=new Set,cu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&cu.delete(e)}}function NT(e){var t;(t=cu.get(e.runId))==null||t.forEach(n=>n(e))}const Rp=new Set;function TT(e){return Rp.add(e),()=>{Rp.delete(e)}}function zc(e){Rp.forEach(t=>t(e))}const Dp=new Set;function RT(e){return Dp.add(e),()=>{Dp.delete(e)}}function Gd(e){Dp.forEach(t=>t(e))}function DT(e){const t=q.useRef(e);t.current=e,q.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&NT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&zc({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&zc({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Gd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Gd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Gd({type:"error",error:l.error})}),()=>n.close()},[])}function Py(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function MT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OT={};function Uy(e,t){return(OT.jsx?LT:jT).test(e)}const BT=/[ \t\n\f\r]/g;function IT(e){return typeof e=="object"?e.type==="text"?$y(e.value):!1:$y(e)}function $y(e){return e.replace(BT,"")===""}class ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ol.prototype.normal={};ol.prototype.property={};ol.prototype.space=void 0;function sx(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ol(n,r,t)}function Po(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let zT=0;const ze=hs(),Ht=hs(),Mp=hs(),xe=hs(),vt=hs(),Jr=hs(),kn=hs();function hs(){return 2**++zT}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ht,commaOrSpaceSeparated:kn,commaSeparated:Jr,number:xe,overloadedBoolean:Mp,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),qd=Object.keys(jp);class Cg extends vn{constructor(t,n,r,a){let l=-1;if(super(t,n),Gy(this,"space",a),typeof r=="number")for(;++l<qd.length;){const u=qd[l];Gy(this,qd[l],(r&jp[u])===jp[u])}}}Cg.prototype.defined=!0;function Gy(e,t,n){n&&(e[t]=n)}function xa(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new Cg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Po(r)]=r,n[Po(l.attribute)]=r}return new ol(t,n,e.space)}const ax=xa({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:vt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:xe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:vt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ht,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ox(e,t){return t in e?e[t]:t}function lx(e,t){return ox(e,t.toLowerCase())}const HT=xa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jr,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,closedBy:null,colorSpace:null,cols:xe,colSpan:xe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:ze,controlsList:vt,coords:xe|Jr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Mp,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:xe,hidden:Mp,high:xe,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:xe,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:xe,rowSpan:xe,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ht,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:Jr,part:vt,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:lx}),FT=xa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jr,g2:Jr,glyphName:Jr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ox}),cx=xa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ux=xa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lx}),hx=xa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),PT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},UT=/[A-Z]/g,qy=/-[a-z]/g,$T=/^data[-\w.:]+$/i;function fx(e,t){const n=Po(t);let r=t,a=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$T.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(qy,qT);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!qy.test(l)){let u=l.replace(UT,GT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Cg}return new a(r,t)}function GT(e){return"-"+e.toLowerCase()}function qT(e){return e.charAt(1).toUpperCase()}const dx=sx([ax,HT,cx,ux,hx],"html"),qu=sx([ax,FT,cx,ux,hx],"svg");function Vy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function VT(e){return e.join(" ").trim()}var Js={},Vd,Yy;function YT(){if(Yy)return Vd;Yy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,f="/",p="*",d="",_="comment",v="declaration";function w(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var x=1,y=1;function E(z){var V=z.match(t);V&&(x+=V.length);var G=z.lastIndexOf(c);y=~G?z.length-G:y+z.length}function R(){var z={line:x,column:y};return function(V){return V.position=new N(z),j(),V}}function N(z){this.start=z,this.end={line:x,column:y},this.source=S.source}N.prototype.content=b;function D(z){var V=new Error(S.source+":"+x+":"+y+": "+z);if(V.reason=z,V.filename=S.source,V.line=x,V.column=y,V.source=b,!S.silent)throw V}function T(z){var V=z.exec(b);if(V){var G=V[0];return E(G),b=b.slice(G.length),V}}function j(){T(n)}function B(z){var V;for(z=z||[];V=F();)V!==!1&&z.push(V);return z}function F(){var z=R();if(!(f!=b.charAt(0)||p!=b.charAt(1))){for(var V=2;d!=b.charAt(V)&&(p!=b.charAt(V)||f!=b.charAt(V+1));)++V;if(V+=2,d===b.charAt(V-1))return D("End of comment missing");var G=b.slice(2,V-2);return y+=2,E(G),b=b.slice(V),y+=2,z({type:_,comment:G})}}function Y(){var z=R(),V=T(r);if(V){if(F(),!T(a))return D("property missing ':'");var G=T(l),X=z({type:v,property:C(V[0].replace(e,d)),value:G?C(G[0].replace(e,d)):d});return T(u),X}}function H(){var z=[];B(z);for(var V;V=Y();)V!==!1&&(z.push(V),B(z));return z}return j(),H()}function C(b){return b?b.replace(o,d):d}return Vd=w,Vd}var Wy;function WT(){if(Wy)return Js;Wy=1;var e=Js&&Js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.default=n;const t=e(YT());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return Js}var Co={},Xy;function XT(){if(Xy)return Co;Xy=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return Co.camelCase=c,Co}var Eo,Ky;function KT(){if(Ky)return Eo;Ky=1;var e=Eo&&Eo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(WT()),n=XT();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Eo=r,Eo}var ZT=KT();const QT=Pu(ZT),px=gx("end"),Eg=gx("start");function gx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function JT(e){const t=Eg(e),n=px(e);if(t&&n)return{start:t,end:n}}function Lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zy(e.position):"start"in e||"end"in e?Zy(e):"line"in e||"column"in e?Lp(e):""}function Lp(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Zy(e){return Lp(e&&e.start)+"-"+Lp(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Lo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const kg={}.hasOwnProperty,e3=new Map,t3=/[A-Z]/g,n3=new Set(["table","tbody","thead","tfoot","tr"]),i3=new Set(["td","th"]),mx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function r3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=f3(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=h3(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qu:dx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=_x(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function _x(e,t,n){if(t.type==="element")return s3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return a3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return l3(e,t,n);if(t.type==="mdxjsEsm")return o3(e,t);if(t.type==="root")return c3(e,t,n);if(t.type==="text")return u3(e,t)}function s3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=yx(e,t.tagName,!1),u=d3(e,t);let o=Ng(e,t);return n3.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!IT(c):!0})),vx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function a3(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uo(e,t.position)}function o3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uo(e,t.position)}function l3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:yx(e,t.name,!0),u=p3(e,t),o=Ng(e,t);return vx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function c3(e,t,n){const r={};return Ag(r,Ng(e,t)),e.create(t,e.Fragment,r,n)}function u3(e,t){return t.value}function vx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ag(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function h3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function f3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Eg(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function d3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&kg.call(t.properties,a)){const l=g3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&i3.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function p3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Uo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Uo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Ng(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:e3;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const f=a.get(c)||0;u=c+"-"+f,a.set(c,f+1)}}const o=_x(e,l,u);o!==void 0&&n.push(o)}return n}function g3(e,t,n){const r=fx(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?MT(n):VT(n)),r.property==="style"){let a=typeof n=="object"?n:m3(e,String(n));return e.stylePropertyNameCase==="css"&&(a=_3(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?PT[r.property]||r.property:r.attribute,n]}}function m3(e,t){try{return QT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=mx+"#cannot-parse-style-attribute",a}}function yx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const o=Uy(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=u}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return kg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(e,t){const n=new tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _3(e){const t={};let n;for(n in e)kg.call(e,n)&&(t[v3(n)]=e[n]);return t}function v3(e){let t=e.replace(t3,y3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function y3(e){return"-"+e.toLowerCase()}const Yd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},b3={};function Tg(e,t){const n=b3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bx(e,r,a)}function bx(e,t,n){if(S3(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,n)}return Array.isArray(e)?Jy(e,t,n):""}function Jy(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=bx(e[a],t,n);return r.join("")}function S3(e){return!!(e&&typeof e=="object")}const e1=document.createElement("i");function $o(e){const t="&"+e+";";e1.innerHTML=t;const n=e1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tn(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Gn(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const t1={}.hasOwnProperty;function Sx(e){const t={};let n=-1;for(;++n<e.length;)x3(t,e[n]);return t}function x3(e,t){let n;for(n in t){const a=(t1.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){t1.call(a,u)||(a[u]=[]);const o=l[u];w3(a[u],Array.isArray(o)?o:o?[o]:[])}}}function w3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tn(e,0,0,r)}function xx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Nr(/[A-Za-z]/),en=Nr(/[\dA-Za-z]/),C3=Nr(/[#-'*+\--9=?A-Z^-~]/);function wu(e){return e!==null&&(e<32||e===127)}const Op=Nr(/\d/),E3=Nr(/[\dA-Fa-f]/),k3=Nr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const Vu=Nr(new RegExp("\\p{P}|\\p{S}","u")),is=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wa(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&en(e.charCodeAt(n+1))&&en(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function et(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Xe(c)?(e.enter(n),o(c)):t(c)}function o(c){return Xe(c)&&l++<a?(e.consume(c),o):(e.exit(n),t(c))}}const A3={tokenize:N3};function N3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),u)}}const T3={tokenize:R3},n1={tokenize:D3};function R3(e){const t=this,n=[];let r=0,a,l,u;return o;function o(y){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,c,f)(y)}return f(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const E=t.events.length;let R=E,N;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){N=t.events[R][1].end;break}S(r);let D=E;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return Tn(t.events,R+1,0,t.events.slice(E)),t.events.length=D,f(y)}return o(y)}function f(y){if(r===n.length){if(!a)return _(y);if(a.currentConstruct&&a.currentConstruct.concrete)return w(y);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(n1,p,d)(y)}function p(y){return a&&x(),S(r),_(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(y)}function _(y){return t.containerState={},e.attempt(n1,v,w)(y)}function v(y){return r++,n.push([t.currentConstruct,t.containerState]),_(y)}function w(y){if(y===null){a&&x(),S(0),e.consume(y);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),C(y)}function C(y){if(y===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(y);return}return Oe(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),C)}function b(y,E){const R=t.sliceStream(y);if(E&&R.push(null),y.previous=l,l&&(l.next=y),l=y,a.defineSkip(y.start),a.write(R),t.parser.lazy[y.start.line]){let N=a.events.length;for(;N--;)if(a.events[N][1].start.offset<u&&(!a.events[N][1].end||a.events[N][1].end.offset>u))return;const D=t.events.length;let T=D,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(S(r),N=D;N<t.events.length;)t.events[N][1].end={...B},N++;Tn(t.events,T+1,0,t.events.slice(D)),t.events.length=N}}function S(y){let E=n.length;for(;E-- >y;){const R=n[E];t.containerState=R[1],R[0].exit.call(t,e)}n.length=y}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function D3(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fa(e){if(e===null||yt(e)||is(e))return 1;if(Vu(e))return 2}function Yu(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Bp={name:"attention",resolveAll:M3,tokenize:j3};function M3(e,t){let n=-1,r,a,l,u,o,c,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},_={...e[n][1].start};i1(d,-c),i1(_,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,Yu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function j3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=fa(r);let l;return u;function u(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const f=e.exit("attentionSequence"),p=fa(c),d=!p||p===2&&a||n.includes(c),_=!a||a===2&&p||n.includes(r);return f._open=!!(l===42?d:d&&(a||!_)),f._close=!!(l===42?_:_&&(p||!d)),t(c)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const L3={name:"autolink",tokenize:O3};function O3(e,t,n){let r=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return sn(v)?(e.consume(v),u):v===64?n(v):f(v)}function u(v){return v===43||v===45||v===46||en(v)?(r=1,o(v)):f(v)}function o(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||en(v))&&r++<32?(e.consume(v),o):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||wu(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),p):C3(v)?(e.consume(v),f):n(v)}function p(v){return en(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):_(v)}function _(v){if((v===45||en(v))&&r++<63){const w=v===45?_:d;return e.consume(v),w}return n(v)}}const ll={partial:!0,tokenize:B3};function B3(e,t,n){return r;function r(l){return Xe(l)?et(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Oe(l)?t(l):n(l)}}const wx={continuation:{tokenize:z3},exit:H3,name:"blockQuote",tokenize:I3};function I3(e,t,n){const r=this;return a;function a(u){if(u===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function z3(e,t,n){const r=this;return a;function a(u){return Xe(u)?et(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(wx,t,n)(u)}}function H3(e){e.exit("blockQuote")}const Cx={name:"characterEscape",tokenize:F3};function F3(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return k3(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Ex={name:"characterReference",tokenize:P3};function P3(e,t,n){const r=this;let a=0,l,u;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),l=31,u=en,p(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=E3,p):(e.enter("characterReferenceValue"),l=7,u=Op,p(d))}function p(d){if(d===59&&a){const _=e.exit("characterReferenceValue");return u===en&&!$o(r.sliceSerialize(_))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(d)&&a++<l?(e.consume(d),p):n(d)}}const r1={partial:!0,tokenize:$3},s1={concrete:!0,name:"codeFenced",tokenize:U3};function U3(e,t,n){const r=this,a={partial:!0,tokenize:R};let l=0,u=0,o;return c;function c(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===o?(u++,e.consume(N),p):u<3?n(N):(e.exit("codeFencedFenceSequence"),Xe(N)?et(e,d,"whitespace")(N):d(N))}function d(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(r1,C,E)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(N))}function _(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):Xe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,v,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),_)}function v(N){return N===null||Oe(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===o?n(N):(e.consume(N),w)}function C(N){return e.attempt(a,E,b)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),S}function S(N){return l>0&&Xe(N)?et(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Oe(N)?e.check(r1,C,E)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),y)}function E(N){return e.exit("codeFenced"),t(N)}function R(N,D,T){let j=0;return B;function B(V){return N.enter("lineEnding"),N.consume(V),N.exit("lineEnding"),F}function F(V){return N.enter("codeFencedFence"),Xe(V)?et(N,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Y(V)}function Y(V){return V===o?(N.enter("codeFencedFenceSequence"),H(V)):T(V)}function H(V){return V===o?(j++,N.consume(V),H):j>=u?(N.exit("codeFencedFenceSequence"),Xe(V)?et(N,z,"whitespace")(V):z(V)):T(V)}function z(V){return V===null||Oe(V)?(N.exit("codeFencedFence"),D(V)):T(V)}}}function $3(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Wd={name:"codeIndented",tokenize:q3},G3={partial:!0,tokenize:V3};function q3(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),et(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Oe(f)?e.attempt(G3,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Oe(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function V3(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):et(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Oe(u)?a(u):n(u)}}const Y3={name:"codeText",previous:X3,resolve:W3,tokenize:K3};function W3(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function X3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function K3(e,t,n){let r=0,a,l;return u;function u(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(l=e.enter("codeTextSequence"),a=0,p(d)):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||Oe(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function p(d){return d===96?(e.consume(d),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",f(d))}}class Z3{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&ko(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ko(this.left,n.reverse())}}}function ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kx(e){const t={};let n=-1,r,a,l,u,o,c,f;const p=new Z3(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Q3(p,n)),n=t[n],f=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},o=p.slice(a,n),o.unshift(r),p.splice(a,n-a+1,o))}}return Tn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Q3(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],f={};let p,d,_=-1,v=n,w=0,C=0;const b=[C];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),d&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++_<o.length;)o[_][0]==="exit"&&o[_-1][0]==="enter"&&o[_][1].type===o[_-1][1].type&&o[_][1].start.line!==o[_][1].end.line&&(C=_+1,b.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):b.pop(),_=b.length;_--;){const S=o.slice(b[_],b[_+1]),x=l.pop();c.push([x,x+S.length-1]),e.splice(x,2,S)}for(c.reverse(),_=-1;++_<c.length;)f[w+c[_][0]]=w+c[_][1],w+=c[_][1]-c[_][0]-1;return f}const J3={resolve:t5,tokenize:n5},e5={partial:!0,tokenize:i5};function t5(e){return kx(e),e}function n5(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?l(o):Oe(o)?e.check(e5,u,l)(o):(e.consume(o),a)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function u(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function i5(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,l,"linePrefix")}function l(u){if(u===null||Oe(u))return n(u);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Ax(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(S){return S===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(S),e.exit(l),_):S===null||S===32||S===41||wu(S)?n(S):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),C(S))}function _(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(o),_(S)):S===null||S===60||Oe(S)?n(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||yt(S))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||wu(S)?n(S):(e.consume(S),S===92?b:C)}function b(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function Nx(e,t,n,r,a,l){const u=this;let o=0,c;return f;function f(v){return e.enter(r),e.enter(a),e.consume(v),e.exit(a),e.enter(l),p}function p(v){return o>999||v===null||v===91||v===93&&!c||v===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||Oe(v)||o++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Xe(v)),v===92?_:d)}function _(v){return v===91||v===92||v===93?(e.consume(v),o++,d):d(v)}}function Tx(e,t,n,r,a,l){let u;return o;function o(_){return _===34||_===39||_===40?(e.enter(r),e.enter(a),e.consume(_),e.exit(a),u=_===40?41:_,c):n(_)}function c(_){return _===u?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):(e.enter(l),f(_))}function f(_){return _===u?(e.exit(l),c(u)):_===null?n(_):Oe(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),et(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===u||_===null||Oe(_)?(e.exit("chunkString"),f(_)):(e.consume(_),_===92?d:p)}function d(_){return _===u||_===92?(e.consume(_),p):p(_)}}function Oo(e,t){let n;return r;function r(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Xe(a)?et(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const r5={name:"definition",tokenize:a5},s5={partial:!0,tokenize:o5};function a5(e,t,n){const r=this;let a;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return Nx.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function o(v){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return yt(v)?Oo(e,f)(v):f(v)}function f(v){return Ax(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(s5,d,d)(v)}function d(v){return Xe(v)?et(e,_,"whitespace")(v):_(v)}function _(v){return v===null||Oe(v)?(e.exit("definition"),r.parser.defined.push(a),t(v)):n(v)}}function o5(e,t,n){return r;function r(o){return yt(o)?Oo(e,a)(o):n(o)}function a(o){return Tx(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Xe(o)?et(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Oe(o)?t(o):n(o)}}const l5={name:"hardBreakEscape",tokenize:c5};function c5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Oe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const u5={name:"headingAtx",resolve:h5,tokenize:f5};function h5(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function f5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||yt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(e.exit("atxHeading"),t(p)):Xe(p)?et(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||yt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const d5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a1=["pre","script","style","textarea"],p5={concrete:!0,name:"htmlFlow",resolveTo:_5,tokenize:v5},g5={partial:!0,tokenize:b5},m5={partial:!0,tokenize:y5};function _5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function v5(e,t,n){const r=this;let a,l,u,o,c;return f;function f(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),_):U===47?(e.consume(U),l=!0,C):U===63?(e.consume(U),a=3,r.interrupt?t:M):sn(U)?(e.consume(U),u=String.fromCharCode(U),b):n(U)}function _(U){return U===45?(e.consume(U),a=2,v):U===91?(e.consume(U),a=5,o=0,w):sn(U)?(e.consume(U),a=4,r.interrupt?t:M):n(U)}function v(U){return U===45?(e.consume(U),r.interrupt?t:M):n(U)}function w(U){const Q="CDATA[";return U===Q.charCodeAt(o++)?(e.consume(U),o===Q.length?r.interrupt?t:Y:w):n(U)}function C(U){return sn(U)?(e.consume(U),u=String.fromCharCode(U),b):n(U)}function b(U){if(U===null||U===47||U===62||yt(U)){const Q=U===47,re=u.toLowerCase();return!Q&&!l&&a1.includes(re)?(a=1,r.interrupt?t(U):Y(U)):d5.includes(u.toLowerCase())?(a=6,Q?(e.consume(U),S):r.interrupt?t(U):Y(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):l?x(U):y(U))}return U===45||en(U)?(e.consume(U),u+=String.fromCharCode(U),b):n(U)}function S(U){return U===62?(e.consume(U),r.interrupt?t:Y):n(U)}function x(U){return Xe(U)?(e.consume(U),x):B(U)}function y(U){return U===47?(e.consume(U),B):U===58||U===95||sn(U)?(e.consume(U),E):Xe(U)?(e.consume(U),y):B(U)}function E(U){return U===45||U===46||U===58||U===95||en(U)?(e.consume(U),E):R(U)}function R(U){return U===61?(e.consume(U),N):Xe(U)?(e.consume(U),R):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,D):Xe(U)?(e.consume(U),N):T(U)}function D(U){return U===c?(e.consume(U),c=null,j):U===null||Oe(U)?n(U):(e.consume(U),D)}function T(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||yt(U)?R(U):(e.consume(U),T)}function j(U){return U===47||U===62||Xe(U)?y(U):n(U)}function B(U){return U===62?(e.consume(U),F):n(U)}function F(U){return U===null||Oe(U)?Y(U):Xe(U)?(e.consume(U),F):n(U)}function Y(U){return U===45&&a===2?(e.consume(U),G):U===60&&a===1?(e.consume(U),X):U===62&&a===4?(e.consume(U),O):U===63&&a===3?(e.consume(U),M):U===93&&a===5?(e.consume(U),L):Oe(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(g5,$,H)(U)):U===null||Oe(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),Y)}function H(U){return e.check(m5,z,$)(U)}function z(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),V}function V(U){return U===null||Oe(U)?H(U):(e.enter("htmlFlowData"),Y(U))}function G(U){return U===45?(e.consume(U),M):Y(U)}function X(U){return U===47?(e.consume(U),u="",K):Y(U)}function K(U){if(U===62){const Q=u.toLowerCase();return a1.includes(Q)?(e.consume(U),O):Y(U)}return sn(U)&&u.length<8?(e.consume(U),u+=String.fromCharCode(U),K):Y(U)}function L(U){return U===93?(e.consume(U),M):Y(U)}function M(U){return U===62?(e.consume(U),O):U===45&&a===2?(e.consume(U),M):Y(U)}function O(U){return U===null||Oe(U)?(e.exit("htmlFlowData"),$(U)):(e.consume(U),O)}function $(U){return e.exit("htmlFlow"),t(U)}}function y5(e,t,n){const r=this;return a;function a(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function b5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ll,t,n)}}const S5={name:"htmlText",tokenize:x5};function x5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),R):M===63?(e.consume(M),y):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,w):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),_):Oe(M)?(u=d,X(M)):(e.consume(M),d)}function _(M){return M===45?(e.consume(M),v):d(M)}function v(M){return M===62?G(M):M===45?_(M):d(M)}function w(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?C:w):n(M)}function C(M){return M===null?n(M):M===93?(e.consume(M),b):Oe(M)?(u=C,X(M)):(e.consume(M),C)}function b(M){return M===93?(e.consume(M),S):C(M)}function S(M){return M===62?G(M):M===93?(e.consume(M),S):C(M)}function x(M){return M===null||M===62?G(M):Oe(M)?(u=x,X(M)):(e.consume(M),x)}function y(M){return M===null?n(M):M===63?(e.consume(M),E):Oe(M)?(u=y,X(M)):(e.consume(M),y)}function E(M){return M===62?G(M):y(M)}function R(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||en(M)?(e.consume(M),N):D(M)}function D(M){return Oe(M)?(u=D,X(M)):Xe(M)?(e.consume(M),D):G(M)}function T(M){return M===45||en(M)?(e.consume(M),T):M===47||M===62||yt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),G):M===58||M===95||sn(M)?(e.consume(M),B):Oe(M)?(u=j,X(M)):Xe(M)?(e.consume(M),j):G(M)}function B(M){return M===45||M===46||M===58||M===95||en(M)?(e.consume(M),B):F(M)}function F(M){return M===61?(e.consume(M),Y):Oe(M)?(u=F,X(M)):Xe(M)?(e.consume(M),F):j(M)}function Y(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,H):Oe(M)?(u=Y,X(M)):Xe(M)?(e.consume(M),Y):(e.consume(M),z)}function H(M){return M===a?(e.consume(M),a=void 0,V):M===null?n(M):Oe(M)?(u=H,X(M)):(e.consume(M),H)}function z(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||yt(M)?j(M):(e.consume(M),z)}function V(M){return M===47||M===62||yt(M)?j(M):n(M)}function G(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Xe(M)?et(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const Rg={name:"labelEnd",resolveAll:k5,resolveTo:A5,tokenize:N5},w5={tokenize:T5},C5={tokenize:R5},E5={tokenize:D5};function k5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Tn(e,0,e.length,n),e}function A5(e,t){let n=e.length,r=0,a,l,u,o;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,t],["enter",f,t]],o=Gn(o,e.slice(l+1,l+r+3)),o=Gn(o,[["enter",p,t]]),o=Gn(o,Yu(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),o=Gn(o,[["exit",p,t],e[u-2],e[u-1],["exit",f,t]]),o=Gn(o,e.slice(u+1)),o=Gn(o,[["exit",c,t]]),Tn(e,l,e.length,o),e}function N5(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return o;function o(_){return l?l._inactive?d(_):(u=r.parser.defined.includes(Jn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),c):n(_)}function c(_){return _===40?e.attempt(w5,p,u?p:d)(_):_===91?e.attempt(C5,p,u?f:d)(_):u?p(_):d(_)}function f(_){return e.attempt(E5,p,d)(_)}function p(_){return t(_)}function d(_){return l._balanced=!0,n(_)}}function T5(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),a}function a(d){return yt(d)?Oo(e,l)(d):l(d)}function l(d){return d===41?p(d):Ax(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function u(d){return yt(d)?Oo(e,c)(d):p(d)}function o(d){return n(d)}function c(d){return d===34||d===39||d===40?Tx(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function f(d){return yt(d)?Oo(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function R5(e,t,n){const r=this;return a;function a(o){return Nx.call(r,e,l,u,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function u(o){return n(o)}}function D5(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const M5={name:"labelStartImage",resolveAll:Rg.resolveAll,tokenize:j5};function j5(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):n(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const L5={name:"labelStartLink",resolveAll:Rg.resolveAll,tokenize:O5};function O5(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Xd={name:"lineEnding",tokenize:B5};function B5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,t,"linePrefix")}}const uu={name:"thematicBreak",tokenize:I5};function I5(e,t,n){let r=0,a;return l;function l(f){return e.enter("thematicBreak"),u(f)}function u(f){return a=f,o(f)}function o(f){return f===a?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||Oe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Xe(f)?et(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:P5},exit:$5,name:"list",tokenize:F5},z5={partial:!0,tokenize:G5},H5={partial:!0,tokenize:U5};function F5(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Op(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(uu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return Op(v)&&++u<10?(e.consume(v),c):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(ll,r.interrupt?n:p,e.attempt(z5,_,d))}function p(v){return r.containerState.initialBlankLine=!0,l++,_(v)}function d(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),_):n(v)}function _(v){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function P5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ll,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(H5,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function U5(e,t,n){const r=this;return et(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function $5(e){e.exit(this.containerState.type)}function G5(e,t,n){const r=this;return et(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const o1={name:"setextUnderline",resolveTo:q5,tokenize:V5};function q5(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function V5(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Xe(f)?et(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Oe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Y5={tokenize:W5};function W5(e){const t=this,n=e.attempt(ll,r,e.attempt(this.parser.constructs.flowInitial,a,et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(J3,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const X5={resolveAll:Dx()},K5=Rx("string"),Z5=Rx("text");function Rx(e){return{resolveAll:Dx(e==="text"?Q5:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let _=-1;if(d)for(;++_<d.length;){const v=d[_];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Dx(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function Q5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,o=0,c;for(;l--;){const f=a[l];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(f===-2)c=!0,o++;else if(f!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const f={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const J5={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:wx},e4={91:r5},t4={[-2]:Wd,[-1]:Wd,32:Wd},n4={35:u5,42:uu,45:[o1,uu],60:p5,61:o1,95:uu,96:s1,126:s1},i4={38:Ex,92:Cx},r4={[-5]:Xd,[-4]:Xd,[-3]:Xd,33:M5,38:Ex,42:Bp,60:[L3,S5],91:L5,92:[l5,Cx],93:Rg,95:Bp,96:Y3},s4={null:[Bp,X5]},a4={null:[42,95]},o4={null:[]},l4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:a4,contentInitial:e4,disable:o4,document:J5,flow:n4,flowInitial:t4,insideSpan:s4,string:i4,text:r4},Symbol.toStringTag,{value:"Module"}));function c4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],o=[];const c={attempt:D(R),check:D(N),consume:x,enter:y,exit:E,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:v,write:d};let p=t.tokenize.call(f,c);return t.resolveAll&&l.push(t),f;function d(F){return u=Gn(u,F),b(),u[u.length-1]!==null?[]:(T(t,0),f.events=Yu(l,f.events,f),f.events)}function _(F,Y){return h4(v(F),Y)}function v(F){return u4(u,F)}function w(){const{_bufferIndex:F,_index:Y,line:H,column:z,offset:V}=r;return{_bufferIndex:F,_index:Y,line:H,column:z,offset:V}}function C(F){a[F.line]=F.column,B()}function b(){let F;for(;r._index<u.length;){const Y=u[r._index];if(typeof Y=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<Y.length;)S(Y.charCodeAt(r._bufferIndex));else S(Y)}}function S(F){p=p(F)}function x(F){Oe(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,B()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=F}function y(F,Y){const H=Y||{};return H.type=F,H.start=w(),f.events.push(["enter",H,f]),o.push(H),H}function E(F){const Y=o.pop();return Y.end=w(),f.events.push(["exit",Y,f]),Y}function R(F,Y){T(F,Y.from)}function N(F,Y){Y.restore()}function D(F,Y){return H;function H(z,V,G){let X,K,L,M;return Array.isArray(z)?$(z):"tokenize"in z?$([z]):O(z);function O(ae){return Z;function Z(P){const ee=P!==null&&ae[P],ne=P!==null&&ae.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return $(ge)(P)}}function $(ae){return X=ae,K=0,ae.length===0?G:U(ae[K])}function U(ae){return Z;function Z(P){return M=j(),L=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(Y?Object.assign(Object.create(f),Y):f,c,Q,re)(P)}}function Q(ae){return F(L,M),V}function re(ae){return M.restore(),++K<X.length?U(X[K]):G}}}function T(F,Y){F.resolveAll&&!l.includes(F)&&l.push(F),F.resolve&&Tn(f.events,Y,f.events.length-Y,F.resolve(f.events.slice(Y),f)),F.resolveTo&&(f.events=F.resolveTo(f.events,f))}function j(){const F=w(),Y=f.previous,H=f.currentConstruct,z=f.events.length,V=Array.from(o);return{from:z,restore:G};function G(){r=F,f.previous=Y,f.currentConstruct=H,f.events.length=z,o=V,B()}}function B(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function u4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function h4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=` + */const kN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fo=$e("x",kN);async function us(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const ut=e=>fetch(e).then(t=>us(t)),Dt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>us(n)),WS=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>us(n)),AN=()=>ut("/api/projects").then(e=>e.projects),NN=e=>Dt("/api/projects",e).then(t=>t.project),TN=e=>ut(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),RN=e=>ut(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),DN=e=>Dt(`/api/projects/${e}/open`).then(t=>t.project),MN=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),jN=e=>ut(`/api/projects/${e}/experiments`).then(t=>t.experiments),LN=e=>ut(`/api/projects/${e}/runs`).then(t=>t.runs),ON=()=>ut("/api/instances").then(e=>e.instances),XS=e=>Dt(`/api/runs/${e}/cancel`),BN=(e,t)=>ut(`/api/runs/${e}/log?offset=${t}`),IN=e=>ut(`/api/experiments/${e}/commits`).then(t=>t.commits),zN=(e,t)=>ut(`/api/experiments/${e}/commits/${t}/diff`),By=e=>ut(`/api/projects/${e}/working-tree`),KS=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),HN=(e,t,n={})=>ut(`/api/projects/${e}/file?${KS(n,new URLSearchParams({path:t}))}`),FN=(e,t={})=>{const n=KS(t).toString();return ut(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},xg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,PN=()=>ut("/api/settings/hf"),UN=e=>Dt("/api/settings/hf",{token:e}),$N=()=>ut("/api/settings/k8s"),GN=e=>Dt("/api/settings/k8s",e),qN=()=>ut("/api/settings/modal"),VN=()=>Dt("/api/settings/modal/provision"),YN=()=>ut("/api/settings/env").then(e=>e.vars),ZS=(e,t)=>Dt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),WN=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>us(t)).then(t=>t.vars),QS=()=>ut("/api/settings/data-dir"),XN=e=>Dt("/api/settings/data-dir/validate",{path:e}),KN=e=>Dt("/api/settings/data-dir",{path:e}),ZN=e=>Dt("/api/settings/data-dir/move",{path:e}),QN=()=>ut("/api/settings/ssh").then(e=>e.hosts),JN=e=>Dt("/api/settings/ssh/preflight",{host:e}),eT=()=>ut("/api/settings/slurm"),tT=e=>Dt("/api/settings/slurm",e),nT=e=>Dt("/api/settings/slurm/preflight",{host:e}),iT=()=>ut("/api/settings/compute"),JS=e=>Dt("/api/settings/compute/default",e),rT=()=>ut("/api/settings/local"),sT=()=>ut("/api/settings/openresearch"),Iy=e=>ut(`/api/projects/${e}/files`),aT=(e,t)=>ut(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),oT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>us(n)),Np=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,ex=()=>ut("/api/settings/git"),lT=e=>Dt("/api/settings/git",e),cT=e=>Dt("/api/settings/git/token",{token:e}),uT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>us(e)),hT=()=>ut("/api/settings/telemetry"),fT=e=>Dt("/api/settings/telemetry",{enabled:e}),dT=e=>Dt("/api/settings/telemetry/consent",{enabled:e}),wg=(e=!1)=>ut(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),pT=()=>ut("/api/skills").then(e=>e.skills);function xu(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const zy=e=>ut(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),gT=(e,t,n={})=>Dt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),mT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>us(t)),_T=(e,t)=>WS(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),vT=(e,t)=>WS(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Hy=e=>ut(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),yT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,bT=(e,t,n={},r)=>Dt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),ST=e=>Dt(`/api/chat/sessions/${e}/interrupt`),xT=(e,t)=>Dt(`/api/chat/sessions/${e}/respond`,t);function Sa(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Fy(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ns(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return r===0?`${e} B`:`${n.toFixed(1)} ${t[r]}`}function Tp(e){return e.length>10?`${e.slice(0,10)}…`:e}function tx(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function nx(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const cu=new Map;function wT(e,t){let n=cu.get(e);return n||(n=new Set,cu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&cu.delete(e)}}function CT(e){var t;(t=cu.get(e.runId))==null||t.forEach(n=>n(e))}const Rp=new Set;function ET(e){return Rp.add(e),()=>{Rp.delete(e)}}function zc(e){Rp.forEach(t=>t(e))}const Dp=new Set;function kT(e){return Dp.add(e),()=>{Dp.delete(e)}}function Gd(e){Dp.forEach(t=>t(e))}function AT(e){const t=V.useRef(e);t.current=e,V.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&CT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&zc({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&zc({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Gd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Gd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Gd({type:"error",error:l.error})}),()=>n.close()},[])}function Py(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function NT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DT={};function Uy(e,t){return(DT.jsx?RT:TT).test(e)}const MT=/[ \t\n\f\r]/g;function jT(e){return typeof e=="object"?e.type==="text"?$y(e.value):!1:$y(e)}function $y(e){return e.replace(MT,"")===""}class ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ol.prototype.normal={};ol.prototype.property={};ol.prototype.space=void 0;function ix(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ol(n,r,t)}function Po(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let LT=0;const ze=hs(),Ht=hs(),Mp=hs(),xe=hs(),vt=hs(),Jr=hs(),kn=hs();function hs(){return 2**++LT}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ht,commaOrSpaceSeparated:kn,commaSeparated:Jr,number:xe,overloadedBoolean:Mp,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),qd=Object.keys(jp);class Cg extends vn{constructor(t,n,r,a){let l=-1;if(super(t,n),Gy(this,"space",a),typeof r=="number")for(;++l<qd.length;){const u=qd[l];Gy(this,qd[l],(r&jp[u])===jp[u])}}}Cg.prototype.defined=!0;function Gy(e,t,n){n&&(e[t]=n)}function xa(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new Cg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Po(r)]=r,n[Po(l.attribute)]=r}return new ol(t,n,e.space)}const rx=xa({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:vt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:xe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:vt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ht,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sx(e,t){return t in e?e[t]:t}function ax(e,t){return sx(e,t.toLowerCase())}const OT=xa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jr,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,closedBy:null,colorSpace:null,cols:xe,colSpan:xe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:ze,controlsList:vt,coords:xe|Jr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Mp,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:xe,hidden:Mp,high:xe,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:xe,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:xe,rowSpan:xe,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ht,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:Jr,part:vt,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:ax}),BT=xa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jr,g2:Jr,glyphName:Jr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sx}),ox=xa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lx=xa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ax}),cx=xa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zT=/[A-Z]/g,qy=/-[a-z]/g,HT=/^data[-\w.:]+$/i;function ux(e,t){const n=Po(t);let r=t,a=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HT.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(qy,PT);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!qy.test(l)){let u=l.replace(zT,FT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Cg}return new a(r,t)}function FT(e){return"-"+e.toLowerCase()}function PT(e){return e.charAt(1).toUpperCase()}const hx=ix([rx,OT,ox,lx,cx],"html"),qu=ix([rx,BT,ox,lx,cx],"svg");function Vy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function UT(e){return e.join(" ").trim()}var Js={},Vd,Yy;function $T(){if(Yy)return Vd;Yy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` +`,f="/",p="*",d="",_="comment",v="declaration";function w(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var x=1,y=1;function E(H){var Y=H.match(t);Y&&(x+=Y.length);var q=H.lastIndexOf(c);y=~q?H.length-q:y+H.length}function R(){var H={line:x,column:y};return function(Y){return Y.position=new N(H),j(),Y}}function N(H){this.start=H,this.end={line:x,column:y},this.source=S.source}N.prototype.content=b;function D(H){var Y=new Error(S.source+":"+x+":"+y+": "+H);if(Y.reason=H,Y.filename=S.source,Y.line=x,Y.column=y,Y.source=b,!S.silent)throw Y}function T(H){var Y=H.exec(b);if(Y){var q=Y[0];return E(q),b=b.slice(q.length),Y}}function j(){T(n)}function B(H){var Y;for(H=H||[];Y=z();)Y!==!1&&H.push(Y);return H}function z(){var H=R();if(!(f!=b.charAt(0)||p!=b.charAt(1))){for(var Y=2;d!=b.charAt(Y)&&(p!=b.charAt(Y)||f!=b.charAt(Y+1));)++Y;if(Y+=2,d===b.charAt(Y-1))return D("End of comment missing");var q=b.slice(2,Y-2);return y+=2,E(q),b=b.slice(Y),y+=2,H({type:_,comment:q})}}function G(){var H=R(),Y=T(r);if(Y){if(z(),!T(a))return D("property missing ':'");var q=T(l),X=H({type:v,property:C(Y[0].replace(e,d)),value:q?C(q[0].replace(e,d)):d});return T(u),X}}function U(){var H=[];B(H);for(var Y;Y=G();)Y!==!1&&(H.push(Y),B(H));return H}return j(),U()}function C(b){return b?b.replace(o,d):d}return Vd=w,Vd}var Wy;function GT(){if(Wy)return Js;Wy=1;var e=Js&&Js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.default=n;const t=e($T());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return Js}var Co={},Xy;function qT(){if(Xy)return Co;Xy=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return Co.camelCase=c,Co}var Eo,Ky;function VT(){if(Ky)return Eo;Ky=1;var e=Eo&&Eo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(GT()),n=qT();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Eo=r,Eo}var YT=VT();const WT=Pu(YT),fx=dx("end"),Eg=dx("start");function dx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function XT(e){const t=Eg(e),n=fx(e);if(t&&n)return{start:t,end:n}}function Lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zy(e.position):"start"in e||"end"in e?Zy(e):"line"in e||"column"in e?Lp(e):""}function Lp(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Zy(e){return Lp(e&&e.start)+"-"+Lp(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Lo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const kg={}.hasOwnProperty,KT=new Map,ZT=/[A-Z]/g,QT=new Set(["table","tbody","thead","tfoot","tr"]),JT=new Set(["td","th"]),px="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=l3(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=o3(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qu:hx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=gx(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function gx(e,t,n){if(t.type==="element")return t3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return r3(e,t,n);if(t.type==="mdxjsEsm")return i3(e,t);if(t.type==="root")return s3(e,t,n);if(t.type==="text")return a3(e,t)}function t3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=_x(e,t.tagName,!1),u=c3(e,t);let o=Ng(e,t);return QT.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!jT(c):!0})),mx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function n3(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uo(e,t.position)}function i3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uo(e,t.position)}function r3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:_x(e,t.name,!0),u=u3(e,t),o=Ng(e,t);return mx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function s3(e,t,n){const r={};return Ag(r,Ng(e,t)),e.create(t,e.Fragment,r,n)}function a3(e,t){return t.value}function mx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ag(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function o3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function l3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Eg(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function c3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&kg.call(t.properties,a)){const l=h3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&JT.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function u3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Uo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Uo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Ng(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:KT;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const f=a.get(c)||0;u=c+"-"+f,a.set(c,f+1)}}const o=gx(e,l,u);o!==void 0&&n.push(o)}return n}function h3(e,t,n){const r=ux(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?NT(n):UT(n)),r.property==="style"){let a=typeof n=="object"?n:f3(e,String(n));return e.stylePropertyNameCase==="css"&&(a=d3(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?IT[r.property]||r.property:r.attribute,n]}}function f3(e,t){try{return WT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=px+"#cannot-parse-style-attribute",a}}function _x(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const o=Uy(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=u}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return kg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(e,t){const n=new tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=px+"#cannot-handle-mdx-estrees-without-createevaluater",n}function d3(e){const t={};let n;for(n in e)kg.call(e,n)&&(t[p3(n)]=e[n]);return t}function p3(e){let t=e.replace(ZT,g3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function g3(e){return"-"+e.toLowerCase()}const Yd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},m3={};function Tg(e,t){const n=m3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vx(e,r,a)}function vx(e,t,n){if(_3(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,n)}return Array.isArray(e)?Jy(e,t,n):""}function Jy(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=vx(e[a],t,n);return r.join("")}function _3(e){return!!(e&&typeof e=="object")}const e1=document.createElement("i");function $o(e){const t="&"+e+";";e1.innerHTML=t;const n=e1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tn(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Gn(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const t1={}.hasOwnProperty;function yx(e){const t={};let n=-1;for(;++n<e.length;)v3(t,e[n]);return t}function v3(e,t){let n;for(n in t){const a=(t1.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){t1.call(a,u)||(a[u]=[]);const o=l[u];y3(a[u],Array.isArray(o)?o:o?[o]:[])}}}function y3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tn(e,0,0,r)}function bx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Nr(/[A-Za-z]/),en=Nr(/[\dA-Za-z]/),b3=Nr(/[#-'*+\--9=?A-Z^-~]/);function wu(e){return e!==null&&(e<32||e===127)}const Op=Nr(/\d/),S3=Nr(/[\dA-Fa-f]/),x3=Nr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const Vu=Nr(new RegExp("\\p{P}|\\p{S}","u")),is=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wa(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&en(e.charCodeAt(n+1))&&en(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function et(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Xe(c)?(e.enter(n),o(c)):t(c)}function o(c){return Xe(c)&&l++<a?(e.consume(c),o):(e.exit(n),t(c))}}const w3={tokenize:C3};function C3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),u)}}const E3={tokenize:k3},n1={tokenize:A3};function k3(e){const t=this,n=[];let r=0,a,l,u;return o;function o(y){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,c,f)(y)}return f(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const E=t.events.length;let R=E,N;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){N=t.events[R][1].end;break}S(r);let D=E;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return Tn(t.events,R+1,0,t.events.slice(E)),t.events.length=D,f(y)}return o(y)}function f(y){if(r===n.length){if(!a)return _(y);if(a.currentConstruct&&a.currentConstruct.concrete)return w(y);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(n1,p,d)(y)}function p(y){return a&&x(),S(r),_(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(y)}function _(y){return t.containerState={},e.attempt(n1,v,w)(y)}function v(y){return r++,n.push([t.currentConstruct,t.containerState]),_(y)}function w(y){if(y===null){a&&x(),S(0),e.consume(y);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),C(y)}function C(y){if(y===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(y);return}return Oe(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),C)}function b(y,E){const R=t.sliceStream(y);if(E&&R.push(null),y.previous=l,l&&(l.next=y),l=y,a.defineSkip(y.start),a.write(R),t.parser.lazy[y.start.line]){let N=a.events.length;for(;N--;)if(a.events[N][1].start.offset<u&&(!a.events[N][1].end||a.events[N][1].end.offset>u))return;const D=t.events.length;let T=D,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(S(r),N=D;N<t.events.length;)t.events[N][1].end={...B},N++;Tn(t.events,T+1,0,t.events.slice(D)),t.events.length=N}}function S(y){let E=n.length;for(;E-- >y;){const R=n[E];t.containerState=R[1],R[0].exit.call(t,e)}n.length=y}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function A3(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fa(e){if(e===null||yt(e)||is(e))return 1;if(Vu(e))return 2}function Yu(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Bp={name:"attention",resolveAll:N3,tokenize:T3};function N3(e,t){let n=-1,r,a,l,u,o,c,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},_={...e[n][1].start};i1(d,-c),i1(_,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,Yu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=fa(r);let l;return u;function u(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const f=e.exit("attentionSequence"),p=fa(c),d=!p||p===2&&a||n.includes(c),_=!a||a===2&&p||n.includes(r);return f._open=!!(l===42?d:d&&(a||!_)),f._close=!!(l===42?_:_&&(p||!d)),t(c)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R3={name:"autolink",tokenize:D3};function D3(e,t,n){let r=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return sn(v)?(e.consume(v),u):v===64?n(v):f(v)}function u(v){return v===43||v===45||v===46||en(v)?(r=1,o(v)):f(v)}function o(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||en(v))&&r++<32?(e.consume(v),o):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||wu(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),p):b3(v)?(e.consume(v),f):n(v)}function p(v){return en(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):_(v)}function _(v){if((v===45||en(v))&&r++<63){const w=v===45?_:d;return e.consume(v),w}return n(v)}}const ll={partial:!0,tokenize:M3};function M3(e,t,n){return r;function r(l){return Xe(l)?et(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Oe(l)?t(l):n(l)}}const Sx={continuation:{tokenize:L3},exit:O3,name:"blockQuote",tokenize:j3};function j3(e,t,n){const r=this;return a;function a(u){if(u===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function L3(e,t,n){const r=this;return a;function a(u){return Xe(u)?et(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(Sx,t,n)(u)}}function O3(e){e.exit("blockQuote")}const xx={name:"characterEscape",tokenize:B3};function B3(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return x3(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const wx={name:"characterReference",tokenize:I3};function I3(e,t,n){const r=this;let a=0,l,u;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),l=31,u=en,p(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=S3,p):(e.enter("characterReferenceValue"),l=7,u=Op,p(d))}function p(d){if(d===59&&a){const _=e.exit("characterReferenceValue");return u===en&&!$o(r.sliceSerialize(_))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(d)&&a++<l?(e.consume(d),p):n(d)}}const r1={partial:!0,tokenize:H3},s1={concrete:!0,name:"codeFenced",tokenize:z3};function z3(e,t,n){const r=this,a={partial:!0,tokenize:R};let l=0,u=0,o;return c;function c(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===o?(u++,e.consume(N),p):u<3?n(N):(e.exit("codeFencedFenceSequence"),Xe(N)?et(e,d,"whitespace")(N):d(N))}function d(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(r1,C,E)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(N))}function _(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):Xe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,v,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),_)}function v(N){return N===null||Oe(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===o?n(N):(e.consume(N),w)}function C(N){return e.attempt(a,E,b)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),S}function S(N){return l>0&&Xe(N)?et(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Oe(N)?e.check(r1,C,E)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),y)}function E(N){return e.exit("codeFenced"),t(N)}function R(N,D,T){let j=0;return B;function B(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),z}function z(Y){return N.enter("codeFencedFence"),Xe(Y)?et(N,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):G(Y)}function G(Y){return Y===o?(N.enter("codeFencedFenceSequence"),U(Y)):T(Y)}function U(Y){return Y===o?(j++,N.consume(Y),U):j>=u?(N.exit("codeFencedFenceSequence"),Xe(Y)?et(N,H,"whitespace")(Y):H(Y)):T(Y)}function H(Y){return Y===null||Oe(Y)?(N.exit("codeFencedFence"),D(Y)):T(Y)}}}function H3(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Wd={name:"codeIndented",tokenize:P3},F3={partial:!0,tokenize:U3};function P3(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),et(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Oe(f)?e.attempt(F3,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Oe(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function U3(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):et(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Oe(u)?a(u):n(u)}}const $3={name:"codeText",previous:q3,resolve:G3,tokenize:V3};function G3(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function q3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function V3(e,t,n){let r=0,a,l;return u;function u(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(l=e.enter("codeTextSequence"),a=0,p(d)):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||Oe(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function p(d){return d===96?(e.consume(d),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",f(d))}}class Y3{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&ko(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ko(this.left,n.reverse())}}}function ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Cx(e){const t={};let n=-1,r,a,l,u,o,c,f;const p=new Y3(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,W3(p,n)),n=t[n],f=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},o=p.slice(a,n),o.unshift(r),p.splice(a,n-a+1,o))}}return Tn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function W3(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],f={};let p,d,_=-1,v=n,w=0,C=0;const b=[C];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),d&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++_<o.length;)o[_][0]==="exit"&&o[_-1][0]==="enter"&&o[_][1].type===o[_-1][1].type&&o[_][1].start.line!==o[_][1].end.line&&(C=_+1,b.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):b.pop(),_=b.length;_--;){const S=o.slice(b[_],b[_+1]),x=l.pop();c.push([x,x+S.length-1]),e.splice(x,2,S)}for(c.reverse(),_=-1;++_<c.length;)f[w+c[_][0]]=w+c[_][1],w+=c[_][1]-c[_][0]-1;return f}const X3={resolve:Z3,tokenize:Q3},K3={partial:!0,tokenize:J3};function Z3(e){return Cx(e),e}function Q3(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?l(o):Oe(o)?e.check(K3,u,l)(o):(e.consume(o),a)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function u(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function J3(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,l,"linePrefix")}function l(u){if(u===null||Oe(u))return n(u);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Ex(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(S){return S===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(S),e.exit(l),_):S===null||S===32||S===41||wu(S)?n(S):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),C(S))}function _(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(o),_(S)):S===null||S===60||Oe(S)?n(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||yt(S))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||wu(S)?n(S):(e.consume(S),S===92?b:C)}function b(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function kx(e,t,n,r,a,l){const u=this;let o=0,c;return f;function f(v){return e.enter(r),e.enter(a),e.consume(v),e.exit(a),e.enter(l),p}function p(v){return o>999||v===null||v===91||v===93&&!c||v===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||Oe(v)||o++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Xe(v)),v===92?_:d)}function _(v){return v===91||v===92||v===93?(e.consume(v),o++,d):d(v)}}function Ax(e,t,n,r,a,l){let u;return o;function o(_){return _===34||_===39||_===40?(e.enter(r),e.enter(a),e.consume(_),e.exit(a),u=_===40?41:_,c):n(_)}function c(_){return _===u?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):(e.enter(l),f(_))}function f(_){return _===u?(e.exit(l),c(u)):_===null?n(_):Oe(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),et(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===u||_===null||Oe(_)?(e.exit("chunkString"),f(_)):(e.consume(_),_===92?d:p)}function d(_){return _===u||_===92?(e.consume(_),p):p(_)}}function Oo(e,t){let n;return r;function r(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Xe(a)?et(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const e5={name:"definition",tokenize:n5},t5={partial:!0,tokenize:i5};function n5(e,t,n){const r=this;let a;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return kx.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function o(v){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return yt(v)?Oo(e,f)(v):f(v)}function f(v){return Ex(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(t5,d,d)(v)}function d(v){return Xe(v)?et(e,_,"whitespace")(v):_(v)}function _(v){return v===null||Oe(v)?(e.exit("definition"),r.parser.defined.push(a),t(v)):n(v)}}function i5(e,t,n){return r;function r(o){return yt(o)?Oo(e,a)(o):n(o)}function a(o){return Ax(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Xe(o)?et(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Oe(o)?t(o):n(o)}}const r5={name:"hardBreakEscape",tokenize:s5};function s5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Oe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const a5={name:"headingAtx",resolve:o5,tokenize:l5};function o5(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function l5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||yt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(e.exit("atxHeading"),t(p)):Xe(p)?et(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||yt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const c5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a1=["pre","script","style","textarea"],u5={concrete:!0,name:"htmlFlow",resolveTo:d5,tokenize:p5},h5={partial:!0,tokenize:m5},f5={partial:!0,tokenize:g5};function d5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function p5(e,t,n){const r=this;let a,l,u,o,c;return f;function f(F){return p(F)}function p(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),d}function d(F){return F===33?(e.consume(F),_):F===47?(e.consume(F),l=!0,C):F===63?(e.consume(F),a=3,r.interrupt?t:M):sn(F)?(e.consume(F),u=String.fromCharCode(F),b):n(F)}function _(F){return F===45?(e.consume(F),a=2,v):F===91?(e.consume(F),a=5,o=0,w):sn(F)?(e.consume(F),a=4,r.interrupt?t:M):n(F)}function v(F){return F===45?(e.consume(F),r.interrupt?t:M):n(F)}function w(F){const Q="CDATA[";return F===Q.charCodeAt(o++)?(e.consume(F),o===Q.length?r.interrupt?t:G:w):n(F)}function C(F){return sn(F)?(e.consume(F),u=String.fromCharCode(F),b):n(F)}function b(F){if(F===null||F===47||F===62||yt(F)){const Q=F===47,re=u.toLowerCase();return!Q&&!l&&a1.includes(re)?(a=1,r.interrupt?t(F):G(F)):c5.includes(u.toLowerCase())?(a=6,Q?(e.consume(F),S):r.interrupt?t(F):G(F)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):l?x(F):y(F))}return F===45||en(F)?(e.consume(F),u+=String.fromCharCode(F),b):n(F)}function S(F){return F===62?(e.consume(F),r.interrupt?t:G):n(F)}function x(F){return Xe(F)?(e.consume(F),x):B(F)}function y(F){return F===47?(e.consume(F),B):F===58||F===95||sn(F)?(e.consume(F),E):Xe(F)?(e.consume(F),y):B(F)}function E(F){return F===45||F===46||F===58||F===95||en(F)?(e.consume(F),E):R(F)}function R(F){return F===61?(e.consume(F),N):Xe(F)?(e.consume(F),R):y(F)}function N(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),c=F,D):Xe(F)?(e.consume(F),N):T(F)}function D(F){return F===c?(e.consume(F),c=null,j):F===null||Oe(F)?n(F):(e.consume(F),D)}function T(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||yt(F)?R(F):(e.consume(F),T)}function j(F){return F===47||F===62||Xe(F)?y(F):n(F)}function B(F){return F===62?(e.consume(F),z):n(F)}function z(F){return F===null||Oe(F)?G(F):Xe(F)?(e.consume(F),z):n(F)}function G(F){return F===45&&a===2?(e.consume(F),q):F===60&&a===1?(e.consume(F),X):F===62&&a===4?(e.consume(F),O):F===63&&a===3?(e.consume(F),M):F===93&&a===5?(e.consume(F),L):Oe(F)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(h5,$,U)(F)):F===null||Oe(F)?(e.exit("htmlFlowData"),U(F)):(e.consume(F),G)}function U(F){return e.check(f5,H,$)(F)}function H(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),Y}function Y(F){return F===null||Oe(F)?U(F):(e.enter("htmlFlowData"),G(F))}function q(F){return F===45?(e.consume(F),M):G(F)}function X(F){return F===47?(e.consume(F),u="",K):G(F)}function K(F){if(F===62){const Q=u.toLowerCase();return a1.includes(Q)?(e.consume(F),O):G(F)}return sn(F)&&u.length<8?(e.consume(F),u+=String.fromCharCode(F),K):G(F)}function L(F){return F===93?(e.consume(F),M):G(F)}function M(F){return F===62?(e.consume(F),O):F===45&&a===2?(e.consume(F),M):G(F)}function O(F){return F===null||Oe(F)?(e.exit("htmlFlowData"),$(F)):(e.consume(F),O)}function $(F){return e.exit("htmlFlow"),t(F)}}function g5(e,t,n){const r=this;return a;function a(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function m5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ll,t,n)}}const _5={name:"htmlText",tokenize:v5};function v5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),R):M===63?(e.consume(M),y):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,w):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),_):Oe(M)?(u=d,X(M)):(e.consume(M),d)}function _(M){return M===45?(e.consume(M),v):d(M)}function v(M){return M===62?q(M):M===45?_(M):d(M)}function w(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?C:w):n(M)}function C(M){return M===null?n(M):M===93?(e.consume(M),b):Oe(M)?(u=C,X(M)):(e.consume(M),C)}function b(M){return M===93?(e.consume(M),S):C(M)}function S(M){return M===62?q(M):M===93?(e.consume(M),S):C(M)}function x(M){return M===null||M===62?q(M):Oe(M)?(u=x,X(M)):(e.consume(M),x)}function y(M){return M===null?n(M):M===63?(e.consume(M),E):Oe(M)?(u=y,X(M)):(e.consume(M),y)}function E(M){return M===62?q(M):y(M)}function R(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||en(M)?(e.consume(M),N):D(M)}function D(M){return Oe(M)?(u=D,X(M)):Xe(M)?(e.consume(M),D):q(M)}function T(M){return M===45||en(M)?(e.consume(M),T):M===47||M===62||yt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),q):M===58||M===95||sn(M)?(e.consume(M),B):Oe(M)?(u=j,X(M)):Xe(M)?(e.consume(M),j):q(M)}function B(M){return M===45||M===46||M===58||M===95||en(M)?(e.consume(M),B):z(M)}function z(M){return M===61?(e.consume(M),G):Oe(M)?(u=z,X(M)):Xe(M)?(e.consume(M),z):j(M)}function G(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,U):Oe(M)?(u=G,X(M)):Xe(M)?(e.consume(M),G):(e.consume(M),H)}function U(M){return M===a?(e.consume(M),a=void 0,Y):M===null?n(M):Oe(M)?(u=U,X(M)):(e.consume(M),U)}function H(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||yt(M)?j(M):(e.consume(M),H)}function Y(M){return M===47||M===62||yt(M)?j(M):n(M)}function q(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Xe(M)?et(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const Rg={name:"labelEnd",resolveAll:x5,resolveTo:w5,tokenize:C5},y5={tokenize:E5},b5={tokenize:k5},S5={tokenize:A5};function x5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Tn(e,0,e.length,n),e}function w5(e,t){let n=e.length,r=0,a,l,u,o;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,t],["enter",f,t]],o=Gn(o,e.slice(l+1,l+r+3)),o=Gn(o,[["enter",p,t]]),o=Gn(o,Yu(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),o=Gn(o,[["exit",p,t],e[u-2],e[u-1],["exit",f,t]]),o=Gn(o,e.slice(u+1)),o=Gn(o,[["exit",c,t]]),Tn(e,l,e.length,o),e}function C5(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return o;function o(_){return l?l._inactive?d(_):(u=r.parser.defined.includes(Jn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),c):n(_)}function c(_){return _===40?e.attempt(y5,p,u?p:d)(_):_===91?e.attempt(b5,p,u?f:d)(_):u?p(_):d(_)}function f(_){return e.attempt(S5,p,d)(_)}function p(_){return t(_)}function d(_){return l._balanced=!0,n(_)}}function E5(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),a}function a(d){return yt(d)?Oo(e,l)(d):l(d)}function l(d){return d===41?p(d):Ex(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function u(d){return yt(d)?Oo(e,c)(d):p(d)}function o(d){return n(d)}function c(d){return d===34||d===39||d===40?Ax(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function f(d){return yt(d)?Oo(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function k5(e,t,n){const r=this;return a;function a(o){return kx.call(r,e,l,u,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function u(o){return n(o)}}function A5(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const N5={name:"labelStartImage",resolveAll:Rg.resolveAll,tokenize:T5};function T5(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):n(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const R5={name:"labelStartLink",resolveAll:Rg.resolveAll,tokenize:D5};function D5(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Xd={name:"lineEnding",tokenize:M5};function M5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,t,"linePrefix")}}const uu={name:"thematicBreak",tokenize:j5};function j5(e,t,n){let r=0,a;return l;function l(f){return e.enter("thematicBreak"),u(f)}function u(f){return a=f,o(f)}function o(f){return f===a?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||Oe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Xe(f)?et(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:I5},exit:H5,name:"list",tokenize:B5},L5={partial:!0,tokenize:F5},O5={partial:!0,tokenize:z5};function B5(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Op(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(uu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return Op(v)&&++u<10?(e.consume(v),c):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(ll,r.interrupt?n:p,e.attempt(L5,_,d))}function p(v){return r.containerState.initialBlankLine=!0,l++,_(v)}function d(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),_):n(v)}function _(v){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function I5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ll,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(O5,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function z5(e,t,n){const r=this;return et(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function H5(e){e.exit(this.containerState.type)}function F5(e,t,n){const r=this;return et(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const o1={name:"setextUnderline",resolveTo:P5,tokenize:U5};function P5(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function U5(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Xe(f)?et(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Oe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const $5={tokenize:G5};function G5(e){const t=this,n=e.attempt(ll,r,e.attempt(this.parser.constructs.flowInitial,a,et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(X3,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const q5={resolveAll:Tx()},V5=Nx("string"),Y5=Nx("text");function Nx(e){return{resolveAll:Tx(e==="text"?W5:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let _=-1;if(d)for(;++_<d.length;){const v=d[_];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Tx(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function W5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,o=0,c;for(;l--;){const f=a[l];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(f===-2)c=!0,o++;else if(f!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const f={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const X5={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:Sx},K5={91:e5},Z5={[-2]:Wd,[-1]:Wd,32:Wd},Q5={35:a5,42:uu,45:[o1,uu],60:u5,61:o1,95:uu,96:s1,126:s1},J5={38:wx,92:xx},e4={[-5]:Xd,[-4]:Xd,[-3]:Xd,33:N5,38:wx,42:Bp,60:[R3,_5],91:R5,92:[r5,xx],93:Rg,95:Bp,96:$3},t4={null:[Bp,q5]},n4={null:[42,95]},i4={null:[]},r4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n4,contentInitial:K5,disable:i4,document:X5,flow:Q5,flowInitial:Z5,insideSpan:t4,string:J5,text:e4},Symbol.toStringTag,{value:"Module"}));function s4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],o=[];const c={attempt:D(R),check:D(N),consume:x,enter:y,exit:E,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:v,write:d};let p=t.tokenize.call(f,c);return t.resolveAll&&l.push(t),f;function d(z){return u=Gn(u,z),b(),u[u.length-1]!==null?[]:(T(t,0),f.events=Yu(l,f.events,f),f.events)}function _(z,G){return o4(v(z),G)}function v(z){return a4(u,z)}function w(){const{_bufferIndex:z,_index:G,line:U,column:H,offset:Y}=r;return{_bufferIndex:z,_index:G,line:U,column:H,offset:Y}}function C(z){a[z.line]=z.column,B()}function b(){let z;for(;r._index<u.length;){const G=u[r._index];if(typeof G=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<G.length;)S(G.charCodeAt(r._bufferIndex));else S(G)}}function S(z){p=p(z)}function x(z){Oe(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,B()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=z}function y(z,G){const U=G||{};return U.type=z,U.start=w(),f.events.push(["enter",U,f]),o.push(U),U}function E(z){const G=o.pop();return G.end=w(),f.events.push(["exit",G,f]),G}function R(z,G){T(z,G.from)}function N(z,G){G.restore()}function D(z,G){return U;function U(H,Y,q){let X,K,L,M;return Array.isArray(H)?$(H):"tokenize"in H?$([H]):O(H);function O(ae){return Z;function Z(P){const ee=P!==null&&ae[P],ne=P!==null&&ae.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return $(ge)(P)}}function $(ae){return X=ae,K=0,ae.length===0?q:F(ae[K])}function F(ae){return Z;function Z(P){return M=j(),L=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(G?Object.assign(Object.create(f),G):f,c,Q,re)(P)}}function Q(ae){return z(L,M),Y}function re(ae){return M.restore(),++K<X.length?F(X[K]):q}}}function T(z,G){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Tn(f.events,G,f.events.length-G,z.resolve(f.events.slice(G),f)),z.resolveTo&&(f.events=z.resolveTo(f.events,f))}function j(){const z=w(),G=f.previous,U=f.currentConstruct,H=f.events.length,Y=Array.from(o);return{from:H,restore:q};function q(){r=z,f.previous=G,f.currentConstruct=U,f.events.length=H,o=Y,B()}}function B(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function a4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function o4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=` `;break}case-3:{u=`\r -`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function f4(e){const r={constructs:Sx([l4,...(e||{}).extensions||[]]),content:a(A3),defined:[],document:a(T3),flow:a(Y5),lazy:{},string:a(K5),text:a(Z5)};return r;function a(l){return u;function u(o){return c4(r,l,o)}}}function d4(e){for(;!kx(e););return e}const l1=/[\0\t\n\r]/g;function p4(){let e=1,t="",n=!0,r;return a;function a(l,u,o){const c=[];let f,p,d,_,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),d=0,t="",n&&(l.charCodeAt(0)===65279&&d++,n=void 0);d<l.length;){if(l1.lastIndex=d,f=l1.exec(l),_=f&&f.index!==void 0?f.index:l.length,v=l.charCodeAt(_),!f){t=l.slice(d);break}if(v===10&&d===_&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<_&&(c.push(l.slice(d,_)),e+=_-d),v){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=_+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const g4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m4(e){return e.replace(g4,_4)}function _4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return xx(n.slice(l?2:1),l?16:10)}return $o(n)||e}const Mx={}.hasOwnProperty;function v4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),y4(n)(d4(f4(n).document().write(p4()(e,t,!0))))}function y4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(bt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(ke),blockQuote:l(ne),characterEscape:j,characterReference:j,codeFenced:l(ge),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(ge,u),codeText:l(he,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(ye),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(be),hardBreakEscape:l(Ee),hardBreakTrailing:l(Ee),htmlFlow:l(Ce,u),htmlFlowData:j,htmlText:l(Ce,u),htmlTextData:j,image:l(rt),label:u,link:l(bt),listItem:l(ct),listItemValue:_,listOrdered:l(Ge,d),listUnordered:l(Ge),paragraph:l(Pt),reference:U,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ke),strong:l(ht),thematicBreak:l(fe)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:ee,autolinkProtocol:P,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:Z,codeFenced:c(b),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:c(S),codeText:c(V),codeTextData:B,data:B,definition:c(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(Y),hardBreakTrailing:c(Y),htmlFlow:c(H),htmlFlowData:B,htmlText:c(z),htmlTextData:B,image:c(X),label:L,labelText:K,lineEnding:F,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:M,resourceTitleString:O,resource:$,setextHeading:c(T),setextHeadingLineSequence:D,setextHeadingText:N,strong:c(),thematicBreak:c()}};jx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let de={type:"root",children:[]};const Se={stack:[de],tokenStack:[],config:t,enter:o,exit:f,buffer:u,resume:p,data:n},Ae=[];let De=-1;for(;++De<ie.length;)if(ie[De][1].type==="listOrdered"||ie[De][1].type==="listUnordered")if(ie[De][0]==="enter")Ae.push(De);else{const Ve=Ae.pop();De=a(ie,Ve,De)}for(De=-1;++De<ie.length;){const Ve=t[ie[De][0]];Mx.call(Ve,ie[De][1].type)&&Ve[ie[De][1].type].call(Object.assign({sliceSerialize:ie[De][2].sliceSerialize},Se),ie[De][1])}if(Se.tokenStack.length>0){const Ve=Se.tokenStack[Se.tokenStack.length-1];(Ve[1]||c1).call(Se,void 0,Ve[0])}for(de.position={start:xr(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:xr(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De<t.transforms.length;)de=t.transforms[De](de)||de;return de}function a(ie,de,Se){let Ae=de-1,De=-1,Ve=!1,Ie,Nt,Et,qt;for(;++Ae<=Se;){const st=ie[Ae];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?De++:De--,qt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Ie&&!qt&&!De&&!Et&&(Et=Ae),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!De&&st[0]==="enter"&&st[1].type==="listItemPrefix"||De===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Ie){let Ln=Ae;for(Nt=void 0;Ln--;){const Ut=ie[Ln];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Nt&&(ie[Nt][1].type="lineEndingBlank",Ve=!0),Ut[1].type="lineEnding",Nt=Ln}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}Et&&(!Nt||Et<Nt)&&(Ie._spread=!0),Ie.end=Object.assign({},Nt?ie[Nt][1].start:st[1].end),ie.splice(Nt||Ae,0,["exit",Ie,st[2]]),Ae++,Se++}if(st[1].type==="listItemPrefix"){const Ln={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Ie=Ln,ie.splice(Ae,0,["enter",Ln,st[2]]),Ae++,Se++,Et=void 0,qt=!0}}}return ie[de][1]._spread=Ve,Se}function l(ie,de){return Se;function Se(Ae){o.call(this,ie(Ae),Ae),de&&de.call(this,Ae)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(ie,de,Se){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([de,Se||void 0]),ie.position={start:xr(de.start),end:void 0}}function c(ie){return de;function de(Se){ie&&ie.call(this,Se),f.call(this,Se)}}function f(ie,de){const Se=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ie.type&&(de?de.call(this,ie,Ae[0]):(Ae[1]||c1).call(this,ie,Ae[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Lo({start:ie.start,end:ie.end})+"): it’s not open");Se.position.end=xr(ie.end)}function p(){return Tg(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function _(ie){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.lang=ie}function w(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/(\r?\n|\r)$/g,"")}function x(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase()}function y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function E(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function R(ie){const de=this.stack[this.stack.length-1];if(!de.depth){const Se=this.sliceSerialize(ie).length;de.depth=Se}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ie){const Se=this.stack[this.stack.length-1].children;let Ae=Se[Se.length-1];(!Ae||Ae.type!=="text")&&(Ae=Fe(),Ae.position={start:xr(ie.start),end:void 0},Se.push(Ae)),this.stack.push(Ae)}function B(ie){const de=this.stack.pop();de.value+=this.sliceSerialize(ie),de.position.end=xr(ie.end)}function F(ie){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=de.children[de.children.length-1];Se.position.end=xr(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(j.call(this,ie),B.call(this,ie))}function Y(){this.data.atHardBreak=!0}function H(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function z(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function V(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function G(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const de=this.sliceSerialize(ie),Se=this.stack[this.stack.length-2];Se.label=m4(de),Se.identifier=Jn(de).toLowerCase()}function L(){const ie=this.stack[this.stack.length-1],de=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ae=ie.children;Se.children=Ae}else Se.alt=de}function M(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function O(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function $(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function Q(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function re(ie){this.data.characterReferenceType=ie.type}function ae(ie){const de=this.sliceSerialize(ie),Se=this.data.characterReferenceType;let Ae;Se?(Ae=xx(de,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=$o(de);const De=this.stack[this.stack.length-1];De.value+=Ae}function Z(ie){const de=this.stack.pop();de.position.end=xr(ie.end)}function P(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ie)}function ee(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ie)}function ne(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ct(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function ht(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function jx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jx(e,r):b4(e,r)}}function b4(e,t){let n;for(n in t)if(Mx.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function c1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is still open")}function S4(e){const t=this;t.parser=n;function n(r){return v4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function x4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function w4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function C4(e,t){const n=t.value?t.value+` -`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function E4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wa(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function N4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lx(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function R4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lx(e,t);const a={src:wa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function D4(e,t){const n={src:wa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function M4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function j4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lx(e,t);const a={href:wa(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function L4(e,t){const n={href:wa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function O4(e,t,n){const r=e.all(t),a=n?B4(n):Ox(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(a||o!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:` +`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function l4(e){const r={constructs:yx([r4,...(e||{}).extensions||[]]),content:a(w3),defined:[],document:a(E3),flow:a($5),lazy:{},string:a(V5),text:a(Y5)};return r;function a(l){return u;function u(o){return s4(r,l,o)}}}function c4(e){for(;!Cx(e););return e}const l1=/[\0\t\n\r]/g;function u4(){let e=1,t="",n=!0,r;return a;function a(l,u,o){const c=[];let f,p,d,_,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),d=0,t="",n&&(l.charCodeAt(0)===65279&&d++,n=void 0);d<l.length;){if(l1.lastIndex=d,f=l1.exec(l),_=f&&f.index!==void 0?f.index:l.length,v=l.charCodeAt(_),!f){t=l.slice(d);break}if(v===10&&d===_&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<_&&(c.push(l.slice(d,_)),e+=_-d),v){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=_+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const h4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f4(e){return e.replace(h4,d4)}function d4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return bx(n.slice(l?2:1),l?16:10)}return $o(n)||e}const Rx={}.hasOwnProperty;function p4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),g4(n)(c4(l4(n).document().write(u4()(e,t,!0))))}function g4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(bt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(ke),blockQuote:l(ne),characterEscape:j,characterReference:j,codeFenced:l(ge),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(ge,u),codeText:l(he,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(ye),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(be),hardBreakEscape:l(Ee),hardBreakTrailing:l(Ee),htmlFlow:l(Ce,u),htmlFlowData:j,htmlText:l(Ce,u),htmlTextData:j,image:l(rt),label:u,link:l(bt),listItem:l(ct),listItemValue:_,listOrdered:l(Ge,d),listUnordered:l(Ge),paragraph:l(Pt),reference:F,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ke),strong:l(ht),thematicBreak:l(fe)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:ee,autolinkProtocol:P,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:Z,codeFenced:c(b),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:c(S),codeText:c(Y),codeTextData:B,data:B,definition:c(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(G),hardBreakTrailing:c(G),htmlFlow:c(U),htmlFlowData:B,htmlText:c(H),htmlTextData:B,image:c(X),label:L,labelText:K,lineEnding:z,link:c(q),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:M,resourceTitleString:O,resource:$,setextHeading:c(T),setextHeadingLineSequence:D,setextHeadingText:N,strong:c(),thematicBreak:c()}};Dx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let de={type:"root",children:[]};const Se={stack:[de],tokenStack:[],config:t,enter:o,exit:f,buffer:u,resume:p,data:n},Ae=[];let De=-1;for(;++De<ie.length;)if(ie[De][1].type==="listOrdered"||ie[De][1].type==="listUnordered")if(ie[De][0]==="enter")Ae.push(De);else{const Ve=Ae.pop();De=a(ie,Ve,De)}for(De=-1;++De<ie.length;){const Ve=t[ie[De][0]];Rx.call(Ve,ie[De][1].type)&&Ve[ie[De][1].type].call(Object.assign({sliceSerialize:ie[De][2].sliceSerialize},Se),ie[De][1])}if(Se.tokenStack.length>0){const Ve=Se.tokenStack[Se.tokenStack.length-1];(Ve[1]||c1).call(Se,void 0,Ve[0])}for(de.position={start:xr(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:xr(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De<t.transforms.length;)de=t.transforms[De](de)||de;return de}function a(ie,de,Se){let Ae=de-1,De=-1,Ve=!1,Ie,Nt,Ct,qt;for(;++Ae<=Se;){const st=ie[Ae];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?De++:De--,qt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Ie&&!qt&&!De&&!Ct&&(Ct=Ae),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!De&&st[0]==="enter"&&st[1].type==="listItemPrefix"||De===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Ie){let Ln=Ae;for(Nt=void 0;Ln--;){const Ut=ie[Ln];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Nt&&(ie[Nt][1].type="lineEndingBlank",Ve=!0),Ut[1].type="lineEnding",Nt=Ln}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}Ct&&(!Nt||Ct<Nt)&&(Ie._spread=!0),Ie.end=Object.assign({},Nt?ie[Nt][1].start:st[1].end),ie.splice(Nt||Ae,0,["exit",Ie,st[2]]),Ae++,Se++}if(st[1].type==="listItemPrefix"){const Ln={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Ie=Ln,ie.splice(Ae,0,["enter",Ln,st[2]]),Ae++,Se++,Ct=void 0,qt=!0}}}return ie[de][1]._spread=Ve,Se}function l(ie,de){return Se;function Se(Ae){o.call(this,ie(Ae),Ae),de&&de.call(this,Ae)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(ie,de,Se){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([de,Se||void 0]),ie.position={start:xr(de.start),end:void 0}}function c(ie){return de;function de(Se){ie&&ie.call(this,Se),f.call(this,Se)}}function f(ie,de){const Se=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ie.type&&(de?de.call(this,ie,Ae[0]):(Ae[1]||c1).call(this,ie,Ae[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Lo({start:ie.start,end:ie.end})+"): it’s not open");Se.position.end=xr(ie.end)}function p(){return Tg(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function _(ie){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.lang=ie}function w(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/(\r?\n|\r)$/g,"")}function x(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase()}function y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function E(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function R(ie){const de=this.stack[this.stack.length-1];if(!de.depth){const Se=this.sliceSerialize(ie).length;de.depth=Se}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ie){const Se=this.stack[this.stack.length-1].children;let Ae=Se[Se.length-1];(!Ae||Ae.type!=="text")&&(Ae=Fe(),Ae.position={start:xr(ie.start),end:void 0},Se.push(Ae)),this.stack.push(Ae)}function B(ie){const de=this.stack.pop();de.value+=this.sliceSerialize(ie),de.position.end=xr(ie.end)}function z(ie){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=de.children[de.children.length-1];Se.position.end=xr(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(j.call(this,ie),B.call(this,ie))}function G(){this.data.atHardBreak=!0}function U(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function H(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function Y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function q(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const de=this.sliceSerialize(ie),Se=this.stack[this.stack.length-2];Se.label=f4(de),Se.identifier=Jn(de).toLowerCase()}function L(){const ie=this.stack[this.stack.length-1],de=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ae=ie.children;Se.children=Ae}else Se.alt=de}function M(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function O(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function $(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function re(ie){this.data.characterReferenceType=ie.type}function ae(ie){const de=this.sliceSerialize(ie),Se=this.data.characterReferenceType;let Ae;Se?(Ae=bx(de,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=$o(de);const De=this.stack[this.stack.length-1];De.value+=Ae}function Z(ie){const de=this.stack.pop();de.position.end=xr(ie.end)}function P(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ie)}function ee(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ie)}function ne(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ct(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function ht(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function Dx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Dx(e,r):m4(e,r)}}function m4(e,t){let n;for(n in t)if(Rx.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function c1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is still open")}function _4(e){const t=this;t.parser=n;function n(r){return p4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function v4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function y4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function b4(e,t){const n=t.value?t.value+` +`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function S4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wa(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function C4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Mx(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function k4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mx(e,t);const a={src:wa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function A4(e,t){const n={src:wa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function N4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function T4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mx(e,t);const a={href:wa(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function R4(e,t){const n={href:wa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function D4(e,t,n){const r=e.all(t),a=n?M4(n):jx(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(a||o!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:` `}),p.type==="element"&&p.tagName==="p"&&!a?u.push(...p.children):u.push(p)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&u.push({type:"text",value:` -`});const f={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,f),e.applyData(t,f)}function B4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ox(n[r])}return t}function Ox(e){const t=e.spread;return t??e.children.length>1}function I4(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function z4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function F4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P4(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Eg(t.children[1]),c=px(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function U4(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c<o;){const d=t.children[c],_={},v=u?u[c]:void 0;v&&(_.align=v);let w={type:"element",tagName:l,properties:_,children:[]};d&&(w.children=e.all(d),e.patch(d,w),w=e.applyData(d,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function $4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const u1=9,h1=32;function G4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(f1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(f1(t.slice(a),a>0,!1)),l.join("")}function f1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===u1||l===h1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===u1||l===h1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function q4(e,t){const n={type:"text",value:G4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function V4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Y4={blockquote:x4,break:w4,code:C4,delete:E4,emphasis:k4,footnoteReference:A4,heading:N4,html:T4,imageReference:R4,image:D4,inlineCode:M4,linkReference:j4,link:L4,listItem:O4,list:I4,paragraph:z4,root:H4,strong:F4,table:P4,tableCell:$4,tableRow:U4,text:q4,thematicBreak:V4,toml:Hc,yaml:Hc,definition:Hc,footnoteDefinition:Hc};function Hc(){}const Bx=-1,Wu=0,Bo=1,Cu=2,Dg=3,Mg=4,jg=5,Lg=6,Ix=7,zx=8,Hx=typeof self=="object"?self:globalThis,d1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Hx[e](t)},W4=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case Wu:case Bx:return n(u,a);case Bo:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Cu:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case Dg:return n(new Date(u),a);case Mg:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case jg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case Lg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Ix:{const{name:o,message:c}=u;return n(typeof Hx[o]=="function"?d1(o,c):new Error(c),a)}case zx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(d1(l,u),a)};return r},p1=e=>W4(new Map,e)(0),Xr="",{toString:X4}={},{keys:K4}=Object,Ao=e=>{const t=typeof e;if(t!=="object"||!e)return[Wu,t];const n=X4.call(e).slice(8,-1);switch(n){case"Array":return[Bo,Xr];case"Object":return[Cu,Xr];case"Date":return[Dg,Xr];case"RegExp":return[Mg,Xr];case"Map":return[jg,Xr];case"Set":return[Lg,Xr];case"DataView":return[Bo,n]}return n.includes("Array")?[Bo,n]:e instanceof Error?[Ix,e.name||"Error"]:[Cu,n]},Fc=([e,t])=>e===Wu&&(t==="function"||t==="symbol"),Z4=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=Ao(u);switch(o){case Wu:{let p=u;switch(c){case"bigint":o=zx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Bx],u)}return a([o,p],u)}case Bo:{if(c){let _=u;return c==="DataView"?_=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(_=new Uint8Array(u)),a([c,[..._]],u)}const p=[],d=a([o,p],u);for(const _ of u)p.push(l(_));return d}case Cu:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const _ of K4(u))(e||!Fc(Ao(u[_])))&&p.push([l(_),l(u[_])]);return d}case Dg:return a([o,isNaN(u.getTime())?Xr:u.toISOString()],u);case Mg:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case jg:{const p=[],d=a([o,p],u);for(const[_,v]of u)(e||!(Fc(Ao(_))||Fc(Ao(v))))&&p.push([l(_),l(v)]);return d}case Lg:{const p=[],d=a([o,p],u);for(const _ of u)(e||!Fc(Ao(_)))&&p.push(l(_));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},g1=(e,{json:t,lossy:n}={})=>{const r=[];return Z4(!(t||n),!!t,new Map,r)(e),r},Eu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?p1(g1(e,t)):structuredClone(e):(e,t)=>p1(g1(e,t));function Q4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function J4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Q4,r=e.options.footnoteBackLabel||J4,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const p=e.all(f),d=String(f.identifier).toUpperCase(),_=wa(d.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(d);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,v);typeof x=="string"&&(x={type:"text",value:x}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(f,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Eu(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` +`});const f={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,f),e.applyData(t,f)}function M4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=jx(n[r])}return t}function jx(e){const t=e.spread;return t??e.children.length>1}function j4(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function L4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function B4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I4(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Eg(t.children[1]),c=fx(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function z4(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c<o;){const d=t.children[c],_={},v=u?u[c]:void 0;v&&(_.align=v);let w={type:"element",tagName:l,properties:_,children:[]};d&&(w.children=e.all(d),e.patch(d,w),w=e.applyData(d,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function H4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const u1=9,h1=32;function F4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(f1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(f1(t.slice(a),a>0,!1)),l.join("")}function f1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===u1||l===h1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===u1||l===h1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function P4(e,t){const n={type:"text",value:F4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function U4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $4={blockquote:v4,break:y4,code:b4,delete:S4,emphasis:x4,footnoteReference:w4,heading:C4,html:E4,imageReference:k4,image:A4,inlineCode:N4,linkReference:T4,link:R4,listItem:D4,list:j4,paragraph:L4,root:O4,strong:B4,table:I4,tableCell:H4,tableRow:z4,text:P4,thematicBreak:U4,toml:Hc,yaml:Hc,definition:Hc,footnoteDefinition:Hc};function Hc(){}const Lx=-1,Wu=0,Bo=1,Cu=2,Dg=3,Mg=4,jg=5,Lg=6,Ox=7,Bx=8,G4=typeof self=="object"?self:globalThis,d1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new G4[e](t)},q4=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case Wu:case Lx:return n(u,a);case Bo:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Cu:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case Dg:return n(new Date(u),a);case Mg:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case jg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case Lg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Ox:{const{name:o,message:c}=u;return n(d1(o,c),a)}case Bx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(d1(l,u),a)};return r},p1=e=>q4(new Map,e)(0),Xr="",{toString:V4}={},{keys:Y4}=Object,Ao=e=>{const t=typeof e;if(t!=="object"||!e)return[Wu,t];const n=V4.call(e).slice(8,-1);switch(n){case"Array":return[Bo,Xr];case"Object":return[Cu,Xr];case"Date":return[Dg,Xr];case"RegExp":return[Mg,Xr];case"Map":return[jg,Xr];case"Set":return[Lg,Xr];case"DataView":return[Bo,n]}return n.includes("Array")?[Bo,n]:n.includes("Error")?[Ox,n]:[Cu,n]},Fc=([e,t])=>e===Wu&&(t==="function"||t==="symbol"),W4=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=Ao(u);switch(o){case Wu:{let p=u;switch(c){case"bigint":o=Bx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Lx],u)}return a([o,p],u)}case Bo:{if(c){let _=u;return c==="DataView"?_=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(_=new Uint8Array(u)),a([c,[..._]],u)}const p=[],d=a([o,p],u);for(const _ of u)p.push(l(_));return d}case Cu:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const _ of Y4(u))(e||!Fc(Ao(u[_])))&&p.push([l(_),l(u[_])]);return d}case Dg:return a([o,isNaN(u.getTime())?Xr:u.toISOString()],u);case Mg:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case jg:{const p=[],d=a([o,p],u);for(const[_,v]of u)(e||!(Fc(Ao(_))||Fc(Ao(v))))&&p.push([l(_),l(v)]);return d}case Lg:{const p=[],d=a([o,p],u);for(const _ of u)(e||!Fc(Ao(_)))&&p.push(l(_));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},g1=(e,{json:t,lossy:n}={})=>{const r=[];return W4(!(t||n),!!t,new Map,r)(e),r},Eu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?p1(g1(e,t)):structuredClone(e):(e,t)=>p1(g1(e,t));function X4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function K4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Z4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||X4,r=e.options.footnoteBackLabel||K4,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const p=e.all(f),d=String(f.identifier).toUpperCase(),_=wa(d.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(d);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,v);typeof x=="string"&&(x={type:"text",value:x}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(f,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Eu(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const Xu=(function(e){if(e==null)return rR;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?tR(e):nR(e);if(typeof e=="string")return iR(e);throw new Error("Expected function, string, or object as test")});function tR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Ku(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function nR(e){const t=e;return Ku(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function iR(e){return Ku(t);function t(n){return n&&n.type===e}}function Ku(e){return t;function t(n,r,a){return!!(sR(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function rR(){return!0}function sR(e){return e!==null&&typeof e=="object"&&"type"in e}const Fx=[],aR=!0,Ip=!1,oR="skip";function Px(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=Xu(a),u=r?-1:1;o(e,void 0,[])();function o(c,f,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=Fx,w,C,b;if((!t||l(c,f,p[p.length-1]||void 0))&&(v=lR(n(c,p)),v[0]===Ip))return v;if("children"in c&&c.children){const S=c;if(S.children&&v[0]!==oR)for(C=(r?S.children.length:-1)+u,b=p.concat(S);C>-1&&C<S.children.length;){const x=S.children[C];if(w=o(x,C,b)(),w[0]===Ip)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function lR(e){return Array.isArray(e)?e:typeof e=="number"?[aR,e]:e==null?Fx:[e]}function Og(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),Px(e,l,o,a);function o(c,f){const p=f[f.length-1],d=p?p.children.indexOf(c):void 0;return u(c,d,p)}}const zp={}.hasOwnProperty,cR={};function uR(e,t){const n=t||cR,r=new Map,a=new Map,l=new Map,u={...Y4,...n.handlers},o={all:f,applyData:fR,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:c,options:n,patch:hR,wrap:pR};return Og(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:a,_=String(p.identifier).toUpperCase();d.has(_)||d.set(_,p)}}),o;function c(p,d){const _=p.type,v=o.handlers[_];if(zp.call(o.handlers,_)&&v)return v(o,p,d);if(o.options.passThrough&&o.options.passThrough.includes(_)){if("children"in p){const{children:C,...b}=p,S=Eu(b);return S.children=o.all(p),S}return Eu(p)}return(o.options.unknownHandler||dR)(o,p,d)}function f(p){const d=[];if("children"in p){const _=p.children;let v=-1;for(;++v<_.length;){const w=o.one(_[v],p);if(w){if(v&&_[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=m1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=m1(C.value))}Array.isArray(w)?d.push(...w):d.push(w)}}}return d}}function hR(e,t){e.position&&(t.position=JT(e))}function fR(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,Eu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function dR(e,t){const n=t.data||{},r="value"in t&&!(zp.call(n,"hProperties")||zp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pR(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:` +`}]}}const Xu=(function(e){if(e==null)return tR;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?Q4(e):J4(e);if(typeof e=="string")return eR(e);throw new Error("Expected function, string, or object as test")});function Q4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Ku(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function J4(e){const t=e;return Ku(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function eR(e){return Ku(t);function t(n){return n&&n.type===e}}function Ku(e){return t;function t(n,r,a){return!!(nR(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function tR(){return!0}function nR(e){return e!==null&&typeof e=="object"&&"type"in e}const Ix=[],iR=!0,Ip=!1,rR="skip";function zx(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=Xu(a),u=r?-1:1;o(e,void 0,[])();function o(c,f,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=Ix,w,C,b;if((!t||l(c,f,p[p.length-1]||void 0))&&(v=sR(n(c,p)),v[0]===Ip))return v;if("children"in c&&c.children){const S=c;if(S.children&&v[0]!==rR)for(C=(r?S.children.length:-1)+u,b=p.concat(S);C>-1&&C<S.children.length;){const x=S.children[C];if(w=o(x,C,b)(),w[0]===Ip)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function sR(e){return Array.isArray(e)?e:typeof e=="number"?[iR,e]:e==null?Ix:[e]}function Og(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),zx(e,l,o,a);function o(c,f){const p=f[f.length-1],d=p?p.children.indexOf(c):void 0;return u(c,d,p)}}const zp={}.hasOwnProperty,aR={};function oR(e,t){const n=t||aR,r=new Map,a=new Map,l=new Map,u={...$4,...n.handlers},o={all:f,applyData:cR,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:c,options:n,patch:lR,wrap:hR};return Og(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:a,_=String(p.identifier).toUpperCase();d.has(_)||d.set(_,p)}}),o;function c(p,d){const _=p.type,v=o.handlers[_];if(zp.call(o.handlers,_)&&v)return v(o,p,d);if(o.options.passThrough&&o.options.passThrough.includes(_)){if("children"in p){const{children:C,...b}=p,S=Eu(b);return S.children=o.all(p),S}return Eu(p)}return(o.options.unknownHandler||uR)(o,p,d)}function f(p){const d=[];if("children"in p){const _=p.children;let v=-1;for(;++v<_.length;){const w=o.one(_[v],p);if(w){if(v&&_[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=m1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=m1(C.value))}Array.isArray(w)?d.push(...w):d.push(w)}}}return d}}function lR(e,t){e.position&&(t.position=XT(e))}function cR(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,Eu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function uR(e,t){const n=t.data||{},r="value"in t&&!(zp.call(n,"hProperties")||zp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hR(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:` `});++r<e.length;)r&&n.push({type:"text",value:` `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:` -`}),n}function m1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _1(e,t){const n=uR(e,t),r=n.one(e,void 0),a=eR(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` -`},a),l}function gR(e,t){return e&&"run"in e?async function(n,r){const a=_1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return _1(n,{file:r,...e||t})}}function v1(e){if(e)throw e}var Kd,y1;function mR(){if(y1)return Kd;y1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var _;for(_ in f);return typeof _>"u"||e.call(f,_)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Kd=function c(){var f,p,d,_,v,w,C=arguments[0],b=1,S=arguments.length,x=!1;for(typeof C=="boolean"&&(x=C,C=arguments[1]||{},b=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});b<S;++b)if(f=arguments[b],f!=null)for(p in f)d=o(C,p),_=o(f,p),C!==_&&(x&&_&&(l(_)||(v=a(_)))?(v?(v=!1,w=d&&a(d)?d:[]):w=d&&l(d)?d:{},u(C,{name:p,newValue:c(x,w,_)})):typeof _<"u"&&u(C,{name:p,newValue:_}));return C},Kd}var _R=mR();const Zd=Pu(_R);function Hp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vR(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...a);function o(c,...f){const p=e[++l];let d=-1;if(c){u(c);return}for(;++d<a.length;)(f[d]===null||f[d]===void 0)&&(f[d]=a[d]);a=f,p?yR(p,o)(...f):u(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function yR(e,t){let n;return r;function r(...u){const o=e.length>u.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const li={basename:bR,dirname:SR,extname:xR,join:wR,sep:"/"};function bR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function SR(e){if(cl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xR(e){cl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function wR(...e){let t=-1,n;for(;++t<e.length;)cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":CR(n)}function CR(e){cl(e);const t=e.codePointAt(0)===47;let n=ER(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ER(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kR={cwd:AR};function AR(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NR(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return TR(e)}function TR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Qd=["history","path","basename","stem","extname","dirname"];class Ux{constructor(t){let n;t?Fp(t)?n={path:t}:typeof t=="string"||RR(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qd.length;){const l=Qd[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Qd.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){ep(t,"basename"),Jd(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){b1(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(Jd(t,"extname"),b1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fp(t)&&(t=NR(t)),ep(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){ep(t,"stem"),Jd(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new tn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Jd(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function ep(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function b1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function RR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DR=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),MR={}.hasOwnProperty;class Bg extends DR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vR()}copy(){const t=new Bg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ip("data",this.frozen),this.namespace[t]=n,this):MR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ip("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pc(t),r=this.parser||this.Parser;return tp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tp("process",this.parser||this.Parser),np("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const o=Pc(t),c=r.parse(o);r.run(c,o,function(p,d,_){if(p||!d||!_)return f(p);const v=d,w=r.stringify(v,_);OR(w)?_.value=w:_.result=w,f(p,_)});function f(p,d){p||!d?u(p):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),tp("processSync",this.parser||this.Parser),np("processSync",this.compiler||this.Compiler),this.process(t,a),x1("processSync","process",n),r;function a(l,u){n=!0,v1(l),r=u}}run(t,n,r){S1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,o){const c=Pc(n);a.run(t,c,f);function f(p,d,_){const v=d||t;p?o(p):u?u(v):r(void 0,v,_)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),x1("runSync","run",r),a;function l(u,o){v1(u),a=o,r=!0}}stringify(t,n){this.freeze();const r=Pc(n),a=this.compiler||this.Compiler;return np("stringify",a),S1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(ip("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...d]=f;c(p,d)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(f.plugins),f.settings&&(a.settings=Zd(!0,a.settings,f.settings))}function o(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const d=f[p];l(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,p){let d=-1,_=-1;for(;++d<r.length;)if(r[d][0]===f){_=d;break}if(_===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const C=r[_][1];Hp(C)&&Hp(v)&&(v=Zd(!0,C,v)),r[_]=[f,v,...w]}}}}const jR=new Bg().freeze();function tp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function np(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ip(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!Hp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pc(e){return LR(e)?e:new Ux(e)}function LR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OR(e){return typeof e=="string"||BR(e)}function BR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const IR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],C1={allowDangerousHtml:!0},zR=/^(https?|ircs?|mailto|xmpp)$/i,HR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $x(e){const t=FR(e),n=PR(e);return UR(t.runSync(t.parse(n),n),e)}function FR(e){const t=e.rehypePlugins||w1,n=e.remarkPlugins||w1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return jR().use(S4).use(n).use(gR,r).use(t)}function PR(e){const t=e.children||"",n=new Ux;return typeof t=="string"&&(n.value=t),n}function UR(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||$R;for(const p of HR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+IR+p.id,void 0);return Og(e,f),r3(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,d,_){if(p.type==="raw"&&_&&typeof d=="number")return u?_.children.splice(d,1):_.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let v;for(v in Yd)if(Object.hasOwn(Yd,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=Yd[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=c(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(p,d,_)),v&&_&&typeof d=="number")return o&&p.children?_.children.splice(d,1,...p.children):_.children.splice(d,1),d}}}function $R(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||zR.test(e.slice(0,t))?e:""}function E1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function GR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qR(e,t,n){const a=Xu((n||{}).ignore||[]),l=VR(t);let u=-1;for(;++u<l.length;)Px(e,"text",o);function o(f,p){let d=-1,_;for(;++d<p.length;){const v=p[d],w=_?_.children:void 0;if(a(v,w?w.indexOf(v):void 0,_))return;_=v}if(_)return c(f,p)}function c(f,p){const d=p[p.length-1],_=l[u][0],v=l[u][1];let w=0;const b=d.children.indexOf(f);let S=!1,x=[];_.lastIndex=0;let y=_.exec(f.value);for(;y;){const E=y.index,R={index:y.index,input:y.input,stack:[...p,f]};let N=v(...y,R);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?_.lastIndex=E+1:(w!==E&&x.push({type:"text",value:f.value.slice(w,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),w=E+y[0].length,S=!0),!_.global)break;y=_.exec(f.value)}return S?(w<f.value.length&&x.push({type:"text",value:f.value.slice(w)}),d.children.splice(b,1,...x)):x=[f],b+x.length}}function VR(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([YR(a[0]),WR(a[1])])}return t}function YR(e){return typeof e=="string"?new RegExp(GR(e),"g"):e}function WR(e){return typeof e=="function"?e:function(){return e}}const rp="phrasing",sp=["autolink","link","image","label"];function XR(){return{transforms:[nD],enter:{literalAutolink:ZR,literalAutolinkEmail:ap,literalAutolinkHttp:ap,literalAutolinkWww:ap},exit:{literalAutolink:tD,literalAutolinkEmail:eD,literalAutolinkHttp:QR,literalAutolinkWww:JR}}}function KR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:sp}]}}function ZR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ap(e){this.config.enter.autolinkProtocol.call(this,e)}function QR(e){this.config.exit.autolinkProtocol.call(this,e)}function JR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function eD(e){this.config.exit.autolinkEmail.call(this,e)}function tD(e){this.exit(e)}function nD(e){qR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),rD]],{ignore:["link","linkReference"]})}function iD(e,t,n,r,a){let l="";if(!Gx(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!sD(n)))return!1;const u=aD(n+r);if(!u[0])return!1;const o={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function rD(e,t,n,r){return!Gx(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function aD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=E1(e,"(");let l=E1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Gx(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||Vu(n))&&(!t||n!==47)}qx.peek=gD;function oD(){this.buffer()}function lD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cD(){this.buffer()}function uD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fD(e){this.exit(e)}function dD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pD(e){this.exit(e)}function gD(){return"["}function qx(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function mD(){return{enter:{gfmFootnoteCallString:oD,gfmFootnoteCall:lD,gfmFootnoteDefinitionLabelString:cD,gfmFootnoteDefinition:uD},exit:{gfmFootnoteCallString:hD,gfmFootnoteCall:fD,gfmFootnoteDefinitionLabelString:dD,gfmFootnoteDefinition:pD}}}function _D(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` -`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Vx:vD))),f(),c}}function vD(e,t,n){return t===0?e:Vx(e,t,n)}function Vx(e,t,n){return(n?"":" ")+e}const yD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yx.peek=CD;function bD(){return{canContainEols:["delete"],enter:{strikethrough:xD},exit:{strikethrough:wD}}}function SD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yD}],handlers:{delete:Yx}}}function xD(e){this.enter({type:"delete",children:[]},e)}function wD(e){this.exit(e)}function Yx(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function CD(){return"~"}function ED(e){return e.length}function kD(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||ED,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++p<e.length;){const C=[],b=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const x=AD(e[p][S]);if(n.alignDelimiters!==!1){const y=a(x);b[S]=y,(c[S]===void 0||y>c[S])&&(c[S]=y)}C.push(x)}u[p]=C,o[p]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)l[d]=k1(r[d]);else{const C=k1(r);for(;++d<f;)l[d]=C}d=-1;const _=[],v=[];for(;++d<f;){const C=l[d];let b="",S="";C===99?(b=":",S=":"):C===108?b=":":C===114&&(S=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-b.length-S.length);const y=b+"-".repeat(x)+S;n.alignDelimiters!==!1&&(x=b.length+x+S.length,x>c[d]&&(c[d]=x),v[d]=x),_[d]=y}u.splice(1,0,_),o.splice(1,0,v),p=-1;const w=[];for(;++p<u.length;){const C=u[p],b=o[p];d=-1;const S=[];for(;++d<f;){const x=C[d]||"";let y="",E="";if(n.alignDelimiters!==!1){const R=c[d]-(b[d]||0),N=l[d];N===114?y=" ".repeat(R):N===99?R%2?(y=" ".repeat(R/2+.5),E=" ".repeat(R/2-.5)):(y=" ".repeat(R/2),E=y):E=" ".repeat(R)}n.delimiterStart!==!1&&!d&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&S.push(" "),n.alignDelimiters!==!1&&S.push(y),S.push(x),n.alignDelimiters!==!1&&S.push(E),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(` -`)}function AD(e){return e==null?"":String(e)}function k1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ND(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),TD);return a(),u}function TD(e,t,n){return">"+(n?"":" ")+e}function RD(e,t){return A1(e,t.inConstruct,!0)&&!A1(e,t.notInConstruct,!1)}function A1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function N1(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===` -`&&RD(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\ -`}function DD(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function MD(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function jD(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function LD(e,t,n,r){const a=jD(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(MD(e,n)){const d=n.enter("codeIndented"),_=n.indentLines(l,OD);return d(),_}const o=n.createTracker(r),c=a.repeat(Math.max(DD(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` +`}),n}function m1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _1(e,t){const n=oR(e,t),r=n.one(e,void 0),a=Z4(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` +`},a),l}function fR(e,t){return e&&"run"in e?async function(n,r){const a=_1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return _1(n,{file:r,...e||t})}}function v1(e){if(e)throw e}var Kd,y1;function dR(){if(y1)return Kd;y1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var _;for(_ in f);return typeof _>"u"||e.call(f,_)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Kd=function c(){var f,p,d,_,v,w,C=arguments[0],b=1,S=arguments.length,x=!1;for(typeof C=="boolean"&&(x=C,C=arguments[1]||{},b=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});b<S;++b)if(f=arguments[b],f!=null)for(p in f)d=o(C,p),_=o(f,p),C!==_&&(x&&_&&(l(_)||(v=a(_)))?(v?(v=!1,w=d&&a(d)?d:[]):w=d&&l(d)?d:{},u(C,{name:p,newValue:c(x,w,_)})):typeof _<"u"&&u(C,{name:p,newValue:_}));return C},Kd}var pR=dR();const Zd=Pu(pR);function Hp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function gR(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...a);function o(c,...f){const p=e[++l];let d=-1;if(c){u(c);return}for(;++d<a.length;)(f[d]===null||f[d]===void 0)&&(f[d]=a[d]);a=f,p?mR(p,o)(...f):u(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function mR(e,t){let n;return r;function r(...u){const o=e.length>u.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const li={basename:_R,dirname:vR,extname:yR,join:bR,sep:"/"};function _R(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function vR(e){if(cl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yR(e){cl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function bR(...e){let t=-1,n;for(;++t<e.length;)cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":SR(n)}function SR(e){cl(e);const t=e.codePointAt(0)===47;let n=xR(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xR(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wR={cwd:CR};function CR(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ER(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kR(e)}function kR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Qd=["history","path","basename","stem","extname","dirname"];class Hx{constructor(t){let n;t?Fp(t)?n={path:t}:typeof t=="string"||AR(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qd.length;){const l=Qd[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Qd.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){ep(t,"basename"),Jd(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){b1(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(Jd(t,"extname"),b1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fp(t)&&(t=ER(t)),ep(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){ep(t,"stem"),Jd(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new tn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Jd(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function ep(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function b1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function AR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NR=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),TR={}.hasOwnProperty;class Bg extends NR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=gR()}copy(){const t=new Bg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ip("data",this.frozen),this.namespace[t]=n,this):TR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ip("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pc(t),r=this.parser||this.Parser;return tp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tp("process",this.parser||this.Parser),np("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const o=Pc(t),c=r.parse(o);r.run(c,o,function(p,d,_){if(p||!d||!_)return f(p);const v=d,w=r.stringify(v,_);MR(w)?_.value=w:_.result=w,f(p,_)});function f(p,d){p||!d?u(p):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),tp("processSync",this.parser||this.Parser),np("processSync",this.compiler||this.Compiler),this.process(t,a),x1("processSync","process",n),r;function a(l,u){n=!0,v1(l),r=u}}run(t,n,r){S1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,o){const c=Pc(n);a.run(t,c,f);function f(p,d,_){const v=d||t;p?o(p):u?u(v):r(void 0,v,_)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),x1("runSync","run",r),a;function l(u,o){v1(u),a=o,r=!0}}stringify(t,n){this.freeze();const r=Pc(n),a=this.compiler||this.Compiler;return np("stringify",a),S1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(ip("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...d]=f;c(p,d)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(f.plugins),f.settings&&(a.settings=Zd(!0,a.settings,f.settings))}function o(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const d=f[p];l(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,p){let d=-1,_=-1;for(;++d<r.length;)if(r[d][0]===f){_=d;break}if(_===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const C=r[_][1];Hp(C)&&Hp(v)&&(v=Zd(!0,C,v)),r[_]=[f,v,...w]}}}}const RR=new Bg().freeze();function tp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function np(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ip(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!Hp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pc(e){return DR(e)?e:new Hx(e)}function DR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MR(e){return typeof e=="string"||jR(e)}function jR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],C1={allowDangerousHtml:!0},OR=/^(https?|ircs?|mailto|xmpp)$/i,BR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fx(e){const t=IR(e),n=zR(e);return HR(t.runSync(t.parse(n),n),e)}function IR(e){const t=e.rehypePlugins||w1,n=e.remarkPlugins||w1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return RR().use(_4).use(n).use(fR,r).use(t)}function zR(e){const t=e.children||"",n=new Hx;return typeof t=="string"&&(n.value=t),n}function HR(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||FR;for(const p of BR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+LR+p.id,void 0);return Og(e,f),e3(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,d,_){if(p.type==="raw"&&_&&typeof d=="number")return u?_.children.splice(d,1):_.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let v;for(v in Yd)if(Object.hasOwn(Yd,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=Yd[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=c(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(p,d,_)),v&&_&&typeof d=="number")return o&&p.children?_.children.splice(d,1,...p.children):_.children.splice(d,1),d}}}function FR(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||OR.test(e.slice(0,t))?e:""}function E1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function PR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function UR(e,t,n){const a=Xu((n||{}).ignore||[]),l=$R(t);let u=-1;for(;++u<l.length;)zx(e,"text",o);function o(f,p){let d=-1,_;for(;++d<p.length;){const v=p[d],w=_?_.children:void 0;if(a(v,w?w.indexOf(v):void 0,_))return;_=v}if(_)return c(f,p)}function c(f,p){const d=p[p.length-1],_=l[u][0],v=l[u][1];let w=0;const b=d.children.indexOf(f);let S=!1,x=[];_.lastIndex=0;let y=_.exec(f.value);for(;y;){const E=y.index,R={index:y.index,input:y.input,stack:[...p,f]};let N=v(...y,R);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?_.lastIndex=E+1:(w!==E&&x.push({type:"text",value:f.value.slice(w,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),w=E+y[0].length,S=!0),!_.global)break;y=_.exec(f.value)}return S?(w<f.value.length&&x.push({type:"text",value:f.value.slice(w)}),d.children.splice(b,1,...x)):x=[f],b+x.length}}function $R(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([GR(a[0]),qR(a[1])])}return t}function GR(e){return typeof e=="string"?new RegExp(PR(e),"g"):e}function qR(e){return typeof e=="function"?e:function(){return e}}const rp="phrasing",sp=["autolink","link","image","label"];function VR(){return{transforms:[JR],enter:{literalAutolink:WR,literalAutolinkEmail:ap,literalAutolinkHttp:ap,literalAutolinkWww:ap},exit:{literalAutolink:QR,literalAutolinkEmail:ZR,literalAutolinkHttp:XR,literalAutolinkWww:KR}}}function YR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:sp}]}}function WR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ap(e){this.config.enter.autolinkProtocol.call(this,e)}function XR(e){this.config.exit.autolinkProtocol.call(this,e)}function KR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ZR(e){this.config.exit.autolinkEmail.call(this,e)}function QR(e){this.exit(e)}function JR(e){UR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tD]],{ignore:["link","linkReference"]})}function eD(e,t,n,r,a){let l="";if(!Px(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!nD(n)))return!1;const u=iD(n+r);if(!u[0])return!1;const o={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function tD(e,t,n,r){return!Px(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function nD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=E1(e,"(");let l=E1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Px(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||Vu(n))&&(!t||n!==47)}Ux.peek=fD;function rD(){this.buffer()}function sD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aD(){this.buffer()}function oD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cD(e){this.exit(e)}function uD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hD(e){this.exit(e)}function fD(){return"["}function Ux(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function dD(){return{enter:{gfmFootnoteCallString:rD,gfmFootnoteCall:sD,gfmFootnoteDefinitionLabelString:aD,gfmFootnoteDefinition:oD},exit:{gfmFootnoteCallString:lD,gfmFootnoteCall:cD,gfmFootnoteDefinitionLabelString:uD,gfmFootnoteDefinition:hD}}}function pD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ux},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` +`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?$x:gD))),f(),c}}function gD(e,t,n){return t===0?e:$x(e,t,n)}function $x(e,t,n){return(n?"":" ")+e}const mD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gx.peek=SD;function _D(){return{canContainEols:["delete"],enter:{strikethrough:yD},exit:{strikethrough:bD}}}function vD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mD}],handlers:{delete:Gx}}}function yD(e){this.enter({type:"delete",children:[]},e)}function bD(e){this.exit(e)}function Gx(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function SD(){return"~"}function xD(e){return e.length}function wD(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||xD,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++p<e.length;){const C=[],b=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const x=CD(e[p][S]);if(n.alignDelimiters!==!1){const y=a(x);b[S]=y,(c[S]===void 0||y>c[S])&&(c[S]=y)}C.push(x)}u[p]=C,o[p]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)l[d]=k1(r[d]);else{const C=k1(r);for(;++d<f;)l[d]=C}d=-1;const _=[],v=[];for(;++d<f;){const C=l[d];let b="",S="";C===99?(b=":",S=":"):C===108?b=":":C===114&&(S=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-b.length-S.length);const y=b+"-".repeat(x)+S;n.alignDelimiters!==!1&&(x=b.length+x+S.length,x>c[d]&&(c[d]=x),v[d]=x),_[d]=y}u.splice(1,0,_),o.splice(1,0,v),p=-1;const w=[];for(;++p<u.length;){const C=u[p],b=o[p];d=-1;const S=[];for(;++d<f;){const x=C[d]||"";let y="",E="";if(n.alignDelimiters!==!1){const R=c[d]-(b[d]||0),N=l[d];N===114?y=" ".repeat(R):N===99?R%2?(y=" ".repeat(R/2+.5),E=" ".repeat(R/2-.5)):(y=" ".repeat(R/2),E=y):E=" ".repeat(R)}n.delimiterStart!==!1&&!d&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&S.push(" "),n.alignDelimiters!==!1&&S.push(y),S.push(x),n.alignDelimiters!==!1&&S.push(E),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(` +`)}function CD(e){return e==null?"":String(e)}function k1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ED(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),kD);return a(),u}function kD(e,t,n){return">"+(n?"":" ")+e}function AD(e,t){return A1(e,t.inConstruct,!0)&&!A1(e,t.notInConstruct,!1)}function A1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function N1(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===` +`&&AD(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\ +`}function ND(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function TD(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function RD(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function DD(e,t,n,r){const a=RD(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(TD(e,n)){const d=n.enter("codeIndented"),_=n.indentLines(l,MD);return d(),_}const o=n.createTracker(r),c=a.repeat(Math.max(ND(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` `,encode:["`"],...o.current()})),d()}return p+=o.move(` `),l&&(p+=o.move(l+` -`)),p+=o.move(c),f(),p}function OD(e,t,n){return(n?"":" ")+e}function Ig(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function BD(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function ID(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ku(e,t,n){const r=fa(e),a=fa(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wx.peek=zD;function Wx(e,t,n,r){const a=ID(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function zD(e,t,n){return n.options.emphasis||"*"}function HD(e,t){let n=!1;return Og(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&Tg(e)&&(t.options.setext||n))}function FD(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(HD(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:` +`)),p+=o.move(c),f(),p}function MD(e,t,n){return(n?"":" ")+e}function Ig(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jD(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function LD(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ku(e,t,n){const r=fa(e),a=fa(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qx.peek=OD;function qx(e,t,n,r){const a=LD(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function OD(e,t,n){return n.options.emphasis||"*"}function BD(e,t){let n=!1;return Og(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&Tg(e)&&(t.options.setext||n))}function ID(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(BD(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:` `,after:` `});return d(),p(),_+` `+(a===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(` `))+1))}const u="#".repeat(a),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(u+" ");let f=n.containerPhrasing(e,{before:"# ",after:` -`,...l.current()});return/^[\t ]/.test(f)&&(f=Go(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}Xx.peek=PD;function Xx(e){return e.value||""}function PD(){return"<"}Kx.peek=UD;function Kx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function UD(){return"!"}Zx.peek=$D;function Zx(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $D(){return"!"}Qx.peek=GD;function Qx(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],o=n.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return a+r+a}function GD(){return"`"}function Jx(e,t){const n=Tg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ew.peek=qD;function ew(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(Jx(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function qD(e,t,n){return Jx(e,n)?"<":"["}tw.peek=VD;function tw(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function VD(){return"["}function zg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YD(e){const t=zg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function WD(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function nw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XD(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?WD(n):zg(n);const o=e.ordered?u==="."?")":".":YD(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),nw(n)===u&&p){let d=-1;for(;++d<e.children.length;){const _=e.children[d];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),f}function KD(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ZD(e,t,n,r){const a=KD(n);let l=n.bulletCurrent||zg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,_,v){return _?(v?"":" ".repeat(u))+d:(v?l:l+" ".repeat(u-l.length))+d}}function QD(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const JD=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function eM(e,t,n,r){return(e.children.some(function(u){return JD(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function tM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iw.peek=nM;function iw(e,t,n,r){const a=tM(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function nM(e,t,n){return n.options.strong||"*"}function iM(e,t,n,r){return n.safe(e.value,r)}function rM(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sM(e,t,n){const r=(nw(n)+(n.options.ruleSpaces?" ":"")).repeat(rM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const rw={blockquote:ND,break:N1,code:LD,definition:BD,emphasis:Wx,hardBreak:N1,heading:FD,html:Xx,image:Kx,imageReference:Zx,inlineCode:Qx,link:ew,linkReference:tw,list:XD,listItem:ZD,paragraph:QD,root:eM,strong:iw,text:iM,thematicBreak:sM};function aM(){return{enter:{table:oM,tableData:T1,tableHeader:T1,tableRow:cM},exit:{codeText:uM,table:lM,tableData:op,tableHeader:op,tableRow:op}}}function oM(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function lM(e){this.exit(e),this.data.inTable=void 0}function cM(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function T1(e){this.enter({type:"tableCell",children:[]},e)}function uM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function hM(e,t){return t==="|"?t:e}function fM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...l.current()});return/^[\t ]/.test(f)&&(f=Go(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}Vx.peek=zD;function Vx(e){return e.value||""}function zD(){return"<"}Yx.peek=HD;function Yx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function HD(){return"!"}Wx.peek=FD;function Wx(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function FD(){return"!"}Xx.peek=PD;function Xx(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],o=n.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return a+r+a}function PD(){return"`"}function Kx(e,t){const n=Tg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Zx.peek=UD;function Zx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(Kx(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function UD(e,t,n){return Kx(e,n)?"<":"["}Qx.peek=$D;function Qx(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $D(){return"["}function zg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function GD(e){const t=zg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function qD(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Jx(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function VD(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?qD(n):zg(n);const o=e.ordered?u==="."?")":".":GD(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Jx(n)===u&&p){let d=-1;for(;++d<e.children.length;){const _=e.children[d];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),f}function YD(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function WD(e,t,n,r){const a=YD(n);let l=n.bulletCurrent||zg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,_,v){return _?(v?"":" ".repeat(u))+d:(v?l:l+" ".repeat(u-l.length))+d}}function XD(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const KD=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZD(e,t,n,r){return(e.children.some(function(u){return KD(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function QD(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ew.peek=JD;function ew(e,t,n,r){const a=QD(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function JD(e,t,n){return n.options.strong||"*"}function eM(e,t,n,r){return n.safe(e.value,r)}function tM(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nM(e,t,n){const r=(Jx(n)+(n.options.ruleSpaces?" ":"")).repeat(tM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const tw={blockquote:ED,break:N1,code:DD,definition:jD,emphasis:qx,hardBreak:N1,heading:ID,html:Vx,image:Yx,imageReference:Wx,inlineCode:Xx,link:Zx,linkReference:Qx,list:VD,listItem:WD,paragraph:XD,root:ZD,strong:ew,text:eM,thematicBreak:nM};function iM(){return{enter:{table:rM,tableData:T1,tableHeader:T1,tableRow:aM},exit:{codeText:oM,table:sM,tableData:op,tableHeader:op,tableRow:op}}}function rM(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function sM(e){this.exit(e),this.data.inTable=void 0}function aM(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function T1(e){this.enter({type:"tableCell",children:[]},e)}function oM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lM(e,t){return t==="|"?t:e}function cM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:u,tableCell:c,tableRow:o}};function u(v,w,C,b){return f(p(v,C,b),v.align)}function o(v,w,C,b){const S=d(v,C,b),x=f([S]);return x.slice(0,x.indexOf(` -`))}function c(v,w,C,b){const S=C.enter("tableCell"),x=C.enter("phrasing"),y=C.containerPhrasing(v,{...b,before:l,after:l});return x(),S(),y}function f(v,w){return kD(v,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function p(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("table");for(;++S<b.length;)x[S]=d(b[S],w,C);return y(),x}function d(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("tableRow");for(;++S<b.length;)x[S]=c(b[S],v,w,C);return y(),x}function _(v,w,C){let b=rw.inlineCode(v,w,C);return C.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function dM(){return{exit:{taskListCheckValueChecked:R1,taskListCheckValueUnchecked:R1,paragraph:gM}}}function pM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mM}}}function R1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const o=a[l];if(o.type==="paragraph"){u=o;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function mM(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(u);let c=rw.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(p){return p+u}}function _M(){return[XR(),mD(),bD(),aM(),dM()]}function vM(e){return{extensions:[KR(),_D(e),SD(),fM(e),pM()]}}const yM={tokenize:EM,partial:!0},sw={tokenize:kM,partial:!0},aw={tokenize:AM,partial:!0},ow={tokenize:NM,partial:!0},bM={tokenize:TM,partial:!0},lw={name:"wwwAutolink",tokenize:wM,previous:uw},cw={name:"protocolAutolink",tokenize:CM,previous:hw},qi={name:"emailAutolink",tokenize:xM,previous:fw},fi={};function SM(){return{text:fi}}let Wr=48;for(;Wr<123;)fi[Wr]=qi,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);fi[43]=qi;fi[45]=qi;fi[46]=qi;fi[95]=qi;fi[72]=[qi,cw];fi[104]=[qi,cw];fi[87]=[qi,lw];fi[119]=[qi,lw];function xM(e,t,n){const r=this;let a,l;return u;function u(d){return!Pp(d)||!fw.call(r,r.previous)||Hg(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Pp(d)?(e.consume(d),o):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(bM,p,f)(d):d===45||d===95||en(d)?(l=!0,e.consume(d),c):p(d)}function f(d){return e.consume(d),a=!0,c}function p(d){return l&&a&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function wM(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!uw.call(r,r.previous)||Hg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yM,e.attempt(sw,e.attempt(aw,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function CM(e,t,n){const r=this;let a="",l=!1;return u;function u(d){return(d===72||d===104)&&hw.call(r,r.previous)&&!Hg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(sn(d)&&a.length<5)return a+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const _=a.toLowerCase();if(_==="http"||_==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),l?f:(l=!0,c)):n(d)}function f(d){return d===null||wu(d)||yt(d)||is(d)||Vu(d)?n(d):e.attempt(sw,e.attempt(aw,p),n)(d)}function p(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function EM(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function kM(e,t,n){let r,a,l;return u;function u(f){return f===46||f===95?e.check(ow,c,o)(f):f===null||yt(f)||is(f)||f!==45&&Vu(f)?c(f):(l=!0,e.consume(f),u)}function o(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),u}function c(f){return a||r||!l?n(f):t(f)}}function AM(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(ow,t,l)(u):u===null||yt(u)||is(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function NM(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),a):o===60||o===null||yt(o)||is(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||yt(o)||is(o)?t(o):r(o)}function l(o){return sn(o)?u(o):n(o)}function u(o){return o===59?(e.consume(o),r):sn(o)?(e.consume(o),u):n(o)}}function TM(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return en(l)?n(l):t(l)}}function uw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function hw(e){return!sn(e)}function fw(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||en(e)}function Hg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const RM={tokenize:zM,partial:!0};function DM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OM,continuation:{tokenize:BM},exit:IM}},text:{91:{name:"gfmFootnoteCall",tokenize:LM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MM,resolveTo:jM}}}}function MM(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function jM(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function LM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||yt(d))return n(d);if(d===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return yt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function OM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(u>999||w===93&&!o||w===null||w===91||yt(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(w)||(o=!0),u++,e.consume(w),w===92?d:p}function d(w){return w===91||w===92||w===93?(e.consume(w),u++,p):p(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(l)||a.push(l),et(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function BM(e,t,n){return e.check(ll,t,e.attempt(RM,t,n))}function IM(e){e.exit("gfmFootnoteDefinition")}function zM(e,t,n){const r=this;return et(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function HM(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let f=c;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[c][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[c][1].end)},d={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[c][1].start)},_=[["enter",p,o],["enter",u[f][1],o],["exit",u[f][1],o],["enter",d,o]],v=o.parser.constructs.insideSpan.null;v&&Tn(_,_.length,0,Yu(v,u.slice(f+1,c),o)),Tn(_,_.length,0,[["exit",d,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",p,o]]),Tn(u,f-1,c-f+3,_),c=f+_.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function l(u,o,c){const f=this.previous,p=this.events;let d=0;return _;function _(w){return f===126&&p[p.length-1][1].type!=="characterEscape"?c(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const C=fa(f);if(w===126)return d>1?c(w):(u.consume(w),d++,v);if(d<2&&!n)return c(w);const b=u.exit("strikethroughSequenceTemporary"),S=fa(w);return b._open=!S||S===2&&!!C,b._close=!C||C===2&&!!S,o(w)}}}class FM{constructor(){this.map=[]}add(t,n,r){PM(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function PM(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function UM(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function $M(){return{flow:{null:{name:"table",tokenize:GM,resolveAll:qM}}}}function GM(e,t,n){const r=this;let a=0,l=0,u;return o;function o(B){let F=r.events.length-1;for(;F>-1;){const z=r.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}const Y=F>-1?r.events[F][1].type:null,H=Y==="tableHead"||Y==="tableRow"?N:c;return H===N&&r.parser.lazy[r.now().line]?n(B):H(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Oe(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):n(B):Xe(B)?et(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||yt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?_:d)}function _(B){return B===92||B===124?(e.consume(B),d):d(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Xe(B)?et(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?b(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),C):R(B)}function C(B){return Xe(B)?et(e,b,"whitespace")(B):b(B)}function b(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(l+=1,S(B)):B===null||Oe(B)?E(B):R(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):R(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(B))}function y(B){return Xe(B)?et(e,E,"whitespace")(B):E(B)}function E(B){return B===124?w(B):B===null||Oe(B)?!u||a!==l?R(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):R(B)}function R(B){return n(B)}function N(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||Oe(B)?(e.exit("tableRow"),t(B)):Xe(B)?et(e,D,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||yt(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function qM(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const _=new FM;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(o=!1,c!==0&&(D1(_,t,c,f,p),p=void 0,c=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],u=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",p,t]])),a=w.type==="tableDelimiterRow"?2:p?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(o=!0,c=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(c=n,l[1]!==0?(u[0]=u[1],d=Uc(_,t,l,a,n,d)):u[1]!==0&&(d=Uc(_,t,u,a,n,d)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(c!==0&&D1(_,t,c,f,p),_.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=UM(t.events,n))}return e}function Uc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},na(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=na(t.events,n[1]);if(l={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const f=na(t.events,n[2]),p=na(t.events,n[3]),d={type:o,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const _=t.events[n[2]],v=t.events[n[3]];if(_[1].end=Object.assign({},v[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},na(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function D1(e,t,n,r,a){const l=[],u=na(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function na(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const VM={name:"tasklistCheck",tokenize:WM};function YM(){return{text:{91:VM}}}function WM(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return yt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Oe(c)?t(c):Xe(c)?e.check({tokenize:XM},t,n)(c):n(c)}}function XM(e,t,n){return et(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function KM(e){return Sx([SM(),DM(),HM(e),$M(),YM()])}const ZM={};function dw(e){const t=this,n=e||ZM,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(KM(n)),l.push(_M()),u.push(vM(n))}const QM={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},JM={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Up(e){const t=e.trim().toLowerCase();return QM[t]??t}function pw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=JM[t];if(n)return Up(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Up(t.slice(r+1))}di.displayName="clike";di.aliases=[];function di(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}ul.displayName="c";ul.aliases=[];function ul(e){e.register(di),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Zu.displayName="cpp";Zu.aliases=[];function Zu(e){e.register(ul),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Fg.displayName="arduino";Fg.aliases=["ino"];function Fg(e){e.register(Zu),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Pg.displayName="bash";Pg.aliases=["sh","shell"];function Pg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o<l.length;o++)u[l[o]]=t.languages.bash[l[o]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}Ug.displayName="csharp";Ug.aliases=["cs","dotnet"];function Ug(e){e.register(di),(function(t){function n(M,O){return M.replace(/<<(\d+)>>/g,function($,U){return"(?:"+O[+U]+")"})}function r(M,O,$){return RegExp(n(M,O),"")}function a(M,O){for(var $=0;$<O;$++)M=M.replace(/<<self>>/g,function(){return"(?:"+M+")"});return M.replace(/<<self>>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),_=a(/\((?:[^()]|<<self>>)*\)/.source,2),v=/@?\b[A-Za-z_]\w*\b/.source,w=n(/<<0>>(?:\s*<<1>>)?/.source,[v,d]),C=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,w]),b=/\[\s*(?:,\s*)*\]/.source,S=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[C,b]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,_,b]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,C,b]),R={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,D=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[D]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[v,E]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[v]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:R},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\bwhere\s+)<<0>>/.source,[v]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[S]),lookbehind:!0,inside:R},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,v]),inside:R}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[v]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[v]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[_]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,C]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[v,d]),inside:{function:r(/^<<0>>/.source,[v]),generic:{pattern:RegExp(d),alias:"class-name",inside:R}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,w,v,E,c.source,_,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,_]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=D+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),F=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),Y=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[C,F]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[Y,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[Y]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[F]),inside:t.languages.csharp},"class-name":{pattern:RegExp(C),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var z=/:[^}\r\n]+/.source,V=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),G=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[V,z]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,z]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,z]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:L(G,V)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}hl.displayName="markup";hl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function hl(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ca.displayName="css";Ca.aliases=[];function Ca(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}$g.displayName="diff";$g.aliases=[];function $g(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r +`))}function c(v,w,C,b){const S=C.enter("tableCell"),x=C.enter("phrasing"),y=C.containerPhrasing(v,{...b,before:l,after:l});return x(),S(),y}function f(v,w){return wD(v,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function p(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("table");for(;++S<b.length;)x[S]=d(b[S],w,C);return y(),x}function d(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("tableRow");for(;++S<b.length;)x[S]=c(b[S],v,w,C);return y(),x}function _(v,w,C){let b=tw.inlineCode(v,w,C);return C.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function uM(){return{exit:{taskListCheckValueChecked:R1,taskListCheckValueUnchecked:R1,paragraph:fM}}}function hM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dM}}}function R1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const o=a[l];if(o.type==="paragraph"){u=o;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function dM(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(u);let c=tw.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(p){return p+u}}function pM(){return[VR(),dD(),_D(),iM(),uM()]}function gM(e){return{extensions:[YR(),pD(e),vD(),cM(e),hM()]}}const mM={tokenize:xM,partial:!0},nw={tokenize:wM,partial:!0},iw={tokenize:CM,partial:!0},rw={tokenize:EM,partial:!0},_M={tokenize:kM,partial:!0},sw={name:"wwwAutolink",tokenize:bM,previous:ow},aw={name:"protocolAutolink",tokenize:SM,previous:lw},Gi={name:"emailAutolink",tokenize:yM,previous:cw},fi={};function vM(){return{text:fi}}let Wr=48;for(;Wr<123;)fi[Wr]=Gi,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);fi[43]=Gi;fi[45]=Gi;fi[46]=Gi;fi[95]=Gi;fi[72]=[Gi,aw];fi[104]=[Gi,aw];fi[87]=[Gi,sw];fi[119]=[Gi,sw];function yM(e,t,n){const r=this;let a,l;return u;function u(d){return!Pp(d)||!cw.call(r,r.previous)||Hg(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Pp(d)?(e.consume(d),o):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(_M,p,f)(d):d===45||d===95||en(d)?(l=!0,e.consume(d),c):p(d)}function f(d){return e.consume(d),a=!0,c}function p(d){return l&&a&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function bM(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!ow.call(r,r.previous)||Hg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mM,e.attempt(nw,e.attempt(iw,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function SM(e,t,n){const r=this;let a="",l=!1;return u;function u(d){return(d===72||d===104)&&lw.call(r,r.previous)&&!Hg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(sn(d)&&a.length<5)return a+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const _=a.toLowerCase();if(_==="http"||_==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),l?f:(l=!0,c)):n(d)}function f(d){return d===null||wu(d)||yt(d)||is(d)||Vu(d)?n(d):e.attempt(nw,e.attempt(iw,p),n)(d)}function p(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function xM(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function wM(e,t,n){let r,a,l;return u;function u(f){return f===46||f===95?e.check(rw,c,o)(f):f===null||yt(f)||is(f)||f!==45&&Vu(f)?c(f):(l=!0,e.consume(f),u)}function o(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),u}function c(f){return a||r||!l?n(f):t(f)}}function CM(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(rw,t,l)(u):u===null||yt(u)||is(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function EM(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),a):o===60||o===null||yt(o)||is(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||yt(o)||is(o)?t(o):r(o)}function l(o){return sn(o)?u(o):n(o)}function u(o){return o===59?(e.consume(o),r):sn(o)?(e.consume(o),u):n(o)}}function kM(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return en(l)?n(l):t(l)}}function ow(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function lw(e){return!sn(e)}function cw(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||en(e)}function Hg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const AM={tokenize:OM,partial:!0};function NM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:MM,continuation:{tokenize:jM},exit:LM}},text:{91:{name:"gfmFootnoteCall",tokenize:DM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TM,resolveTo:RM}}}}function TM(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function RM(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function DM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||yt(d))return n(d);if(d===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return yt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function MM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(u>999||w===93&&!o||w===null||w===91||yt(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(w)||(o=!0),u++,e.consume(w),w===92?d:p}function d(w){return w===91||w===92||w===93?(e.consume(w),u++,p):p(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(l)||a.push(l),et(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function jM(e,t,n){return e.check(ll,t,e.attempt(AM,t,n))}function LM(e){e.exit("gfmFootnoteDefinition")}function OM(e,t,n){const r=this;return et(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function BM(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let f=c;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[c][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[c][1].end)},d={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[c][1].start)},_=[["enter",p,o],["enter",u[f][1],o],["exit",u[f][1],o],["enter",d,o]],v=o.parser.constructs.insideSpan.null;v&&Tn(_,_.length,0,Yu(v,u.slice(f+1,c),o)),Tn(_,_.length,0,[["exit",d,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",p,o]]),Tn(u,f-1,c-f+3,_),c=f+_.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function l(u,o,c){const f=this.previous,p=this.events;let d=0;return _;function _(w){return f===126&&p[p.length-1][1].type!=="characterEscape"?c(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const C=fa(f);if(w===126)return d>1?c(w):(u.consume(w),d++,v);if(d<2&&!n)return c(w);const b=u.exit("strikethroughSequenceTemporary"),S=fa(w);return b._open=!S||S===2&&!!C,b._close=!C||C===2&&!!S,o(w)}}}class IM{constructor(){this.map=[]}add(t,n,r){zM(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function zM(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function HM(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function FM(){return{flow:{null:{name:"table",tokenize:PM,resolveAll:UM}}}}function PM(e,t,n){const r=this;let a=0,l=0,u;return o;function o(B){let z=r.events.length-1;for(;z>-1;){const H=r.events[z][1].type;if(H==="lineEnding"||H==="linePrefix")z--;else break}const G=z>-1?r.events[z][1].type:null,U=G==="tableHead"||G==="tableRow"?N:c;return U===N&&r.parser.lazy[r.now().line]?n(B):U(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Oe(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):n(B):Xe(B)?et(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||yt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?_:d)}function _(B){return B===92||B===124?(e.consume(B),d):d(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Xe(B)?et(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?b(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),C):R(B)}function C(B){return Xe(B)?et(e,b,"whitespace")(B):b(B)}function b(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(l+=1,S(B)):B===null||Oe(B)?E(B):R(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):R(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(B))}function y(B){return Xe(B)?et(e,E,"whitespace")(B):E(B)}function E(B){return B===124?w(B):B===null||Oe(B)?!u||a!==l?R(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):R(B)}function R(B){return n(B)}function N(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||Oe(B)?(e.exit("tableRow"),t(B)):Xe(B)?et(e,D,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||yt(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function UM(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const _=new IM;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(o=!1,c!==0&&(D1(_,t,c,f,p),p=void 0,c=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],u=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",p,t]])),a=w.type==="tableDelimiterRow"?2:p?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(o=!0,c=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(c=n,l[1]!==0?(u[0]=u[1],d=Uc(_,t,l,a,n,d)):u[1]!==0&&(d=Uc(_,t,u,a,n,d)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(c!==0&&D1(_,t,c,f,p),_.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=HM(t.events,n))}return e}function Uc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},na(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=na(t.events,n[1]);if(l={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const f=na(t.events,n[2]),p=na(t.events,n[3]),d={type:o,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const _=t.events[n[2]],v=t.events[n[3]];if(_[1].end=Object.assign({},v[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},na(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function D1(e,t,n,r,a){const l=[],u=na(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function na(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $M={name:"tasklistCheck",tokenize:qM};function GM(){return{text:{91:$M}}}function qM(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return yt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Oe(c)?t(c):Xe(c)?e.check({tokenize:VM},t,n)(c):n(c)}}function VM(e,t,n){return et(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function YM(e){return yx([vM(),NM(),BM(e),FM(),GM()])}const WM={};function uw(e){const t=this,n=e||WM,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(YM(n)),l.push(pM()),u.push(gM(n))}const XM={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},KM={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Up(e){const t=e.trim().toLowerCase();return XM[t]??t}function hw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=KM[t];if(n)return Up(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Up(t.slice(r+1))}di.displayName="clike";di.aliases=[];function di(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}ul.displayName="c";ul.aliases=[];function ul(e){e.register(di),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Zu.displayName="cpp";Zu.aliases=[];function Zu(e){e.register(ul),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Fg.displayName="arduino";Fg.aliases=["ino"];function Fg(e){e.register(Zu),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Pg.displayName="bash";Pg.aliases=["sh","shell"];function Pg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o<l.length;o++)u[l[o]]=t.languages.bash[l[o]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}Ug.displayName="csharp";Ug.aliases=["cs","dotnet"];function Ug(e){e.register(di),(function(t){function n(M,O){return M.replace(/<<(\d+)>>/g,function($,F){return"(?:"+O[+F]+")"})}function r(M,O,$){return RegExp(n(M,O),"")}function a(M,O){for(var $=0;$<O;$++)M=M.replace(/<<self>>/g,function(){return"(?:"+M+")"});return M.replace(/<<self>>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),_=a(/\((?:[^()]|<<self>>)*\)/.source,2),v=/@?\b[A-Za-z_]\w*\b/.source,w=n(/<<0>>(?:\s*<<1>>)?/.source,[v,d]),C=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,w]),b=/\[\s*(?:,\s*)*\]/.source,S=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[C,b]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,_,b]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,C,b]),R={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,D=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[D]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[v,E]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[v]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:R},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\bwhere\s+)<<0>>/.source,[v]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[S]),lookbehind:!0,inside:R},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,v]),inside:R}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[v]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[v]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[_]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,C]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[v,d]),inside:{function:r(/^<<0>>/.source,[v]),generic:{pattern:RegExp(d),alias:"class-name",inside:R}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,w,v,E,c.source,_,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,_]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=D+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),z=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),G=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[C,z]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[G,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[G]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[z]),inside:t.languages.csharp},"class-name":{pattern:RegExp(C),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Y=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,H]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,H]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[q]),lookbehind:!0,greedy:!0,inside:L(q,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}hl.displayName="markup";hl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function hl(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ca.displayName="css";Ca.aliases=[];function Ca(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}$g.displayName="diff";$g.aliases=[];function $g(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Gg.displayName="go";Gg.aliases=[];function Gg(e){e.register(di),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}qg.displayName="ini";qg.aliases=[];function qg(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}Vg.displayName="java";Vg.aliases=[];function Vg(e){e.register(di),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Yg.displayName="regex";Yg.aliases=[];function Yg(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(e)}Qu.displayName="javascript";Qu.aliases=["js"];function Qu(e){e.register(di),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}Wg.displayName="json";Wg.aliases=["webmanifest"];function Wg(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}Xg.displayName="kotlin";Xg.aliases=["kt","kts"];function Xg(e){e.register(di),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}Kg.displayName="less";Kg.aliases=[];function Kg(e){e.register(Ca),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}Zg.displayName="lua";Zg.aliases=[];function Zg(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}Qg.displayName="makefile";Qg.aliases=[];function Qg(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}Jg.displayName="yaml";Jg.aliases=["yml"];function Jg(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}em.displayName="markdown";em.aliases=["md"];function em(e){e.register(hl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p<d;p++){var _=f[p];if(_.type!=="code"){c(_.content);continue}var v=_.content[1],w=_.content[3];if(v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"){var C=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var b="language-"+C;w.alias?typeof w.alias=="string"?w.alias=[w.alias,b]:w.alias.push(b):w.alias=[b]}}}c(o.tokens)}),t.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",f=0,p=o.classes.length;f<p;f++){var d=o.classes[f],_=/language-(.+)/.exec(d);if(_){c=_[1];break}}var v=t.languages[c];if(v)o.content=t.highlight(o.content.value,v,c);else if(c&&c!=="none"&&t.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);o.attributes.id=w,t.plugins.autoloader.loadLanguages(c,function(){var C=document.getElementById(w);C&&(C.innerHTML=t.highlight(C.textContent,t.languages[c],c))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}tm.displayName="objectivec";tm.aliases=["objc"];function tm(e){e.register(ul),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}nm.displayName="perl";nm.aliases=[];function nm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ju.displayName="markup-templating";Ju.aliases=[];function Ju(e){e.register(hl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f<c.length&&!(l>=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],_=r.tokenStack[d],v=typeof p=="string"?p:p.content,w=n(a,d),C=v.indexOf(w);if(C>-1){++l;var b=v.substring(0,C),S=new t.Token(a,t.tokenize(_,r.grammar),"language-"+a,_),x=v.substring(C+w.length),y=[];b&&y.push.apply(y,o([b])),y.push(S),x&&y.push.apply(y,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(y)):p.content=y}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}im.displayName="php";im.aliases=[];function im(e){e.register(Ju),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}rm.displayName="python";rm.aliases=["py"];function rm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}sm.displayName="r";sm.aliases=[];function sm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}am.displayName="ruby";am.aliases=["rb"];function am(e){e.register(di),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}om.displayName="rust";om.aliases=[];function om(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}lm.displayName="sass";lm.aliases=[];function lm(e){e.register(Ca),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}cm.displayName="scss";cm.aliases=[];function cm(e){e.register(Ca),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}um.displayName="sql";um.aliases=[];function um(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}hm.displayName="swift";hm.aliases=[];function hm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}fm.displayName="typescript";fm.aliases=["ts"];function fm(e){e.register(Qu),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}eh.displayName="basic";eh.aliases=[];function eh(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}dm.displayName="vbnet";dm.aliases=[];function dm(e){e.register(eh),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const M1=/[#.]/g;function ej(e,t){const n=e||"",r={};let a=0,l,u;for(;a<n.length;){M1.lastIndex=a;const o=M1.exec(n),c=n.slice(a,o?o.index:n.length);c&&(l?l==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:u=c,a+=c.length),o&&(l=o[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function gw(e,t,n){const r=n?rj(n):void 0;function a(l,u,...o){let c;if(l==null){c={type:"root",children:[]};const f=u;o.unshift(f)}else{c=ej(l,t);const f=c.tagName.toLowerCase(),p=r?r.get(f):void 0;if(c.tagName=p||f,tj(u))o.unshift(u);else for(const[d,_]of Object.entries(u))nj(e,c.properties,d,_)}for(const f of o)$p(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return a}function tj(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const l=a;for(const u of l)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function nj(e,t,n,r){const a=fx(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?a.spaceSeparated?l=Vy(r):a.commaSeparated?l=Py(r):a.commaOrSpaceSeparated?l=Vy(Py(r).join(" ")):l=j1(a,a.property,r):Array.isArray(r)?l=[...r]:l=a.property==="style"?ij(r):String(r);if(Array.isArray(l)){const u=[];for(const o of l)u.push(j1(a,a.property,o));l=u}a.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[a.property]=l}}function $p(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)$p(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$p(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function j1(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Po(n)===Po(t)))return!0}return n}function ij(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function rj(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const sj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],aj=gw(dx,"div");gw(qu,"g",sj);const oj=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],L1={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function mw(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function lj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function cj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function O1(e){return cj(e)||mw(e)}const uj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function hj(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,_=w(),v;for(l--;++l<=e.length;)if(v===10&&(d=(f?f[u]:0)||1),v=e.charCodeAt(l),v===38){const S=e.charCodeAt(l+1);if(S===9||S===10||S===12||S===32||S===38||S===60||Number.isNaN(S)||r&&S===r){o+=String.fromCharCode(v),d++;continue}const x=l+1;let y=x,E=x,R;if(S===35){E=++y;const H=e.charCodeAt(E);H===88||H===120?(R="hexadecimal",E=++y):R="decimal"}else R="named";let N="",D="",T="";const j=R==="named"?O1:R==="decimal"?mw:lj;for(E--;++E<=e.length;){const H=e.charCodeAt(E);if(!j(H))break;T+=String.fromCharCode(H),R==="named"&&oj.includes(T)&&(N=T,D=$o(T))}let B=e.charCodeAt(E)===59;if(B){E++;const H=R==="named"?$o(T):!1;H&&(N=T,D=H)}let F=1+E-x,Y="";if(!(!B&&n.nonTerminated===!1))if(!T)R!=="named"&&C(4,F);else if(R==="named"){if(B&&!D)C(5,1);else if(N!==T&&(E=y+N.length,F=1+E-y,B=!1),!B){const H=N?1:3;if(n.attribute){const z=e.charCodeAt(E);z===61?(C(H,F),D=""):O1(z)?D="":C(H,F)}else C(H,F)}Y=D}else{B||C(2,F);let H=Number.parseInt(T,R==="hexadecimal"?16:10);if(fj(H))C(7,F),Y="�";else if(H in L1)C(6,F),Y=L1[H];else{let z="";dj(H)&&C(6,F),H>65535&&(H-=65536,z+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),Y=z+String.fromCharCode(H)}}if(Y){b(),_=w(),l=E-1,d+=E-x+1,a.push(Y);const H=w();H.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,Y,{start:_,end:H},e.slice(x-1,E)),_=H}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else v===10&&(p++,u++,d=0),Number.isNaN(v)?b():(o+=String.fromCharCode(v),d++);return a.join("");function w(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function C(S,x){let y;n.warning&&(y=w(),y.column+=x,y.offset+=x,n.warning.call(n.warningContext||void 0,uj[S],y,S))}function b(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:_,end:w()}),o="")}}function fj(e){return e>=55296&&e<=57343||e>1114111}function dj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var pj=0,$c={},Yt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++pj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Yt.util.type(t)){case"Object":if(a=Yt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Yt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:$c,plaintext:$c,text:$c,txt:$c,extend:function(e,t){var n=Yt.util.clone(Yt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Yt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Yt.languages.DFS(Yt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Yt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Yt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yt.tokenize(r.code,r.grammar),Yt.hooks.run("after-tokenize",r),Io.stringify(Yt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new gj;return hu(a,a.head,e),_w(e,a,t,a.head,0),_j(a)},hooks:{all:{},add:function(e,t){var n=Yt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:Io};function Io(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function B1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function _w(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c<o.length;++c){if(l&&l.cause==u+","+c)return;var f=o[c],p=f.inside,d=!!f.lookbehind,_=!!f.greedy,v=f.alias;if(_&&!f.pattern.global){var w=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,w+"g")}for(var C=f.pattern||f,b=r.next,S=a;b!==t.tail&&!(l&&S>=l.reach);S+=b.value.length,b=b.next){var x=b.value;if(t.length>e.length)return;if(!(x instanceof Io)){var y=1,E;if(_){if(E=B1(C,S,e,d),!E||E.index>=e.length)break;var T=E.index,R=E.index+E[0].length,N=S;for(N+=b.value.length;T>=N;)b=b.next,N+=b.value.length;if(N-=b.value.length,S=N,b.value instanceof Io)continue;for(var D=b;D!==t.tail&&(N<R||typeof D.value=="string");D=D.next)y++,N+=D.value.length;y--,x=e.slice(S,N),E.index-=S}else if(E=B1(C,0,x,d),!E)continue;var T=E.index,j=E[0],B=x.slice(0,T),F=x.slice(T+j.length),Y=S+x.length;l&&Y>l.reach&&(l.reach=Y);var H=b.prev;B&&(H=hu(t,H,B),S+=B.length),mj(t,H,y);var z=new Io(u,p?Yt.tokenize(j,p):j,v,j);if(b=hu(t,H,z),F&&hu(t,b,F),y>1){var V={cause:u+","+c,reach:Y};_w(e,t,n,b.prev,S,V),l&&V.reach>l.reach&&(l.reach=V.reach)}}}}}}function gj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function hu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function mj(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}function _j(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const vw=Yt;function yw(){}yw.prototype=vw;const je=new yw;je.highlight=vj;je.register=yj;je.alias=bj;je.registered=Sj;je.listLanguages=xj;je.util.encode=wj;je.Token.stringify=Gp;function vj(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(je.languages,r))n=je.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:vw.highlight.call(je,e,n,r)}}function yj(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(je.languages,e.displayName)||e(je)}function bj(e,t){const n=je.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let a;for(a in r)if(Object.hasOwn(r,a)){const l=r[a],u=typeof l=="string"?[l]:l;let o=-1;for(;++o<u.length;)n[u[o]]=n[a]}}function Sj(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(je.languages,e)}function xj(){const e=je.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Gp(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let a=-1;for(;++a<e.length;)e[a]!==null&&e[a]!==void 0&&e[a]!==""&&r.push(Gp(e[a],t));return r}const n={attributes:{},classes:["token",e.type],content:Gp(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),je.hooks.run("wrap",n),aj(n.tag+"."+n.classes.join("."),Cj(n.attributes),n.content)}function wj(e){return e}function Cj(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=hj(e[t]));return e}je.register(di);je.register(ul);je.register(Zu);je.register(Fg);je.register(Pg);je.register(Ug);je.register(hl);je.register(Ca);je.register($g);je.register(Gg);je.register(qg);je.register(Vg);je.register(Yg);je.register(Qu);je.register(Wg);je.register(Xg);je.register(Kg);je.register(Zg);je.register(Qg);je.register(Jg);je.register(em);je.register(tm);je.register(nm);je.register(Ju);je.register(im);je.register(rm);je.register(sm);je.register(am);je.register(om);je.register(lm);je.register(cm);je.register(um);je.register(hm);je.register(fm);je.register(eh);je.register(dm);function bw(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:m.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(bw)},t)}function Sw(e,t,n=3e5){if(!t||!je.registered(t)||e.length>n)return e;try{return je.highlight(e,t).children.map(bw)}catch{return e}}const Ej=1e5;function kj({code:e,lang:t}){const[n,r]=q.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return m.jsxs("div",{className:"md-code",children:[m.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})}),m.jsx("pre",{children:m.jsx("code",{children:Sw(e,t,Ej)})})]})}function Aj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function Nj(e){const t=/<file\b([^>]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Aj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(r<e.length&&n.push({type:"text",value:e.slice(r)}),n):null}function xw(e){const t=e.children;if(t)for(let n=0;n<t.length;n+=1){const r=t[n];if(r){if(r.type==="html"&&typeof r.value=="string"){const a=Nj(r.value);if(a){t.splice(n,1,...a),n+=a.length-1;continue}}xw(r)}}}function Tj(){return e=>xw(e)}function I1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return m.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[m.jsx(GS,{size:12}),m.jsx("span",{className:"file-chip-label",children:l})]})}function Rj(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const ww={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` -`)))return m.jsx("code",{className:a,...r,children:n});const c=l?Up(l[1]):null;return m.jsx(kj,{code:u,lang:c})},pre:({children:e})=>m.jsx(m.Fragment,{children:e})};function qo({text:e,onOpenFile:t}){const n={"file-mention":r=>m.jsx(I1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&Rj(a)&&t?m.jsx(I1,{path:decodeURI(a),onOpenFile:t}):m.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...ww};return m.jsx("div",{className:"md",children:m.jsx($x,{remarkPlugins:[dw,Tj],components:n,children:e})})}function Dj({synthesized:e,onView:t,onApprove:n,onReject:r,onRevise:a}){const[l,u]=q.useState(!1),o=q.useRef(null),[c,f]=q.useState(!1),[p,d]=q.useState(""),_=q.useRef(null);q.useEffect(()=>{if(!l)return;const w=C=>{o.current&&!o.current.contains(C.target)&&u(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[l]),q.useEffect(()=>{var w;c&&((w=_.current)==null||w.focus())},[c]);const v=()=>{a(p.trim()||"no specific feedback — use your judgment"),d(""),f(!1)};return m.jsxs("div",{className:"plan-strip",children:[m.jsxs("div",{className:"plan-strip-info",children:[m.jsx(WS,{size:14,className:"plan-strip-icon"}),m.jsx("span",{className:"plan-strip-title",children:e?"Claude is ready to proceed":"Claude proposed a plan"}),m.jsx("button",{className:"plan-strip-open",onClick:t,children:"Open plan"})]}),c?m.jsxs(m.Fragment,{children:[m.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:p,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),d(""),f(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),v())}}),m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:()=>{d(""),f(!1)},children:"Back"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:v,children:["Revise",m.jsx(US,{size:13})]})]})]}):m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:r,children:"Reject"}),m.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("div",{className:"plan-strip-approve",ref:o,children:[m.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>n("auto"),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(w=>!w),children:m.jsx(cs,{size:13})}),l&&m.jsx("div",{className:"plan-strip-menu",children:m.jsx("button",{onClick:()=>{u(!1),n("bypass")},children:"Accept and bypass all"})})]})]})]})}function Cw({onSaved:e}){const[t,n]=q.useState(""),[r,a]=q.useState(!1),[l,u]=q.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await dT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return m.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[m.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),m.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),m.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&m.jsx("div",{className:"error",children:l})]})}function Mj(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function jj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),m.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),m.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),m.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),m.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),m.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),m.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function Lj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),m.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),m.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),m.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),m.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),m.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),m.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),m.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Oj({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:m.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function pm({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:m.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Ew({kind:e,size:t=16}){switch(e){case"modal_job":return m.jsx(Lj,{size:t});case"hf_job":return m.jsx(jj,{size:t});case"k8s_job":return m.jsx(Oj,{size:t});case"ssh_job":return m.jsx(Ap,{size:t});case"slurm_job":return m.jsx(DA,{size:t});case"openresearch_job":return m.jsx(zA,{size:t});case"local_job":return m.jsx(hN,{size:t});default:return m.jsx(Ap,{size:t})}}function Bj({backend:e}){const t=ix(e),n=rx(e);return t?m.jsxs("span",{className:"backend-badge",children:[m.jsx(Ew,{kind:t}),m.jsx("span",{className:"backend-name",children:Mj(t)}),n&&m.jsx("span",{className:"backend-detail mono",children:n})]}):m.jsx("span",{className:"backend-badge muted",children:"—"})}const z1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Ij(e){return z1[e]??z1.idle}function Vo({status:e,label:t}){const n=Ij(e);return m.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[m.jsx("span",{className:"dot"}),t??e]})}function lp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function zj({h:e}){return e.authMethod?m.jsx(m.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):m.jsx(m.Fragment,{children:"—"})}function Hj(){const[e,t]=q.useState(null),[n,r]=q.useState("claude-code"),[a,l]=q.useState(!1),u=c=>{l(!0),wg(c).then(t).catch(()=>{}).finally(()=>l(!1))};q.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Harnesses"}),m.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),m.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>m.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,m.jsx("span",{className:`harness-dot ${lp(c).cls}`})]},c.id))}),e?o?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("span",{className:`badge ${lp(o).cls}`,children:lp(o).label}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Binary"}),m.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),m.jsx("span",{className:"k",children:"Version"}),m.jsx("span",{className:"v",children:o.version??"—"}),m.jsx("span",{className:"k",children:"Auth"}),m.jsx("span",{className:"v",children:m.jsx(zj,{h:o})}),o.account&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),m.jsx("span",{className:"v",children:o.account})]}),o.org&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Org"}),m.jsx("span",{className:"v",children:o.org})]}),o.plan&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Plan"}),m.jsx("span",{className:"v",children:o.plan})]}),m.jsx("span",{className:"k",children:"Agent models"}),m.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>xu(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&m.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function Fj({s:e}){if(!e.configured)return m.jsx("span",{className:"badge",children:"not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"no job-create permission"}):m.jsx("span",{className:"badge err",children:"cluster unreachable"}):m.jsx("span",{className:"badge err",children:"kubectl not found"})}function Pj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(""),[c,f]=q.useState(!1),[p,d]=q.useState(null),_=C=>{t(C),l(C.context??""),o(C.namespace)};q.useEffect(()=>{YN().then(_).catch(C=>r(C instanceof Error?C.message:String(C)))},[]);const v=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function w(C){if(C.preventDefault(),!c){f(!0),d(null);try{_(await WN({context:a,namespace:u.trim()}))}catch(b){d(b instanceof Error?b.message:String(b))}finally{f(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",m.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Cluster"}),m.jsx("span",{className:"v",children:m.jsx(Fj,{s:e})})]}),e.preflight.error&&m.jsx("p",{className:"settings-note",children:e.preflight.error}),m.jsxs("form",{className:"form settings-form",onSubmit:w,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Context",m.jsxs("select",{value:a,onChange:C=>l(C.target.value),children:[m.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(C=>m.jsx("option",{value:C,children:C},C))]})]}),m.jsxs("label",{children:["Namespace",m.jsx("input",{className:"mono",type:"text",value:u,onChange:C=>o(C.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&m.jsx("div",{className:"error",children:p}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:c||v,children:c?"Saving…":"Save"})})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("div",{className:"settings-card-head",children:m.jsx("h3",{children:"Run manifest"})}),m.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",m.jsx("code",{children:".orx/k8s.yaml"}),", or ",m.jsx("code",{children:"--manifest <path>"}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",m.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",m.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",m.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",m.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const Uj={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function $j({s:e}){return e.ready?m.jsx("span",{className:"badge ok",children:"connected"}):!e.tokenConfigured&&!e.modalImportable?m.jsx("span",{className:"badge",children:"not set up"}):e.modalImportable?e.tokenConfigured?m.jsx("span",{className:"badge",children:"unknown"}):m.jsx("span",{className:"badge err",children:"no token"}):m.jsx("span",{className:"badge err",children:e.envProvisioned?"env broken":"env not built"})}function Gj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[u,o]=q.useState(null);q.useEffect(()=>{XN().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await KN())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",m.jsx("code",{children:"--backend modal --flavor <name>"})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx($j,{s:e})}),m.jsx("span",{className:"k",children:"Environment"}),m.jsx("span",{className:"v",children:e.modalImportable?"ready":e.envProvisioned?"provisioned (modal import failing)":"not built yet"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.tokenSource?Uj[e.tokenSource]:"not configured"})]}),!e.tokenConfigured&&m.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",m.jsx("code",{children:"modal token new"}),", or add"," ",m.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",m.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&m.jsx("p",{className:"settings-note",children:e.error}),u&&m.jsx("div",{className:"error",children:u}),!e.modalImportable&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function qj({test:e}){if(e===void 0)return m.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return m.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"});return m.jsxs(m.Fragment,{children:[t,m.jsx("span",{className:"ssh-tested-at",children:Sa(e.testedAt)})]})}function Vj(){const[e,t]=q.useState(null),[n,r]=q.useState({});q.useEffect(()=>{nT().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await iT(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",m.jsx("code",{children:"--backend ssh --host <alias>"}),". Hosts come from"," ",m.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",m.jsx("code",{children:"git"})," and ",m.jsx("code",{children:"bash"}),"."]}),e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?m.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):m.jsxs("table",{className:"flavor-table ssh-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Host"}),m.jsx("th",{children:"Address"}),m.jsx("th",{children:"Identity"}),m.jsx("th",{children:"Status"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:e.map(l=>m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:l.host}),m.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),m.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),m.jsx("td",{children:m.jsx(qj,{test:n[l.host]??l.lastTest})}),m.jsx("td",{children:m.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function Yj({test:e}){return e===null?null:e==="testing"?m.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",children:"no slurm CLI"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"})}function Wj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(""),[c,f]=q.useState(""),[p,d]=q.useState(""),[_,v]=q.useState(!1),[w,C]=q.useState(null),[b,S]=q.useState(null),x=b!==null&&b!=="testing"?b:null,y=D=>{t(D),l(D.host??""),o(D.partition??""),f(D.account??""),d(D.timeLimit??"")};q.useEffect(()=>{rT().then(y).catch(D=>r(D instanceof Error?D.message:String(D)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function R(D){if(D.preventDefault(),!_){v(!0),C(null);try{y(await sT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){C(T instanceof Error?T.message:String(T))}finally{v(!1)}}}async function N(D){S("testing");try{S(await aT(D))}catch(T){S({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",m.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[(x==null?void 0:x.error)&&m.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&m.jsxs("p",{className:"settings-note",children:["Partitions: ",m.jsx("code",{children:x.partitions.join(", ")})]}),m.jsxs("form",{className:"form settings-form",onSubmit:R,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Login node",m.jsxs("select",{value:a,onChange:D=>{l(D.target.value),S(null)},children:[m.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(D=>D.host===a)&&m.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(D=>m.jsx("option",{value:D.host,children:D.host},D.host))]})]}),m.jsxs("label",{children:["Partition",m.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:D=>o(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(D=>m.jsx("option",{value:D},D))})]})]}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Account",m.jsx("input",{className:"mono",type:"text",value:c,onChange:D=>f(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),m.jsxs("label",{children:["Time limit",m.jsx("input",{className:"mono",type:"text",value:p,onChange:D=>d(D.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),w&&m.jsx("div",{className:"error",children:w}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn primary",disabled:_||E,children:_?"Saving…":"Save"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||b==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),m.jsx(Yj,{test:b})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function Xj(){const[e,t]=q.useState(null),[n,r]=q.useState(null);return q.useEffect(()=>{lT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",m.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Hostname"}),m.jsx("span",{className:"v mono",children:e.hostname}),m.jsx("span",{className:"k",children:"System"}),m.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),m.jsx("span",{className:"k",children:"CPU"}),m.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),m.jsx("span",{className:"k",children:"RAM"}),m.jsx("span",{className:"v",children:e.memBytes!==null?ns(e.memBytes):"—"}),m.jsx("span",{className:"k",children:"GPUs"}),m.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ns(a.memMib*1024*1024)}`:""}`).join(", ")})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function Kj(){const[e,t]=q.useState(null),[n,r]=q.useState(null);return q.useEffect(()=>{cT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",m.jsx("code",{children:"--backend openresearch --flavor <shape>"})," (h100_sxm, cpu5c, …; browse with ",m.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",m.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?m.jsx("div",{className:"error",children:n}):e?e.loggedIn?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx("span",{className:"badge ok",children:"signed in"})}),m.jsx("span",{className:"k",children:"Orgs"}),m.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),m.jsx("span",{className:"k",children:"SSH key"}),m.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?m.jsx("span",{className:"badge ok",children:"registered"}):e.sshKeyRegistered===!1?m.jsx("span",{className:"badge err",children:"none registered"}):m.jsx("span",{className:"badge",children:"unknown"})})]}),e.sshKeyRegistered===!1&&m.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",m.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&m.jsx("p",{className:"settings-note",children:e.error})]}):m.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",m.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const H1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},Zj={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},Qj=["hf","modal","slurm","openresearch"],F1=["hf","modal","openresearch"],P1={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function Jj({t:e,isDefault:t}){return e.id==="local"?m.jsx("span",{className:"badge ok",children:"ready"}):!e.configured&&t?m.jsx("span",{className:"badge warn",children:"not configured"}):e.configured?m.jsx("span",{className:"badge ok",children:"configured"}):m.jsx("span",{className:"badge",children:"not set up"})}function eL({target:e,flavor:t,onSaved:n}){var d;const[r,a]=q.useState(t??""),[l,u]=q.useState(!1),[o,c]=q.useState(null);q.useEffect(()=>a(t??""),[t]);async function f(_){if(_.preventDefault(),!l){u(!0),c(null);try{n(await tx({backend:e,flavor:r.trim()||null}))}catch(v){c(v instanceof Error?v.message:String(v))}finally{u(!1)}}}const p=r.trim()===(t??"");return m.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[m.jsxs("label",{children:["Default flavor",m.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:_=>a(_.target.value),placeholder:F1.includes(e)?`e.g. ${((d=P1[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:`flavors-${e}`,children:(P1[e]??[]).map(_=>m.jsx("option",{value:_},_))})]}),o&&m.jsx("div",{className:"error",children:o}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),F1.includes(e)&&!t&&m.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",m.jsx("code",{children:"--flavor"}),"."]})]})]})}function tL({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=q.useState(!1),[f,p]=q.useState(!1);r&&!o&&c(!0);async function d(_){if(!f){p(!0);try{l(await tx({backend:_}))}catch(v){u(v instanceof Error?v.message:String(v))}finally{p(!1)}}}return m.jsxs("div",{className:`compute-row${r?" open":""}`,children:[m.jsxs("div",{className:"compute-row-head",onClick:a,children:[m.jsx("span",{className:"compute-row-logo",children:m.jsx(Ew,{kind:Zj[e.id],size:18})}),m.jsx("span",{className:"compute-row-name",children:H1[e.id]}),m.jsx("span",{className:"compute-row-summary",children:e.summary}),m.jsx(Jj,{t:e,isDefault:t}),t?m.jsx("span",{className:"badge compute-default-pill",children:"Default"}):m.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:_=>{_.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),m.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${H1[e.id]}`,onClick:_=>{_.stopPropagation(),a()},children:m.jsx(cs,{size:16,className:"compute-chevron"})})]}),o&&m.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&m.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",m.jsx("code",{children:"orx exp run"})," with no ",m.jsx("code",{children:"--backend"})," flag."," ",m.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&m.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&Qj.includes(e.id)&&m.jsx(eL,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&m.jsx(Xj,{}),e.id==="hf"&&m.jsx(aL,{}),e.id==="modal"&&m.jsx(Gj,{}),e.id==="k8s"&&m.jsx(Pj,{}),e.id==="ssh"&&m.jsx(Vj,{}),e.id==="slurm"&&m.jsx(Wj,{}),e.id==="openresearch"&&m.jsx(Kj,{})]})]})}function nL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(null),[u,o]=q.useState(null),c=q.useRef(0);q.useEffect(()=>{const d=++c.current;oT().then(_=>{d===c.current&&(t(_),r(null))}).catch(_=>{if(d!==c.current)return;const v=_ instanceof Error?_.message:String(_);t(w=>(w===null?r(v):o(v),w))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Compute"}),m.jsxs("p",{className:"settings-sub",children:["Where ",m.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",m.jsx("code",{children:"--backend <name>"})," always wins)."]}),n?m.jsx("div",{className:"error",children:n}):p?m.jsxs(m.Fragment,{children:[u&&m.jsx("div",{className:"error",children:u}),m.jsx("div",{className:"compute-list",children:p.map(d=>m.jsx(tL,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(_=>_===d.id?null:d.id),onSettings:f,onError:o},d.id))}),m.jsxs("p",{className:"compute-footnote",children:[m.jsx(cN,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const iL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function rL({settings:e}){return e.configured?e.valid?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"invalid token"}):m.jsx("span",{className:"badge",children:"not configured"})}function sL({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?m.jsx("span",{className:"badge ok",children:"jobs: write OK"}):e.jobsWrite===!1?m.jsx("span",{className:"badge err",children:"no job.write permission"}):m.jsx("span",{className:"badge",children:"jobs permission unknown"})}function aL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null),p=q.useRef(!1);q.useEffect(()=>{qN().then(_=>{p.current||t(_)}).catch(_=>{p.current||r(_ instanceof Error?_.message:String(_))})},[]);async function d(_){if(_.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const v=await VN(a.trim());p.current=!0,t(v),r(null),l("")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",m.jsx("code",{children:"--backend hf --flavor <name>"})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(rL,{settings:e})}),m.jsx("span",{className:"k",children:"Account"}),m.jsx("span",{className:"v",children:e.username??"—"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.maskedToken??"—"}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:e.source?iL[e.source]:"not configured"}),m.jsx("span",{className:"k",children:"Jobs"}),m.jsxs("span",{className:"v",children:[m.jsx(sL,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&m.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&m.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",m.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",m.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading status…"]}),m.jsxs("form",{className:"form settings-form",onSubmit:d,children:[m.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",m.jsx("input",{type:"password",value:a,onChange:_=>l(_.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const kw=/^hf_[A-Za-z0-9]{10,}$/;function Aw(){return m.jsx("tr",{children:m.jsx("td",{colSpan:3,children:m.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",m.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const U1=["HF_TOKEN","WANDB_API_KEY"];function oL({name:e,entry:t,onVars:n,onError:r}){const[a,l]=q.useState(""),[u,o]=q.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await JS(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await QN(e))}catch(d){c(d)}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:e}),m.jsx("td",{className:"mono muted",children:t?m.jsxs(m.Fragment,{children:[t.maskedValue,t.inProcessEnv&&m.jsx("span",{className:"badge",children:"overridden by env"})]}):m.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),m.jsx("td",{children:t?m.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:m.jsx(Gu,{size:13})}):a.trim()&&m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&kw.test(a.trim())&&m.jsx(Aw,{})]})}function lL({onVars:e,onError:t,onDone:n}){const[r,a]=q.useState(""),[l,u]=q.useState(""),[o,c]=q.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await JS(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),m.jsx("td",{children:m.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),m.jsxs("td",{children:[m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),m.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:m.jsx(Fo,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&kw.test(l.trim())&&m.jsx(Aw,{})]})}function cL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[u,o]=q.useState(null);q.useEffect(()=>{ZN().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!U1.includes(d)),p=[...U1,...f];return m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Environment variables"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[m.jsx(bg,{size:12})," Add variable"]})]}),m.jsxs("p",{className:"settings-sub",children:["Stored in ",m.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",m.jsx("code",{children:"HF_TOKEN"})," and ",m.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?m.jsx("div",{className:"error",children:n}):e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsx("table",{className:"env-table",children:m.jsxs("tbody",{children:[p.map(d=>m.jsx(oL,{name:d,entry:e.find(_=>_.key===d),onVars:c,onError:o},d)),a&&m.jsx(lL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&m.jsx("div",{className:"error",children:u})]})}function uL(){const[e,t]=q.useState(null),[n,r]=q.useState(""),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null);q.useEffect(()=>{nx().then(_=>{t(_),r(_.userName??""),l(_.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(_){if(_.preventDefault(),!(u||p)){o(!0),f(null);try{const v=await fT({userName:n.trim(),userEmail:a.trim()});t(v),r(v.userName??""),l(v.userEmail??"")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Git"}),m.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("form",{className:"form",onSubmit:d,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["user.name",m.jsx("input",{type:"text",value:n,onChange:_=>r(_.target.value),autoComplete:"off"})]}),m.jsxs("label",{children:["user.email",m.jsx("input",{type:"text",value:a,onChange:_=>l(_.target.value),autoComplete:"off"})]})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"GitHub access"}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"git"}),m.jsx("span",{className:"v",children:e.gitVersion??"not found"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",m.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),m.jsx(Cw,{onSaved:t})]}),e.githubTokenSource==="stored"&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn",onClick:()=>{pT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}function hL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return m.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[m.jsx("div",{className:"progress-track",children:m.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),m.jsxs("div",{className:"progress-caption",children:[m.jsx("span",{children:n??`${r}%`}),t>0&&m.jsxs("span",{className:"mono",children:[ns(e)," / ",ns(t)]})]})]})}const fL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function dL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null),[p,d]=q.useState({kind:"idle"}),[_,v]=q.useState(null),w=()=>ex().then(E=>{t(E),l(R=>R||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));q.useEffect(()=>{w()},[]),q.useEffect(()=>RT(E=>{E.type==="progress"?d(R=>{const N=R.kind==="moving"?R.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),w()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const C=(e==null?void 0:e.source)==="env",b=a.trim(),S=e!==null&&b===e.current;async function x(){if(!(u||!b)){o(!0),v(null),f(null);try{f(await JN(b))}catch(E){v(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function y(E){if(E.preventDefault(),!(p.kind==="moving"||!b||S)&&(v(null),!!window.confirm(`Move all orx data to: +|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Gg.displayName="go";Gg.aliases=[];function Gg(e){e.register(di),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}qg.displayName="ini";qg.aliases=[];function qg(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}Vg.displayName="java";Vg.aliases=[];function Vg(e){e.register(di),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Yg.displayName="regex";Yg.aliases=[];function Yg(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(e)}Qu.displayName="javascript";Qu.aliases=["js"];function Qu(e){e.register(di),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}Wg.displayName="json";Wg.aliases=["webmanifest"];function Wg(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}Xg.displayName="kotlin";Xg.aliases=["kt","kts"];function Xg(e){e.register(di),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}Kg.displayName="less";Kg.aliases=[];function Kg(e){e.register(Ca),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}Zg.displayName="lua";Zg.aliases=[];function Zg(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}Qg.displayName="makefile";Qg.aliases=[];function Qg(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}Jg.displayName="yaml";Jg.aliases=["yml"];function Jg(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}em.displayName="markdown";em.aliases=["md"];function em(e){e.register(hl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p<d;p++){var _=f[p];if(_.type!=="code"){c(_.content);continue}var v=_.content[1],w=_.content[3];if(v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"){var C=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var b="language-"+C;w.alias?typeof w.alias=="string"?w.alias=[w.alias,b]:w.alias.push(b):w.alias=[b]}}}c(o.tokens)}),t.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",f=0,p=o.classes.length;f<p;f++){var d=o.classes[f],_=/language-(.+)/.exec(d);if(_){c=_[1];break}}var v=t.languages[c];if(v)o.content=t.highlight(o.content.value,v,c);else if(c&&c!=="none"&&t.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);o.attributes.id=w,t.plugins.autoloader.loadLanguages(c,function(){var C=document.getElementById(w);C&&(C.innerHTML=t.highlight(C.textContent,t.languages[c],c))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}tm.displayName="objectivec";tm.aliases=["objc"];function tm(e){e.register(ul),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}nm.displayName="perl";nm.aliases=[];function nm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ju.displayName="markup-templating";Ju.aliases=[];function Ju(e){e.register(hl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f<c.length&&!(l>=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],_=r.tokenStack[d],v=typeof p=="string"?p:p.content,w=n(a,d),C=v.indexOf(w);if(C>-1){++l;var b=v.substring(0,C),S=new t.Token(a,t.tokenize(_,r.grammar),"language-"+a,_),x=v.substring(C+w.length),y=[];b&&y.push.apply(y,o([b])),y.push(S),x&&y.push.apply(y,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(y)):p.content=y}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}im.displayName="php";im.aliases=[];function im(e){e.register(Ju),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}rm.displayName="python";rm.aliases=["py"];function rm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}sm.displayName="r";sm.aliases=[];function sm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}am.displayName="ruby";am.aliases=["rb"];function am(e){e.register(di),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}om.displayName="rust";om.aliases=[];function om(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}lm.displayName="sass";lm.aliases=[];function lm(e){e.register(Ca),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}cm.displayName="scss";cm.aliases=[];function cm(e){e.register(Ca),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}um.displayName="sql";um.aliases=[];function um(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}hm.displayName="swift";hm.aliases=[];function hm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}fm.displayName="typescript";fm.aliases=["ts"];function fm(e){e.register(Qu),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}eh.displayName="basic";eh.aliases=[];function eh(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}dm.displayName="vbnet";dm.aliases=[];function dm(e){e.register(eh),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const M1=/[#.]/g;function ZM(e,t){const n=e||"",r={};let a=0,l,u;for(;a<n.length;){M1.lastIndex=a;const o=M1.exec(n),c=n.slice(a,o?o.index:n.length);c&&(l?l==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:u=c,a+=c.length),o&&(l=o[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function fw(e,t,n){const r=n?tj(n):void 0;function a(l,u,...o){let c;if(l==null){c={type:"root",children:[]};const f=u;o.unshift(f)}else{c=ZM(l,t);const f=c.tagName.toLowerCase(),p=r?r.get(f):void 0;if(c.tagName=p||f,QM(u))o.unshift(u);else for(const[d,_]of Object.entries(u))JM(e,c.properties,d,_)}for(const f of o)$p(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return a}function QM(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const l=a;for(const u of l)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function JM(e,t,n,r){const a=ux(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?a.spaceSeparated?l=Vy(r):a.commaSeparated?l=Py(r):a.commaOrSpaceSeparated?l=Vy(Py(r).join(" ")):l=j1(a,a.property,r):Array.isArray(r)?l=[...r]:l=a.property==="style"?ej(r):String(r);if(Array.isArray(l)){const u=[];for(const o of l)u.push(j1(a,a.property,o));l=u}a.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[a.property]=l}}function $p(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)$p(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$p(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function j1(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Po(n)===Po(t)))return!0}return n}function ej(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function tj(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const nj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],ij=fw(hx,"div");fw(qu,"g",nj);const rj=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],L1={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function dw(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function sj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function aj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function O1(e){return aj(e)||dw(e)}const oj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function lj(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,_=w(),v;for(l--;++l<=e.length;)if(v===10&&(d=(f?f[u]:0)||1),v=e.charCodeAt(l),v===38){const S=e.charCodeAt(l+1);if(S===9||S===10||S===12||S===32||S===38||S===60||Number.isNaN(S)||r&&S===r){o+=String.fromCharCode(v),d++;continue}const x=l+1;let y=x,E=x,R;if(S===35){E=++y;const U=e.charCodeAt(E);U===88||U===120?(R="hexadecimal",E=++y):R="decimal"}else R="named";let N="",D="",T="";const j=R==="named"?O1:R==="decimal"?dw:sj;for(E--;++E<=e.length;){const U=e.charCodeAt(E);if(!j(U))break;T+=String.fromCharCode(U),R==="named"&&rj.includes(T)&&(N=T,D=$o(T))}let B=e.charCodeAt(E)===59;if(B){E++;const U=R==="named"?$o(T):!1;U&&(N=T,D=U)}let z=1+E-x,G="";if(!(!B&&n.nonTerminated===!1))if(!T)R!=="named"&&C(4,z);else if(R==="named"){if(B&&!D)C(5,1);else if(N!==T&&(E=y+N.length,z=1+E-y,B=!1),!B){const U=N?1:3;if(n.attribute){const H=e.charCodeAt(E);H===61?(C(U,z),D=""):O1(H)?D="":C(U,z)}else C(U,z)}G=D}else{B||C(2,z);let U=Number.parseInt(T,R==="hexadecimal"?16:10);if(cj(U))C(7,z),G="�";else if(U in L1)C(6,z),G=L1[U];else{let H="";uj(U)&&C(6,z),U>65535&&(U-=65536,H+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),G=H+String.fromCharCode(U)}}if(G){b(),_=w(),l=E-1,d+=E-x+1,a.push(G);const U=w();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,G,{start:_,end:U},e.slice(x-1,E)),_=U}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else v===10&&(p++,u++,d=0),Number.isNaN(v)?b():(o+=String.fromCharCode(v),d++);return a.join("");function w(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function C(S,x){let y;n.warning&&(y=w(),y.column+=x,y.offset+=x,n.warning.call(n.warningContext||void 0,oj[S],y,S))}function b(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:_,end:w()}),o="")}}function cj(e){return e>=55296&&e<=57343||e>1114111}function uj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var hj=0,$c={},Yt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++hj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Yt.util.type(t)){case"Object":if(a=Yt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Yt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:$c,plaintext:$c,text:$c,txt:$c,extend:function(e,t){var n=Yt.util.clone(Yt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Yt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Yt.languages.DFS(Yt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Yt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Yt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yt.tokenize(r.code,r.grammar),Yt.hooks.run("after-tokenize",r),Io.stringify(Yt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new fj;return hu(a,a.head,e),pw(e,a,t,a.head,0),pj(a)},hooks:{all:{},add:function(e,t){var n=Yt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:Io};function Io(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function B1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function pw(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c<o.length;++c){if(l&&l.cause==u+","+c)return;var f=o[c],p=f.inside,d=!!f.lookbehind,_=!!f.greedy,v=f.alias;if(_&&!f.pattern.global){var w=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,w+"g")}for(var C=f.pattern||f,b=r.next,S=a;b!==t.tail&&!(l&&S>=l.reach);S+=b.value.length,b=b.next){var x=b.value;if(t.length>e.length)return;if(!(x instanceof Io)){var y=1,E;if(_){if(E=B1(C,S,e,d),!E||E.index>=e.length)break;var T=E.index,R=E.index+E[0].length,N=S;for(N+=b.value.length;T>=N;)b=b.next,N+=b.value.length;if(N-=b.value.length,S=N,b.value instanceof Io)continue;for(var D=b;D!==t.tail&&(N<R||typeof D.value=="string");D=D.next)y++,N+=D.value.length;y--,x=e.slice(S,N),E.index-=S}else if(E=B1(C,0,x,d),!E)continue;var T=E.index,j=E[0],B=x.slice(0,T),z=x.slice(T+j.length),G=S+x.length;l&&G>l.reach&&(l.reach=G);var U=b.prev;B&&(U=hu(t,U,B),S+=B.length),dj(t,U,y);var H=new Io(u,p?Yt.tokenize(j,p):j,v,j);if(b=hu(t,U,H),z&&hu(t,b,z),y>1){var Y={cause:u+","+c,reach:G};pw(e,t,n,b.prev,S,Y),l&&Y.reach>l.reach&&(l.reach=Y.reach)}}}}}}function fj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function hu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function dj(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}function pj(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const gw=Yt;function mw(){}mw.prototype=gw;const je=new mw;je.highlight=gj;je.register=mj;je.alias=_j;je.registered=vj;je.listLanguages=yj;je.util.encode=bj;je.Token.stringify=Gp;function gj(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(je.languages,r))n=je.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:gw.highlight.call(je,e,n,r)}}function mj(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(je.languages,e.displayName)||e(je)}function _j(e,t){const n=je.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let a;for(a in r)if(Object.hasOwn(r,a)){const l=r[a],u=typeof l=="string"?[l]:l;let o=-1;for(;++o<u.length;)n[u[o]]=n[a]}}function vj(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(je.languages,e)}function yj(){const e=je.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Gp(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let a=-1;for(;++a<e.length;)e[a]!==null&&e[a]!==void 0&&e[a]!==""&&r.push(Gp(e[a],t));return r}const n={attributes:{},classes:["token",e.type],content:Gp(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),je.hooks.run("wrap",n),ij(n.tag+"."+n.classes.join("."),Sj(n.attributes),n.content)}function bj(e){return e}function Sj(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=lj(e[t]));return e}je.register(di);je.register(ul);je.register(Zu);je.register(Fg);je.register(Pg);je.register(Ug);je.register(hl);je.register(Ca);je.register($g);je.register(Gg);je.register(qg);je.register(Vg);je.register(Yg);je.register(Qu);je.register(Wg);je.register(Xg);je.register(Kg);je.register(Zg);je.register(Qg);je.register(Jg);je.register(em);je.register(tm);je.register(nm);je.register(Ju);je.register(im);je.register(rm);je.register(sm);je.register(am);je.register(om);je.register(lm);je.register(cm);je.register(um);je.register(hm);je.register(fm);je.register(eh);je.register(dm);function _w(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:m.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(_w)},t)}function vw(e,t,n=3e5){if(!t||!je.registered(t)||e.length>n)return e;try{return je.highlight(e,t).children.map(_w)}catch{return e}}const xj=1e5;function wj({code:e,lang:t}){const[n,r]=V.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return m.jsxs("div",{className:"md-code",children:[m.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})}),m.jsx("pre",{children:m.jsx("code",{children:vw(e,t,xj)})})]})}function Cj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function Ej(e){const t=/<file\b([^>]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Cj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(r<e.length&&n.push({type:"text",value:e.slice(r)}),n):null}function yw(e){const t=e.children;if(t)for(let n=0;n<t.length;n+=1){const r=t[n];if(r){if(r.type==="html"&&typeof r.value=="string"){const a=Ej(r.value);if(a){t.splice(n,1,...a),n+=a.length-1;continue}}yw(r)}}}function kj(){return e=>yw(e)}function I1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return m.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[m.jsx(US,{size:12}),m.jsx("span",{className:"file-chip-label",children:l})]})}function Aj(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const bw={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` +`)))return m.jsx("code",{className:a,...r,children:n});const c=l?Up(l[1]):null;return m.jsx(wj,{code:u,lang:c})},pre:({children:e})=>m.jsx(m.Fragment,{children:e})};function qo({text:e,onOpenFile:t}){const n={"file-mention":r=>m.jsx(I1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&Aj(a)&&t?m.jsx(I1,{path:decodeURI(a),onOpenFile:t}):m.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...bw};return m.jsx("div",{className:"md",children:m.jsx(Fx,{remarkPlugins:[uw,kj],components:n,children:e})})}function Nj({synthesized:e,onView:t,onApprove:n,onReject:r,onRevise:a}){const[l,u]=V.useState(!1),o=V.useRef(null),[c,f]=V.useState(!1),[p,d]=V.useState(""),_=V.useRef(null);V.useEffect(()=>{if(!l)return;const w=C=>{o.current&&!o.current.contains(C.target)&&u(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[l]),V.useEffect(()=>{var w;c&&((w=_.current)==null||w.focus())},[c]);const v=()=>{a(p.trim()||"no specific feedback — use your judgment"),d(""),f(!1)};return m.jsxs("div",{className:"plan-strip",children:[m.jsxs("div",{className:"plan-strip-info",children:[m.jsx(VS,{size:14,className:"plan-strip-icon"}),m.jsx("span",{className:"plan-strip-title",children:e?"Claude is ready to proceed":"Claude proposed a plan"}),m.jsx("button",{className:"plan-strip-open",onClick:t,children:"Open plan"})]}),c?m.jsxs(m.Fragment,{children:[m.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:p,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),d(""),f(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),v())}}),m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:()=>{d(""),f(!1)},children:"Back"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:v,children:["Revise",m.jsx(FS,{size:13})]})]})]}):m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:r,children:"Reject"}),m.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("div",{className:"plan-strip-approve",ref:o,children:[m.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>n("auto"),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(w=>!w),children:m.jsx(cs,{size:13})}),l&&m.jsx("div",{className:"plan-strip-menu",children:m.jsx("button",{onClick:()=>{u(!1),n("bypass")},children:"Accept and bypass all"})})]})]})]})}function Sw({onSaved:e}){const[t,n]=V.useState(""),[r,a]=V.useState(!1),[l,u]=V.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await cT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return m.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[m.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),m.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),m.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&m.jsx("div",{className:"error",children:l})]})}function Tj(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function Rj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),m.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),m.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),m.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),m.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),m.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),m.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function Dj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),m.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),m.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),m.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),m.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),m.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),m.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),m.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Mj({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:m.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function pm({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:m.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function xw({kind:e,size:t=16}){switch(e){case"modal_job":return m.jsx(Dj,{size:t});case"hf_job":return m.jsx(Rj,{size:t});case"k8s_job":return m.jsx(Mj,{size:t});case"ssh_job":return m.jsx(Ap,{size:t});case"slurm_job":return m.jsx(AA,{size:t});case"openresearch_job":return m.jsx(LA,{size:t});case"local_job":return m.jsx(oN,{size:t});default:return m.jsx(Ap,{size:t})}}function jj({backend:e}){const t=tx(e),n=nx(e);return t?m.jsxs("span",{className:"backend-badge",children:[m.jsx(xw,{kind:t}),m.jsx("span",{className:"backend-name",children:Tj(t)}),n&&m.jsx("span",{className:"backend-detail mono",children:n})]}):m.jsx("span",{className:"backend-badge muted",children:"—"})}const z1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Lj(e){return z1[e]??z1.idle}function Vo({status:e,label:t}){const n=Lj(e);return m.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[m.jsx("span",{className:"dot"}),t??e]})}function lp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function Oj({h:e}){return e.authMethod?m.jsx(m.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):m.jsx(m.Fragment,{children:"—"})}function Bj(){const[e,t]=V.useState(null),[n,r]=V.useState("claude-code"),[a,l]=V.useState(!1),u=c=>{l(!0),wg(c).then(t).catch(()=>{}).finally(()=>l(!1))};V.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Harnesses"}),m.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),m.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>m.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,m.jsx("span",{className:`harness-dot ${lp(c).cls}`})]},c.id))}),e?o?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("span",{className:`badge ${lp(o).cls}`,children:lp(o).label}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Binary"}),m.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),m.jsx("span",{className:"k",children:"Version"}),m.jsx("span",{className:"v",children:o.version??"—"}),m.jsx("span",{className:"k",children:"Auth"}),m.jsx("span",{className:"v",children:m.jsx(Oj,{h:o})}),o.account&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),m.jsx("span",{className:"v",children:o.account})]}),o.org&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Org"}),m.jsx("span",{className:"v",children:o.org})]}),o.plan&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Plan"}),m.jsx("span",{className:"v",children:o.plan})]}),m.jsx("span",{className:"k",children:"Agent models"}),m.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>xu(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&m.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function Ij({s:e}){if(!e.configured)return m.jsx("span",{className:"badge",children:"not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"no job-create permission"}):m.jsx("span",{className:"badge err",children:"cluster unreachable"}):m.jsx("span",{className:"badge err",children:"kubectl not found"})}function zj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(""),[c,f]=V.useState(!1),[p,d]=V.useState(null),_=C=>{t(C),l(C.context??""),o(C.namespace)};V.useEffect(()=>{$N().then(_).catch(C=>r(C instanceof Error?C.message:String(C)))},[]);const v=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function w(C){if(C.preventDefault(),!c){f(!0),d(null);try{_(await GN({context:a,namespace:u.trim()}))}catch(b){d(b instanceof Error?b.message:String(b))}finally{f(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",m.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Cluster"}),m.jsx("span",{className:"v",children:m.jsx(Ij,{s:e})})]}),e.preflight.error&&m.jsx("p",{className:"settings-note",children:e.preflight.error}),m.jsxs("form",{className:"form settings-form",onSubmit:w,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Context",m.jsxs("select",{value:a,onChange:C=>l(C.target.value),children:[m.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(C=>m.jsx("option",{value:C,children:C},C))]})]}),m.jsxs("label",{children:["Namespace",m.jsx("input",{className:"mono",type:"text",value:u,onChange:C=>o(C.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&m.jsx("div",{className:"error",children:p}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:c||v,children:c?"Saving…":"Save"})})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("div",{className:"settings-card-head",children:m.jsx("h3",{children:"Run manifest"})}),m.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",m.jsx("code",{children:".orx/k8s.yaml"}),", or ",m.jsx("code",{children:"--manifest <path>"}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",m.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",m.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",m.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",m.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const Hj={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function Fj({s:e}){return e.ready?m.jsx("span",{className:"badge ok",children:"connected"}):!e.tokenConfigured&&!e.modalImportable?m.jsx("span",{className:"badge",children:"not set up"}):e.modalImportable?e.tokenConfigured?m.jsx("span",{className:"badge",children:"unknown"}):m.jsx("span",{className:"badge err",children:"no token"}):m.jsx("span",{className:"badge err",children:e.envProvisioned?"env broken":"env not built"})}function Pj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[u,o]=V.useState(null);V.useEffect(()=>{qN().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await VN())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",m.jsx("code",{children:"--backend modal --flavor <name>"})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(Fj,{s:e})}),m.jsx("span",{className:"k",children:"Environment"}),m.jsx("span",{className:"v",children:e.modalImportable?"ready":e.envProvisioned?"provisioned (modal import failing)":"not built yet"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.tokenSource?Hj[e.tokenSource]:"not configured"})]}),!e.tokenConfigured&&m.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",m.jsx("code",{children:"modal token new"}),", or add"," ",m.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",m.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&m.jsx("p",{className:"settings-note",children:e.error}),u&&m.jsx("div",{className:"error",children:u}),!e.modalImportable&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function Uj({test:e}){if(e===void 0)return m.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return m.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"});return m.jsxs(m.Fragment,{children:[t,m.jsx("span",{className:"ssh-tested-at",children:Sa(e.testedAt)})]})}function $j(){const[e,t]=V.useState(null),[n,r]=V.useState({});V.useEffect(()=>{QN().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await JN(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",m.jsx("code",{children:"--backend ssh --host <alias>"}),". Hosts come from"," ",m.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",m.jsx("code",{children:"git"})," and ",m.jsx("code",{children:"bash"}),"."]}),e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?m.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):m.jsxs("table",{className:"flavor-table ssh-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Host"}),m.jsx("th",{children:"Address"}),m.jsx("th",{children:"Identity"}),m.jsx("th",{children:"Status"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:e.map(l=>m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:l.host}),m.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),m.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),m.jsx("td",{children:m.jsx(Uj,{test:n[l.host]??l.lastTest})}),m.jsx("td",{children:m.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function Gj({test:e}){return e===null?null:e==="testing"?m.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",children:"no slurm CLI"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"})}function qj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(""),[c,f]=V.useState(""),[p,d]=V.useState(""),[_,v]=V.useState(!1),[w,C]=V.useState(null),[b,S]=V.useState(null),x=b!==null&&b!=="testing"?b:null,y=D=>{t(D),l(D.host??""),o(D.partition??""),f(D.account??""),d(D.timeLimit??"")};V.useEffect(()=>{eT().then(y).catch(D=>r(D instanceof Error?D.message:String(D)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function R(D){if(D.preventDefault(),!_){v(!0),C(null);try{y(await tT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){C(T instanceof Error?T.message:String(T))}finally{v(!1)}}}async function N(D){S("testing");try{S(await nT(D))}catch(T){S({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",m.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[(x==null?void 0:x.error)&&m.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&m.jsxs("p",{className:"settings-note",children:["Partitions: ",m.jsx("code",{children:x.partitions.join(", ")})]}),m.jsxs("form",{className:"form settings-form",onSubmit:R,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Login node",m.jsxs("select",{value:a,onChange:D=>{l(D.target.value),S(null)},children:[m.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(D=>D.host===a)&&m.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(D=>m.jsx("option",{value:D.host,children:D.host},D.host))]})]}),m.jsxs("label",{children:["Partition",m.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:D=>o(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(D=>m.jsx("option",{value:D},D))})]})]}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Account",m.jsx("input",{className:"mono",type:"text",value:c,onChange:D=>f(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),m.jsxs("label",{children:["Time limit",m.jsx("input",{className:"mono",type:"text",value:p,onChange:D=>d(D.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),w&&m.jsx("div",{className:"error",children:w}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn primary",disabled:_||E,children:_?"Saving…":"Save"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||b==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),m.jsx(Gj,{test:b})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function Vj(){const[e,t]=V.useState(null),[n,r]=V.useState(null);return V.useEffect(()=>{rT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",m.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Hostname"}),m.jsx("span",{className:"v mono",children:e.hostname}),m.jsx("span",{className:"k",children:"System"}),m.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),m.jsx("span",{className:"k",children:"CPU"}),m.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),m.jsx("span",{className:"k",children:"RAM"}),m.jsx("span",{className:"v",children:e.memBytes!==null?ns(e.memBytes):"—"}),m.jsx("span",{className:"k",children:"GPUs"}),m.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ns(a.memMib*1024*1024)}`:""}`).join(", ")})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function Yj(){const[e,t]=V.useState(null),[n,r]=V.useState(null);return V.useEffect(()=>{sT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",m.jsx("code",{children:"--backend openresearch --flavor <shape>"})," (h100_sxm, cpu5c, …; browse with ",m.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",m.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?m.jsx("div",{className:"error",children:n}):e?e.loggedIn?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx("span",{className:"badge ok",children:"signed in"})}),m.jsx("span",{className:"k",children:"Orgs"}),m.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),m.jsx("span",{className:"k",children:"SSH key"}),m.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?m.jsx("span",{className:"badge ok",children:"registered"}):e.sshKeyRegistered===!1?m.jsx("span",{className:"badge err",children:"none registered"}):m.jsx("span",{className:"badge",children:"unknown"})})]}),e.sshKeyRegistered===!1&&m.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",m.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&m.jsx("p",{className:"settings-note",children:e.error})]}):m.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",m.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const H1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},Wj={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},Xj=["hf","modal","slurm","openresearch"],F1=["hf","modal","openresearch"],P1={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function Kj({t:e,isDefault:t}){return e.id==="local"?m.jsx("span",{className:"badge ok",children:"ready"}):!e.configured&&t?m.jsx("span",{className:"badge warn",children:"not configured"}):e.configured?m.jsx("span",{className:"badge ok",children:"configured"}):m.jsx("span",{className:"badge",children:"not set up"})}function Zj({target:e,flavor:t,onSaved:n}){var d;const[r,a]=V.useState(t??""),[l,u]=V.useState(!1),[o,c]=V.useState(null);V.useEffect(()=>a(t??""),[t]);async function f(_){if(_.preventDefault(),!l){u(!0),c(null);try{n(await JS({backend:e,flavor:r.trim()||null}))}catch(v){c(v instanceof Error?v.message:String(v))}finally{u(!1)}}}const p=r.trim()===(t??"");return m.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[m.jsxs("label",{children:["Default flavor",m.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:_=>a(_.target.value),placeholder:F1.includes(e)?`e.g. ${((d=P1[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:`flavors-${e}`,children:(P1[e]??[]).map(_=>m.jsx("option",{value:_},_))})]}),o&&m.jsx("div",{className:"error",children:o}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),F1.includes(e)&&!t&&m.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",m.jsx("code",{children:"--flavor"}),"."]})]})]})}function Qj({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=V.useState(!1),[f,p]=V.useState(!1);r&&!o&&c(!0);async function d(_){if(!f){p(!0);try{l(await JS({backend:_}))}catch(v){u(v instanceof Error?v.message:String(v))}finally{p(!1)}}}return m.jsxs("div",{className:`compute-row${r?" open":""}`,children:[m.jsxs("div",{className:"compute-row-head",onClick:a,children:[m.jsx("span",{className:"compute-row-logo",children:m.jsx(xw,{kind:Wj[e.id],size:18})}),m.jsx("span",{className:"compute-row-name",children:H1[e.id]}),m.jsx("span",{className:"compute-row-summary",children:e.summary}),m.jsx(Kj,{t:e,isDefault:t}),t?m.jsx("span",{className:"badge compute-default-pill",children:"Default"}):m.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:_=>{_.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),m.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${H1[e.id]}`,onClick:_=>{_.stopPropagation(),a()},children:m.jsx(cs,{size:16,className:"compute-chevron"})})]}),o&&m.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&m.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",m.jsx("code",{children:"orx exp run"})," with no ",m.jsx("code",{children:"--backend"})," flag."," ",m.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&m.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&Xj.includes(e.id)&&m.jsx(Zj,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&m.jsx(Vj,{}),e.id==="hf"&&m.jsx(iL,{}),e.id==="modal"&&m.jsx(Pj,{}),e.id==="k8s"&&m.jsx(zj,{}),e.id==="ssh"&&m.jsx($j,{}),e.id==="slurm"&&m.jsx(qj,{}),e.id==="openresearch"&&m.jsx(Yj,{})]})]})}function Jj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(null),[u,o]=V.useState(null),c=V.useRef(0);V.useEffect(()=>{const d=++c.current;iT().then(_=>{d===c.current&&(t(_),r(null))}).catch(_=>{if(d!==c.current)return;const v=_ instanceof Error?_.message:String(_);t(w=>(w===null?r(v):o(v),w))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Compute"}),m.jsxs("p",{className:"settings-sub",children:["Where ",m.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",m.jsx("code",{children:"--backend <name>"})," always wins)."]}),n?m.jsx("div",{className:"error",children:n}):p?m.jsxs(m.Fragment,{children:[u&&m.jsx("div",{className:"error",children:u}),m.jsx("div",{className:"compute-list",children:p.map(d=>m.jsx(Qj,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(_=>_===d.id?null:d.id),onSettings:f,onError:o},d.id))}),m.jsxs("p",{className:"compute-footnote",children:[m.jsx(sN,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const eL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function tL({settings:e}){return e.configured?e.valid?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"invalid token"}):m.jsx("span",{className:"badge",children:"not configured"})}function nL({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?m.jsx("span",{className:"badge ok",children:"jobs: write OK"}):e.jobsWrite===!1?m.jsx("span",{className:"badge err",children:"no job.write permission"}):m.jsx("span",{className:"badge",children:"jobs permission unknown"})}function iL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null),p=V.useRef(!1);V.useEffect(()=>{PN().then(_=>{p.current||t(_)}).catch(_=>{p.current||r(_ instanceof Error?_.message:String(_))})},[]);async function d(_){if(_.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const v=await UN(a.trim());p.current=!0,t(v),r(null),l("")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",m.jsx("code",{children:"--backend hf --flavor <name>"})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(tL,{settings:e})}),m.jsx("span",{className:"k",children:"Account"}),m.jsx("span",{className:"v",children:e.username??"—"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.maskedToken??"—"}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:e.source?eL[e.source]:"not configured"}),m.jsx("span",{className:"k",children:"Jobs"}),m.jsxs("span",{className:"v",children:[m.jsx(nL,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&m.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&m.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",m.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",m.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading status…"]}),m.jsxs("form",{className:"form settings-form",onSubmit:d,children:[m.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",m.jsx("input",{type:"password",value:a,onChange:_=>l(_.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const ww=/^hf_[A-Za-z0-9]{10,}$/;function Cw(){return m.jsx("tr",{children:m.jsx("td",{colSpan:3,children:m.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",m.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const U1=["HF_TOKEN","WANDB_API_KEY"];function rL({name:e,entry:t,onVars:n,onError:r}){const[a,l]=V.useState(""),[u,o]=V.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await ZS(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await WN(e))}catch(d){c(d)}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:e}),m.jsx("td",{className:"mono muted",children:t?m.jsxs(m.Fragment,{children:[t.maskedValue,t.inProcessEnv&&m.jsx("span",{className:"badge",children:"overridden by env"})]}):m.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),m.jsx("td",{children:t?m.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:m.jsx(Gu,{size:13})}):a.trim()&&m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&ww.test(a.trim())&&m.jsx(Cw,{})]})}function sL({onVars:e,onError:t,onDone:n}){const[r,a]=V.useState(""),[l,u]=V.useState(""),[o,c]=V.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await ZS(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),m.jsx("td",{children:m.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),m.jsxs("td",{children:[m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),m.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:m.jsx(Fo,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&ww.test(l.trim())&&m.jsx(Cw,{})]})}function aL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[u,o]=V.useState(null);V.useEffect(()=>{YN().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!U1.includes(d)),p=[...U1,...f];return m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Environment variables"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[m.jsx(bg,{size:12})," Add variable"]})]}),m.jsxs("p",{className:"settings-sub",children:["Stored in ",m.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",m.jsx("code",{children:"HF_TOKEN"})," and ",m.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?m.jsx("div",{className:"error",children:n}):e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsx("table",{className:"env-table",children:m.jsxs("tbody",{children:[p.map(d=>m.jsx(rL,{name:d,entry:e.find(_=>_.key===d),onVars:c,onError:o},d)),a&&m.jsx(sL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&m.jsx("div",{className:"error",children:u})]})}function oL(){const[e,t]=V.useState(null),[n,r]=V.useState(""),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null);V.useEffect(()=>{ex().then(_=>{t(_),r(_.userName??""),l(_.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(_){if(_.preventDefault(),!(u||p)){o(!0),f(null);try{const v=await lT({userName:n.trim(),userEmail:a.trim()});t(v),r(v.userName??""),l(v.userEmail??"")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Git"}),m.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("form",{className:"form",onSubmit:d,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["user.name",m.jsx("input",{type:"text",value:n,onChange:_=>r(_.target.value),autoComplete:"off"})]}),m.jsxs("label",{children:["user.email",m.jsx("input",{type:"text",value:a,onChange:_=>l(_.target.value),autoComplete:"off"})]})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"GitHub access"}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"git"}),m.jsx("span",{className:"v",children:e.gitVersion??"not found"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",m.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),m.jsx(Sw,{onSaved:t})]}),e.githubTokenSource==="stored"&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn",onClick:()=>{uT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}function lL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return m.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[m.jsx("div",{className:"progress-track",children:m.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),m.jsxs("div",{className:"progress-caption",children:[m.jsx("span",{children:n??`${r}%`}),t>0&&m.jsxs("span",{className:"mono",children:[ns(e)," / ",ns(t)]})]})]})}const cL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function uL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null),[p,d]=V.useState({kind:"idle"}),[_,v]=V.useState(null),w=()=>QS().then(E=>{t(E),l(R=>R||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));V.useEffect(()=>{w()},[]),V.useEffect(()=>kT(E=>{E.type==="progress"?d(R=>{const N=R.kind==="moving"?R.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),w()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const C=(e==null?void 0:e.source)==="env",b=a.trim(),S=e!==null&&b===e.current;async function x(){if(!(u||!b)){o(!0),v(null),f(null);try{f(await XN(b))}catch(E){v(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function y(E){if(E.preventDefault(),!(p.kind==="moving"||!b||S)&&(v(null),!!window.confirm(`Move all orx data to: ${b} -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await tT(b)}catch(R){d({kind:"idle"}),v(R instanceof Error?R.message:String(R))}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Storage"}),m.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",m.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?m.jsx("div",{className:"settings-card",children:m.jsx("div",{className:"error",children:n})}):e?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Data directory"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsx("span",{className:"badge",children:e.isDefault?"default":"custom"})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Current"}),m.jsx("span",{className:"v mono",children:e.current}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:fL[e.source]}),!e.isDefault&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Default"}),m.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),C?m.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):m.jsxs("form",{className:"form settings-form",onSubmit:y,children:[m.jsxs("label",{children:["New location",m.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&m.jsxs("p",{className:"settings-note",children:["Ready to move ",ns(c.treeBytes??0),c.freeBytes!=null&&` — ${ns(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&m.jsx("div",{className:"error",children:c.error}),_&&m.jsx("div",{className:"error",children:_}),p.kind==="moving"&&m.jsx(hL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&m.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&m.jsxs(m.Fragment,{children:[" ","The old copy was left at ",m.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&m.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!b||S||p.kind==="moving",children:u?"Checking…":"Check"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!b||S||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}const qp=e=>e==="running"||e==="starting";function pL(e){return qp(e.status)?Fy(Date.now()-e.createdAt):e.endedAt?Fy(e.endedAt-e.createdAt):"—"}function $1({instances:e,emptyLabel:t}){return e.length===0?m.jsx("p",{className:"instances-empty",children:t}):m.jsx("div",{className:"instances-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Project"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Runtime"})]})}),m.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsxs("span",{className:"backend-cell",children:[m.jsx(Bj,{backend:n.backend}),r&&m.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:m.jsx($S,{size:12})})]})}),m.jsx("td",{children:n.projectName??Tp(n.projectId)}),m.jsx("td",{children:m.jsx(Vo,{status:n.status})}),m.jsx("td",{children:Sa(n.createdAt)}),m.jsx("td",{className:"mono",children:pL(n)})]},n.id)})})]})})}function gL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[,u]=q.useState(0);q.useEffect(()=>{const d=setInterval(()=>u(_=>_+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),HN().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(_=>_??[])}).finally(()=>l(!1))};q.useEffect(()=>o(),[]);const c=(d,_)=>_.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>qp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!qp(d.status)).sort(c);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-head-row",children:[m.jsx("h1",{children:"Instances"}),m.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&m.jsx("div",{className:"error",children:n}),!f||!p?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsxs(m.Fragment,{children:[m.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&m.jsx("span",{className:"count-badge",children:f.length})]}),m.jsx($1,{instances:f,emptyLabel:"Nothing running right now."}),m.jsx("h2",{className:"instances-section-title",children:"Past"}),m.jsx($1,{instances:p,emptyLabel:"No past instances yet."})]})]})}const mL=[{id:"harnesses",label:"Harnesses",icon:m.jsx(TA,{size:15})},{id:"compute",label:"Compute",icon:m.jsx(GA,{size:15})},{id:"instances",label:"Instances",icon:m.jsx(Ap,{size:15})},{id:"environment",label:"Environment",icon:m.jsx(AN,{size:15})},{id:"git",label:"Git",icon:m.jsx($u,{size:15})},{id:"storage",label:"Storage",icon:m.jsx(oN,{size:15})}];function _L({tab:e}){return m.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&m.jsx(Hj,{}),e==="compute"&&m.jsx(nL,{}),e==="environment"&&m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Environment"}),m.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),m.jsx(cL,{})]}),e==="instances"&&m.jsx(gL,{}),e==="git"&&m.jsx(uL,{}),e==="storage"&&m.jsx(dL,{})]})}function vL({skills:e,activeIndex:t,onPick:n,onHover:r}){return m.jsx("div",{className:"skill-menu",children:e.map((a,l)=>m.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[m.jsxs("span",{className:"skill-name",children:["/",a.name," ",m.jsx("span",{className:"skill-hint",children:a.argHint})]}),m.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Nw={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function G1(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function th(){const[e,t]=q.useState(!1),n=q.useRef(null);return q.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function yL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=q.useState([]),{open:u,setOpen:o,ref:c}=th(),[f,p]=q.useState("");q.useEffect(()=>{wg().then(w=>{l(w),n==null||n(w)}).catch(()=>{})},[]);const d=q.useMemo(()=>{const w=f.trim().toLowerCase();return(r&&e?a.filter(b=>b.id===e.harness):a).map(b=>{let S=b.models;return w?S=S.filter(x=>x.id.toLowerCase().includes(w)):b.id==="opencode"&&(S=S.slice(0,6)),{harness:b,models:S,hidden:w?0:b.models.length-S.length}})},[a,f,r,e]),_=(w,C)=>{var S,x;const b=(e==null?void 0:e.harness)===w.id;t({harness:w.id,model:C,permissionMode:b?e.permissionMode:((S=w.options)==null?void 0:S.defaultPermissionMode)??null,reasoningLevel:b?e.reasoningLevel:((x=w.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},v=e?e.model?xu(e.model):"Default model":"Model";return m.jsxs("div",{className:"model-picker",ref:c,children:[m.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(w=>!w),children:[v,m.jsx(cs,{size:12})]}),u&&m.jsxs("div",{className:"model-menu align-right",children:[m.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:w=>p(w.target.value)}),m.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:w,models:C,hidden:b})=>m.jsxs("div",{children:[m.jsx("div",{className:"model-group",children:w.name}),w.agentReady?m.jsxs(m.Fragment,{children:[C.map(S=>m.jsxs("button",{className:"model-item",onClick:()=>_(w,S.id),children:[m.jsxs("span",{children:[xu(S.id),m.jsx("span",{className:"model-id",children:S.id})]}),(e==null?void 0:e.harness)===w.id&&(e==null?void 0:e.model)===S.id&&m.jsx(_n,{size:13})]},S.id)),b>0&&m.jsxs("div",{className:"model-more",children:[b," more — search to find"]})]}):m.jsx("div",{className:"model-more",children:w.agentNote??"Not available"})]},w.id)),a.length===0&&m.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&m.jsxs("div",{className:"model-locked-note",children:[m.jsx(dN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function q1({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var S,x;const{open:f,setOpen:p,ref:d}=th();if(e.length===0)return null;const _=t??n??((S=e[0])==null?void 0:S.id)??null,v=e.find(y=>y.id===_),w=e.find(y=>y.id===n),C=(v==null?void 0:v.label)??((x=e[0])==null?void 0:x.label)??"",b=y=>{c(y),p(!1)};return m.jsxs("div",{className:"option-picker",ref:d,children:[m.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(y=>!y),children:[C,m.jsx(cs,{size:12})]}),f&&m.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&m.jsx("div",{className:"model-group",children:r}),w&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"model-item",onClick:()=>b(w.id),children:[m.jsxs("span",{children:[w.label," ",m.jsx("span",{className:"option-default",children:"· Default"})]}),_===w.id&&m.jsx(_n,{size:13})]}),m.jsx("div",{className:"option-sep"})]}),e.map((y,E)=>m.jsxs("button",{className:"model-item",onClick:()=>b(y.id),children:[m.jsx("span",{children:y.label}),_===y.id?m.jsx(_n,{size:13}):o&&m.jsx("span",{className:"option-num",children:E+1})]},y.id))]})]})}const Tw="orx:agent-selection";function bL(){try{const e=localStorage.getItem(Tw);return e?JSON.parse(e):null}catch{return null}}const Rw="local-";function SL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith(Rw)):e,t]}function xL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:SL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${Rw}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function wL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?m.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):m.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Dw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function CL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function V1(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Vp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${V1(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${V1(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function EL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return m.jsxs("details",{className:"tool-row",open:!1,children:[m.jsxs("summary",{children:[m.jsx("span",{className:Dw(n==null?void 0:n.status)}),m.jsx("span",{className:"tool-line",children:Vp(e)}),l&&t&&m.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&m.jsxs("div",{className:"tool-detail",children:[a&&m.jsx("div",{className:"tool-cmd-full",children:a}),r&&m.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function kL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=q.useState(!1),u=a||n,o=e.length===1?Vp(e[0]):n?Vp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return m.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[m.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[m.jsx("span",{className:Dw(n?"running":r?"error":"completed")}),m.jsx("span",{className:"tool-line",children:o}),m.jsx(Uu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&m.jsx("div",{className:"tool-group-rows",children:e.map(c=>m.jsx(EL,{part:c,onOpenFile:t},c.id))})]})}function AL({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,_;const a=e.prompt,[l,u]=q.useState([]),o=!t,c=v=>t==null?void 0:t({promptId:e.id,...v});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const w=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",C=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),m.jsx("span",{className:`prompt-outcome ${C}`,children:w})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[m.jsx(qo,{text:a.plan??"",onOpenFile:n}),a.note&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const v=(a.answers??[]).join(", ")||a.note||"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),m.jsx("span",{className:`prompt-outcome ${v?"chosen":""}`,children:v||"Resolved"})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&m.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(w=>{var C;return m.jsx("li",{className:(C=a.answers)!=null&&C.includes(w.label)?"sel":"",children:w.label},w.label)})}),a.note&&a.note!==v&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const v=!!r;return m.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[m.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),m.jsx("div",{className:`prompt-plan ${v?"clamped":""}`,children:m.jsx(qo,{text:a.plan??"",onOpenFile:n})}),v&&m.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!v&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const v=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",w=typeof((_=a.toolInput)==null?void 0:_.reason)=="string"&&a.toolInput.reason||"";return m.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[m.jsxs("div",{className:"prompt-head",children:["Permission needed: ",m.jsx("code",{children:a.tool})]}),v&&m.jsx("div",{className:"prompt-sub",children:v}),w&&m.jsx("div",{className:"prompt-sub",children:w}),!o&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=v=>u(w=>a.multiSelect?w.includes(v)?w.filter(C=>C!==v):[...w,v]:[v]);return m.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&m.jsx("div",{className:"prompt-head",children:a.header}),a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),m.jsx("div",{className:"prompt-options",children:(a.options??[]).map(v=>{const w=l.includes(v.label);return m.jsxs("button",{className:`prompt-option ${w?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(v.label):c({answers:[v.label]}),children:[m.jsx("span",{className:"prompt-option-label",children:v.label}),v.description&&m.jsx("span",{className:"prompt-option-desc",children:v.description})]},v.label)})}),a.multiSelect&&!o&&m.jsx("div",{className:"prompt-actions",children:m.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function NL(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function TL({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` -`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:wT(f.text));return m.jsxs("div",{className:"msg-user",children:[o,c.length>0&&m.jsx("div",{className:"msg-images",children:c.map((f,p)=>m.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:m.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(m.jsx(kL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(m.jsx(qo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(m.jsxs("details",{className:"reasoning",children:[m.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(m.jsx(AL,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),m.jsx("div",{className:"msg-assistant",children:a})}const Mw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function RL({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=th();return m.jsxs("div",{className:"rail-filter",ref:a,children:[m.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:m.jsx(EN,{size:13})}),n&&m.jsx("div",{className:"option-menu drop-down align-right",children:Mw.map(l=>m.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[m.jsx("span",{children:l.label}),e===l.id&&m.jsx(_n,{size:13})]},l.id))})]})}function DL({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var y;const{open:c,setOpen:f,ref:p}=th(),d=((y=e.title)==null?void 0:y.trim())||"Untitled",[_,v]=q.useState(!1),[w,C]=q.useState(""),b=q.useRef(null);function S(){var E;C(((E=e.title)==null?void 0:E.trim())||""),v(!0)}function x(){var R;const E=w.trim();v(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&l(E)}return q.useEffect(()=>{var E,R;_&&((E=b.current)==null||E.focus(),(R=b.current)==null||R.select())},[_]),m.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${_?"editing":""}`,title:`${Nw[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{_||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[m.jsx("span",{className:"session-dot",children:n&&m.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),_?m.jsx("input",{ref:b,className:"session-title-input","aria-label":"Session title",value:w,onChange:E=>C(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),v(!1))}}):m.jsx("span",{className:"session-title",children:d}),m.jsx("span",{className:"session-time",children:CL(e.updatedAt)}),m.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(R=>!R)},children:m.jsx(VA,{size:14})}),c&&m.jsxs("div",{className:"option-menu drop-down session-menu",children:[m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),S()},children:m.jsx("span",{children:"Rename"})}),m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:m.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),m.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:m.jsx("span",{children:"Delete"})})]})]})}function ML({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,children:d}){var On,yi,ni;const[_,v]=q.useState([]),[w,C]=q.useState(null),[b,S]=q.useState("active"),[x,y]=q.useState(""),[E,R]=q.useState([]),[N,D]=q.useReducer(xL,{messagesBySession:{},busySessions:new Set}),[T,j]=q.useState([]),[B,F]=q.useState(bL),[Y,H]=q.useState({}),z=q.useRef(new Set),V=q.useRef(new Set),G=q.useRef(null),X=q.useRef(null),K=q.useRef(!0),L=q.useRef(null),[M,O]=q.useState([]),[$,U]=q.useState(0),[Q,re]=q.useState(!1);q.useEffect(()=>{vT().then(O).catch(()=>{})},[]);const ae=x.startsWith("/")&&!/\s/.test(x)?x.slice(1):null,Z=ae!==null&&!Q?M.filter(oe=>oe.name.startsWith(ae.toLowerCase())):[],P=Z.length>0,ee=Math.min($,Math.max(0,Z.length-1));q.useEffect(()=>U(0),[ae]);function ne(oe){var we;y(`/${oe.name} `),(we=L.current)==null||we.focus()}function ge(oe){for(const we of oe){if(!/^image\/(png|jpeg|gif|webp)$/.test(we.type))continue;const Ne=new FileReader;Ne.onload=()=>{const qe=Ne.result;R(at=>[...at,{dataUrl:qe,mediaType:we.type}])},Ne.readAsDataURL(we)}}function he(oe){const we=Array.from(oe.clipboardData.items).filter(Ne=>Ne.kind==="file"&&Ne.type.startsWith("image/")).map(Ne=>Ne.getAsFile()).filter(Ne=>Ne!==null);we.length>0&&(oe.preventDefault(),ge(we))}const ye=_.find(oe=>oe.id===w),be=ye?{harness:ye.harness,model:Y.model??ye.model,permissionMode:Y.permissionMode??ye.permissionMode,reasoningLevel:Y.reasoningLevel??ye.reasoningLevel}:B??G1(T),ke=be?T.find(oe=>oe.id===be.harness):void 0,Ee=ke==null?void 0:ke.options,Ce=oe=>{ye?H({model:oe.model,permissionMode:oe.permissionMode,reasoningLevel:oe.reasoningLevel}):(F(oe),localStorage.setItem(Tw,JSON.stringify(oe)))},rt=oe=>{be&&Ce({...be,permissionMode:oe})},bt=oe=>{be&&Ce({...be,reasoningLevel:oe})};q.useEffect(()=>{v([]),C(null),y(""),R([]),D({type:"reset"}),z.current=new Set,zy(e).then(oe=>{v(oe),C(we=>{var Ne;return we??((Ne=oe.find(qe=>!qe.archived))==null?void 0:Ne.id)??null}),D({type:"seedBusy",sessions:oe.filter(we=>we.busy).map(we=>we.id)})}).catch(()=>{})},[e]),q.useEffect(()=>{!w||z.current.has(w)||(z.current.add(w),Hy(w).then(oe=>D({type:"seed",sessionId:w,messages:oe})).catch(()=>z.current.delete(w)))},[w]),q.useEffect(()=>TT(oe=>{switch(oe.type){case"session":if(oe.session.projectId!==e||V.current.has(oe.session.id))return;v(we=>{const Ne=we.findIndex(at=>at.id===oe.session.id);if(Ne<0)return[oe.session,...we];const qe=we.slice();return qe[Ne]=oe.session,qe});break;case"sessionDeleted":Et(oe.sessionId);break;case"message":D({type:"upsertMessage",sessionId:oe.sessionId,message:oe.message});break;case"busy":D({type:"busy",sessionId:oe.sessionId,busy:oe.busy});break}}),[e]);const Ge=w?N.messagesBySession[w]??[]:[],ct=w?N.busySessions.has(w):!1,Pt=oe=>N.busySessions.has(oe)&&(N.messagesBySession[oe]??[]).some(we=>we.parts.some(Ne=>Ne.type==="prompt"&&Ne.prompt&&!Ne.prompt.resolved&&Ne.prompt.nativeId)),ht=w?Pt(w):!1,Fe=ye,fe=q.useMemo(()=>{var oe;for(let we=Ge.length-1;we>=0;we--)for(const Ne of Ge[we].parts)if(Ne.type==="prompt"&&((oe=Ne.prompt)==null?void 0:oe.kind)==="plan"&&!Ne.prompt.resolved)return{promptId:Ne.id,plan:Ne.prompt.plan??"",synthesized:!!Ne.prompt.synthesized};return null},[Ge]),ie=q.useMemo(()=>{if(!w||(Fe==null?void 0:Fe.harness)!=="claude-code")return null;for(let oe=Ge.length-1;oe>=0;oe--)for(const we of Ge[oe].parts)if(!(we.type!=="prompt"||!we.prompt||we.prompt.resolved)&&we.prompt.kind==="question")return we.prompt.nativeId&&!N.busySessions.has(w)?null:we.id;return null},[Ge,Fe==null?void 0:Fe.harness,w,N.busySessions]),[de,Se]=q.useState(null),Ae=de&&de.sessionId===w?de:null;q.useEffect(()=>{if(!de)return;const oe=N.busySessions.has(de.sessionId),we=de.sessionId===w&&fe&&fe.promptId!==de.promptId;(!oe||we)&&Se(null)},[de,fe,N.busySessions,w]);const De=p&&w?(oe,we)=>p(oe,w,we):void 0;q.useEffect(()=>H({}),[w]);const Ve=l==="chat"&&(Ge.length>0||ct);q.useLayoutEffect(()=>{K.current=!0;const oe=G.current;oe&&(oe.scrollTop=oe.scrollHeight)},[w,Ve]),q.useLayoutEffect(()=>{const oe=G.current;oe&&K.current&&(oe.scrollTop=oe.scrollHeight)},[Ge,ct]),q.useEffect(()=>{const oe=G.current,we=X.current;if(!oe||!we)return;const Ne=new ResizeObserver(()=>{K.current&&(oe.scrollTop=oe.scrollHeight)});return Ne.observe(we),Ne.observe(oe),()=>Ne.disconnect()},[Ve]);async function Ie(){const oe=x.trim(),we=E;if(!oe&&we.length===0)return;if(oe&&ie&&we.length===0){y(""),Ut({promptId:ie,answers:[],note:oe}).then(at=>{at||y(bi=>bi||oe)});return}if(ct)return;const Ne=be;if(!Ne&&!w)return;y(""),R([]);let qe=w;try{if(!qe){const nn=await yT(e,Ne.harness,{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel});z.current.add(nn.id),v(gs=>[nn,...gs]),C(nn.id),qe=nn.id}D({type:"optimisticUser",sessionId:qe,text:oe,imageUrls:we.map(nn=>nn.dataUrl)}),D({type:"busy",sessionId:qe,busy:!0}),K.current=!0,b==="archived"&&S("active");const at=Ne?{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel}:{};H({});const bi=we.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await CT(qe,oe,at,bi.length?bi:void 0)}catch{qe&&D({type:"busy",sessionId:qe,busy:!1})}}function Nt(){w&&ET(w)}q.useEffect(()=>{if(!ct||l!=="chat")return;function oe(we){var Ne;we.key!=="Escape"||we.defaultPrevented||(we.preventDefault(),Nt(),(Ne=L.current)==null||Ne.focus())}return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[ct,w,l]);function Et(oe){V.current.add(oe),v(we=>we.filter(Ne=>Ne.id!==oe)),C(we=>we===oe?null:we),z.current.delete(oe),D({type:"forget",sessionId:oe})}function qt(oe,we){const Ne=oe.archived;v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:we}:at)),ST(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:Ne}:at))})}function st(oe,we){const Ne=oe.title;v(qe=>qe.map(at=>at.id===oe.id?{...at,title:we}:at)),xT(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,title:Ne}:at))})}async function Ln(oe){var Ne;const we=((Ne=oe.title)==null?void 0:Ne.trim())||"Untitled";if(window.confirm(`Delete "${we}"? +The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await ZN(b)}catch(R){d({kind:"idle"}),v(R instanceof Error?R.message:String(R))}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Storage"}),m.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",m.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?m.jsx("div",{className:"settings-card",children:m.jsx("div",{className:"error",children:n})}):e?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Data directory"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsx("span",{className:"badge",children:e.isDefault?"default":"custom"})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Current"}),m.jsx("span",{className:"v mono",children:e.current}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:cL[e.source]}),!e.isDefault&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Default"}),m.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),C?m.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):m.jsxs("form",{className:"form settings-form",onSubmit:y,children:[m.jsxs("label",{children:["New location",m.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&m.jsxs("p",{className:"settings-note",children:["Ready to move ",ns(c.treeBytes??0),c.freeBytes!=null&&` — ${ns(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&m.jsx("div",{className:"error",children:c.error}),_&&m.jsx("div",{className:"error",children:_}),p.kind==="moving"&&m.jsx(lL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&m.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&m.jsxs(m.Fragment,{children:[" ","The old copy was left at ",m.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&m.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!b||S||p.kind==="moving",children:u?"Checking…":"Check"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!b||S||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}const qp=e=>e==="running"||e==="starting";function hL(e){return qp(e.status)?Fy(Date.now()-e.createdAt):e.endedAt?Fy(e.endedAt-e.createdAt):"—"}function $1({instances:e,emptyLabel:t}){return e.length===0?m.jsx("p",{className:"instances-empty",children:t}):m.jsx("div",{className:"instances-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Project"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Runtime"})]})}),m.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsxs("span",{className:"backend-cell",children:[m.jsx(jj,{backend:n.backend}),r&&m.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:m.jsx(PS,{size:12})})]})}),m.jsx("td",{children:n.projectName??Tp(n.projectId)}),m.jsx("td",{children:m.jsx(Vo,{status:n.status})}),m.jsx("td",{children:Sa(n.createdAt)}),m.jsx("td",{className:"mono",children:hL(n)})]},n.id)})})]})})}function fL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[,u]=V.useState(0);V.useEffect(()=>{const d=setInterval(()=>u(_=>_+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),ON().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(_=>_??[])}).finally(()=>l(!1))};V.useEffect(()=>o(),[]);const c=(d,_)=>_.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>qp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!qp(d.status)).sort(c);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-head-row",children:[m.jsx("h1",{children:"Instances"}),m.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&m.jsx("div",{className:"error",children:n}),!f||!p?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsxs(m.Fragment,{children:[m.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&m.jsx("span",{className:"count-badge",children:f.length})]}),m.jsx($1,{instances:f,emptyLabel:"Nothing running right now."}),m.jsx("h2",{className:"instances-section-title",children:"Past"}),m.jsx($1,{instances:p,emptyLabel:"No past instances yet."})]})]})}const dL=[{id:"harnesses",label:"Harnesses",icon:m.jsx(EA,{size:15})},{id:"compute",label:"Compute",icon:m.jsx(FA,{size:15})},{id:"instances",label:"Instances",icon:m.jsx(Ap,{size:15})},{id:"environment",label:"Environment",icon:m.jsx(wN,{size:15})},{id:"git",label:"Git",icon:m.jsx($u,{size:15})},{id:"storage",label:"Storage",icon:m.jsx(iN,{size:15})}];function pL({tab:e}){return m.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&m.jsx(Bj,{}),e==="compute"&&m.jsx(Jj,{}),e==="environment"&&m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Environment"}),m.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),m.jsx(aL,{})]}),e==="instances"&&m.jsx(fL,{}),e==="git"&&m.jsx(oL,{}),e==="storage"&&m.jsx(uL,{})]})}function gL({skills:e,activeIndex:t,onPick:n,onHover:r}){return m.jsx("div",{className:"skill-menu",children:e.map((a,l)=>m.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[m.jsxs("span",{className:"skill-name",children:["/",a.name," ",m.jsx("span",{className:"skill-hint",children:a.argHint})]}),m.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Ew={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function G1(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function th(){const[e,t]=V.useState(!1),n=V.useRef(null);return V.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function mL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=V.useState([]),{open:u,setOpen:o,ref:c}=th(),[f,p]=V.useState("");V.useEffect(()=>{wg().then(w=>{l(w),n==null||n(w)}).catch(()=>{})},[]);const d=V.useMemo(()=>{const w=f.trim().toLowerCase();return(r&&e?a.filter(b=>b.id===e.harness):a).map(b=>{let S=b.models;return w?S=S.filter(x=>x.id.toLowerCase().includes(w)):b.id==="opencode"&&(S=S.slice(0,6)),{harness:b,models:S,hidden:w?0:b.models.length-S.length}})},[a,f,r,e]),_=(w,C)=>{var S,x;const b=(e==null?void 0:e.harness)===w.id;t({harness:w.id,model:C,permissionMode:b?e.permissionMode:((S=w.options)==null?void 0:S.defaultPermissionMode)??null,reasoningLevel:b?e.reasoningLevel:((x=w.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},v=e?e.model?xu(e.model):"Default model":"Model";return m.jsxs("div",{className:"model-picker",ref:c,children:[m.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(w=>!w),children:[v,m.jsx(cs,{size:12})]}),u&&m.jsxs("div",{className:"model-menu align-right",children:[m.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:w=>p(w.target.value)}),m.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:w,models:C,hidden:b})=>m.jsxs("div",{children:[m.jsx("div",{className:"model-group",children:w.name}),w.agentReady?m.jsxs(m.Fragment,{children:[C.map(S=>m.jsxs("button",{className:"model-item",onClick:()=>_(w,S.id),children:[m.jsxs("span",{children:[xu(S.id),m.jsx("span",{className:"model-id",children:S.id})]}),(e==null?void 0:e.harness)===w.id&&(e==null?void 0:e.model)===S.id&&m.jsx(_n,{size:13})]},S.id)),b>0&&m.jsxs("div",{className:"model-more",children:[b," more — search to find"]})]}):m.jsx("div",{className:"model-more",children:w.agentNote??"Not available"})]},w.id)),a.length===0&&m.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&m.jsxs("div",{className:"model-locked-note",children:[m.jsx(cN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function q1({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var S,x;const{open:f,setOpen:p,ref:d}=th();if(e.length===0)return null;const _=t??n??((S=e[0])==null?void 0:S.id)??null,v=e.find(y=>y.id===_),w=e.find(y=>y.id===n),C=(v==null?void 0:v.label)??((x=e[0])==null?void 0:x.label)??"",b=y=>{c(y),p(!1)};return m.jsxs("div",{className:"option-picker",ref:d,children:[m.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(y=>!y),children:[C,m.jsx(cs,{size:12})]}),f&&m.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&m.jsx("div",{className:"model-group",children:r}),w&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"model-item",onClick:()=>b(w.id),children:[m.jsxs("span",{children:[w.label," ",m.jsx("span",{className:"option-default",children:"· Default"})]}),_===w.id&&m.jsx(_n,{size:13})]}),m.jsx("div",{className:"option-sep"})]}),e.map((y,E)=>m.jsxs("button",{className:"model-item",onClick:()=>b(y.id),children:[m.jsx("span",{children:y.label}),_===y.id?m.jsx(_n,{size:13}):o&&m.jsx("span",{className:"option-num",children:E+1})]},y.id))]})]})}const kw="orx:agent-selection";function _L(){try{const e=localStorage.getItem(kw);return e?JSON.parse(e):null}catch{return null}}const Aw="local-";function vL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith(Aw)):e,t]}function yL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:vL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${Aw}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function bL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?m.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):m.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Nw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function SL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function V1(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Vp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${V1(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${V1(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function xL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return m.jsxs("details",{className:"tool-row",open:!1,children:[m.jsxs("summary",{children:[m.jsx("span",{className:Nw(n==null?void 0:n.status)}),m.jsx("span",{className:"tool-line",children:Vp(e)}),l&&t&&m.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&m.jsxs("div",{className:"tool-detail",children:[a&&m.jsx("div",{className:"tool-cmd-full",children:a}),r&&m.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function wL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=V.useState(!1),u=a||n,o=e.length===1?Vp(e[0]):n?Vp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return m.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[m.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[m.jsx("span",{className:Nw(n?"running":r?"error":"completed")}),m.jsx("span",{className:"tool-line",children:o}),m.jsx(Uu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&m.jsx("div",{className:"tool-group-rows",children:e.map(c=>m.jsx(xL,{part:c,onOpenFile:t},c.id))})]})}function CL({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,_;const a=e.prompt,[l,u]=V.useState([]),o=!t,c=v=>t==null?void 0:t({promptId:e.id,...v});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const w=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",C=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),m.jsx("span",{className:`prompt-outcome ${C}`,children:w})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[m.jsx(qo,{text:a.plan??"",onOpenFile:n}),a.note&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const v=(a.answers??[]).join(", ")||a.note||"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),m.jsx("span",{className:`prompt-outcome ${v?"chosen":""}`,children:v||"Resolved"})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&m.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(w=>{var C;return m.jsx("li",{className:(C=a.answers)!=null&&C.includes(w.label)?"sel":"",children:w.label},w.label)})}),a.note&&a.note!==v&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const v=!!r;return m.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[m.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),m.jsx("div",{className:`prompt-plan ${v?"clamped":""}`,children:m.jsx(qo,{text:a.plan??"",onOpenFile:n})}),v&&m.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!v&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const v=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",w=typeof((_=a.toolInput)==null?void 0:_.reason)=="string"&&a.toolInput.reason||"";return m.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[m.jsxs("div",{className:"prompt-head",children:["Permission needed: ",m.jsx("code",{children:a.tool})]}),v&&m.jsx("div",{className:"prompt-sub",children:v}),w&&m.jsx("div",{className:"prompt-sub",children:w}),!o&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=v=>u(w=>a.multiSelect?w.includes(v)?w.filter(C=>C!==v):[...w,v]:[v]);return m.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&m.jsx("div",{className:"prompt-head",children:a.header}),a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),m.jsx("div",{className:"prompt-options",children:(a.options??[]).map(v=>{const w=l.includes(v.label);return m.jsxs("button",{className:`prompt-option ${w?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(v.label):c({answers:[v.label]}),children:[m.jsx("span",{className:"prompt-option-label",children:v.label}),v.description&&m.jsx("span",{className:"prompt-option-desc",children:v.description})]},v.label)})}),a.multiSelect&&!o&&m.jsx("div",{className:"prompt-actions",children:m.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function EL(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function kL({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` +`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:yT(f.text));return m.jsxs("div",{className:"msg-user",children:[o,c.length>0&&m.jsx("div",{className:"msg-images",children:c.map((f,p)=>m.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:m.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(m.jsx(wL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(m.jsx(qo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(m.jsxs("details",{className:"reasoning",children:[m.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(m.jsx(CL,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),m.jsx("div",{className:"msg-assistant",children:a})}const Tw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function AL({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=th();return m.jsxs("div",{className:"rail-filter",ref:a,children:[m.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:m.jsx(SN,{size:13})}),n&&m.jsx("div",{className:"option-menu drop-down align-right",children:Tw.map(l=>m.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[m.jsx("span",{children:l.label}),e===l.id&&m.jsx(_n,{size:13})]},l.id))})]})}function NL({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var y;const{open:c,setOpen:f,ref:p}=th(),d=((y=e.title)==null?void 0:y.trim())||"Untitled",[_,v]=V.useState(!1),[w,C]=V.useState(""),b=V.useRef(null);function S(){var E;C(((E=e.title)==null?void 0:E.trim())||""),v(!0)}function x(){var R;const E=w.trim();v(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&l(E)}return V.useEffect(()=>{var E,R;_&&((E=b.current)==null||E.focus(),(R=b.current)==null||R.select())},[_]),m.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${_?"editing":""}`,title:`${Ew[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{_||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[m.jsx("span",{className:"session-dot",children:n&&m.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),_?m.jsx("input",{ref:b,className:"session-title-input","aria-label":"Session title",value:w,onChange:E=>C(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),v(!1))}}):m.jsx("span",{className:"session-title",children:d}),m.jsx("span",{className:"session-time",children:SL(e.updatedAt)}),m.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(R=>!R)},children:m.jsx(UA,{size:14})}),c&&m.jsxs("div",{className:"option-menu drop-down session-menu",children:[m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),S()},children:m.jsx("span",{children:"Rename"})}),m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:m.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),m.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:m.jsx("span",{children:"Delete"})})]})]})}function TL({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,children:d}){var On,vi,ni;const[_,v]=V.useState([]),[w,C]=V.useState(null),[b,S]=V.useState("active"),[x,y]=V.useState(""),[E,R]=V.useState([]),[N,D]=V.useReducer(yL,{messagesBySession:{},busySessions:new Set}),[T,j]=V.useState([]),[B,z]=V.useState(_L),[G,U]=V.useState({}),H=V.useRef(new Set),Y=V.useRef(new Set),q=V.useRef(null),X=V.useRef(null),K=V.useRef(!0),L=V.useRef(null),[M,O]=V.useState([]),[$,F]=V.useState(0),[Q,re]=V.useState(!1);V.useEffect(()=>{pT().then(O).catch(()=>{})},[]);const ae=x.startsWith("/")&&!/\s/.test(x)?x.slice(1):null,Z=ae!==null&&!Q?M.filter(oe=>oe.name.startsWith(ae.toLowerCase())):[],P=Z.length>0,ee=Math.min($,Math.max(0,Z.length-1));V.useEffect(()=>F(0),[ae]);function ne(oe){var we;y(`/${oe.name} `),(we=L.current)==null||we.focus()}function ge(oe){for(const we of oe){if(!/^image\/(png|jpeg|gif|webp)$/.test(we.type))continue;const Ne=new FileReader;Ne.onload=()=>{const qe=Ne.result;R(at=>[...at,{dataUrl:qe,mediaType:we.type}])},Ne.readAsDataURL(we)}}function he(oe){const we=Array.from(oe.clipboardData.items).filter(Ne=>Ne.kind==="file"&&Ne.type.startsWith("image/")).map(Ne=>Ne.getAsFile()).filter(Ne=>Ne!==null);we.length>0&&(oe.preventDefault(),ge(we))}const ye=_.find(oe=>oe.id===w),be=ye?{harness:ye.harness,model:G.model??ye.model,permissionMode:G.permissionMode??ye.permissionMode,reasoningLevel:G.reasoningLevel??ye.reasoningLevel}:B??G1(T),ke=be?T.find(oe=>oe.id===be.harness):void 0,Ee=ke==null?void 0:ke.options,Ce=oe=>{ye?U({model:oe.model,permissionMode:oe.permissionMode,reasoningLevel:oe.reasoningLevel}):(z(oe),localStorage.setItem(kw,JSON.stringify(oe)))},rt=oe=>{be&&Ce({...be,permissionMode:oe})},bt=oe=>{be&&Ce({...be,reasoningLevel:oe})};V.useEffect(()=>{v([]),C(null),y(""),R([]),D({type:"reset"}),H.current=new Set,zy(e).then(oe=>{v(oe),C(we=>{var Ne;return we??((Ne=oe.find(qe=>!qe.archived))==null?void 0:Ne.id)??null}),D({type:"seedBusy",sessions:oe.filter(we=>we.busy).map(we=>we.id)})}).catch(()=>{})},[e]),V.useEffect(()=>{!w||H.current.has(w)||(H.current.add(w),Hy(w).then(oe=>D({type:"seed",sessionId:w,messages:oe})).catch(()=>H.current.delete(w)))},[w]),V.useEffect(()=>ET(oe=>{switch(oe.type){case"session":if(oe.session.projectId!==e||Y.current.has(oe.session.id))return;v(we=>{const Ne=we.findIndex(at=>at.id===oe.session.id);if(Ne<0)return[oe.session,...we];const qe=we.slice();return qe[Ne]=oe.session,qe});break;case"sessionDeleted":Ct(oe.sessionId);break;case"message":D({type:"upsertMessage",sessionId:oe.sessionId,message:oe.message});break;case"busy":D({type:"busy",sessionId:oe.sessionId,busy:oe.busy});break}}),[e]);const Ge=w?N.messagesBySession[w]??[]:[],ct=w?N.busySessions.has(w):!1,Pt=oe=>N.busySessions.has(oe)&&(N.messagesBySession[oe]??[]).some(we=>we.parts.some(Ne=>Ne.type==="prompt"&&Ne.prompt&&!Ne.prompt.resolved&&Ne.prompt.nativeId)),ht=w?Pt(w):!1,Fe=ye,fe=V.useMemo(()=>{var oe;for(let we=Ge.length-1;we>=0;we--)for(const Ne of Ge[we].parts)if(Ne.type==="prompt"&&((oe=Ne.prompt)==null?void 0:oe.kind)==="plan"&&!Ne.prompt.resolved)return{promptId:Ne.id,plan:Ne.prompt.plan??"",synthesized:!!Ne.prompt.synthesized};return null},[Ge]),ie=V.useMemo(()=>{if(!w||(Fe==null?void 0:Fe.harness)!=="claude-code")return null;for(let oe=Ge.length-1;oe>=0;oe--)for(const we of Ge[oe].parts)if(!(we.type!=="prompt"||!we.prompt||we.prompt.resolved)&&we.prompt.kind==="question")return we.prompt.nativeId&&!N.busySessions.has(w)?null:we.id;return null},[Ge,Fe==null?void 0:Fe.harness,w,N.busySessions]),[de,Se]=V.useState(null),Ae=de&&de.sessionId===w?de:null;V.useEffect(()=>{if(!de)return;const oe=N.busySessions.has(de.sessionId),we=de.sessionId===w&&fe&&fe.promptId!==de.promptId;(!oe||we)&&Se(null)},[de,fe,N.busySessions,w]);const De=p&&w?(oe,we)=>p(oe,w,we):void 0;V.useEffect(()=>U({}),[w]);const Ve=l==="chat"&&(Ge.length>0||ct);V.useLayoutEffect(()=>{K.current=!0;const oe=q.current;oe&&(oe.scrollTop=oe.scrollHeight)},[w,Ve]),V.useLayoutEffect(()=>{const oe=q.current;oe&&K.current&&(oe.scrollTop=oe.scrollHeight)},[Ge,ct]),V.useEffect(()=>{const oe=q.current,we=X.current;if(!oe||!we)return;const Ne=new ResizeObserver(()=>{K.current&&(oe.scrollTop=oe.scrollHeight)});return Ne.observe(we),Ne.observe(oe),()=>Ne.disconnect()},[Ve]);async function Ie(){const oe=x.trim(),we=E;if(!oe&&we.length===0)return;if(oe&&ie&&we.length===0){y(""),Ut({promptId:ie,answers:[],note:oe}).then(at=>{at||y(yi=>yi||oe)});return}if(ct)return;const Ne=be;if(!Ne&&!w)return;y(""),R([]);let qe=w;try{if(!qe){const nn=await gT(e,Ne.harness,{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel});H.current.add(nn.id),v(gs=>[nn,...gs]),C(nn.id),qe=nn.id}D({type:"optimisticUser",sessionId:qe,text:oe,imageUrls:we.map(nn=>nn.dataUrl)}),D({type:"busy",sessionId:qe,busy:!0}),K.current=!0,b==="archived"&&S("active");const at=Ne?{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel}:{};U({});const yi=we.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await bT(qe,oe,at,yi.length?yi:void 0)}catch{qe&&D({type:"busy",sessionId:qe,busy:!1})}}function Nt(){w&&ST(w)}V.useEffect(()=>{if(!ct||l!=="chat")return;function oe(we){var Ne;we.key!=="Escape"||we.defaultPrevented||(we.preventDefault(),Nt(),(Ne=L.current)==null||Ne.focus())}return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[ct,w,l]);function Ct(oe){Y.current.add(oe),v(we=>we.filter(Ne=>Ne.id!==oe)),C(we=>we===oe?null:we),H.current.delete(oe),D({type:"forget",sessionId:oe})}function qt(oe,we){const Ne=oe.archived;v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:we}:at)),_T(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:Ne}:at))})}function st(oe,we){const Ne=oe.title;v(qe=>qe.map(at=>at.id===oe.id?{...at,title:we}:at)),vT(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,title:Ne}:at))})}async function Ln(oe){var Ne;const we=((Ne=oe.title)==null?void 0:Ne.trim())||"Untitled";if(window.confirm(`Delete "${we}"? -Its transcript is permanently removed.`)){try{await bT(oe.id)}catch(qe){window.alert(`Failed to delete "${we}": ${qe instanceof Error?qe.message:String(qe)}`);return}Et(oe.id)}}function Ut(oe){if(!w)return Promise.resolve(!1);const we=w;return D({type:"busy",sessionId:we,busy:!0}),kT(we,oe).then(()=>!0).catch(()=>!1).finally(()=>{Hy(we).then(Ne=>D({type:"seed",sessionId:we,messages:Ne})).catch(()=>{}),zy(e).then(Ne=>{var qe;return D({type:"busy",sessionId:we,busy:!!((qe=Ne.find(at=>at.id===we))!=null&&qe.busy)})}).catch(()=>{})})}const ps=_.filter(oe=>b==="all"?!0:b==="archived"?oe.archived:!oe.archived),mi=m.jsxs("aside",{className:"session-rail floating-panel",children:[n,m.jsxs("nav",{className:"rail-nav",children:[m.jsxs("button",{className:"rail-nav-item",onClick:()=>{C(null),u("chat")},children:[m.jsx(bg,{size:15}),"New session"]}),m.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,onClick:()=>u("files"),children:[m.jsx(qS,{size:15}),"Files"]}),mL.map(oe=>m.jsxs("button",{className:`rail-nav-item ${l===oe.id?"active":""}`,onClick:()=>u(oe.id),children:[oe.icon,oe.label]},oe.id))]}),m.jsxs("div",{className:"rail-body",children:[m.jsxs("div",{className:"rail-section-head",children:[m.jsx("div",{className:"rail-section-label",children:((On=Mw.find(oe=>oe.id===b))==null?void 0:On.railLabel)??"Recents"}),m.jsx(RL,{value:b,onChange:S})]}),ps.map(oe=>m.jsx(DL,{session:oe,active:oe.id===w&&l==="chat",busy:N.busySessions.has(oe.id),waiting:Pt(oe.id),onOpen:()=>{C(oe.id),u("chat")},onRename:we=>st(oe,we),onSetArchived:we=>qt(oe,we),onDelete:()=>void Ln(oe)},oe.id)),ps.length===0&&m.jsx("div",{className:"rail-empty",children:b==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),_i=`chat-header${r?"":" rail-hidden"}`,vi=!r&&m.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:m.jsx(YS,{size:15})});return l!=="chat"?m.jsxs(m.Fragment,{children:[r&&mi,m.jsxs("section",{className:"chat-pane",children:[!r&&m.jsx("div",{className:_i,children:vi}),m.jsx("div",{className:"settings-view-scroll",children:d})]})]}):m.jsxs(m.Fragment,{children:[r&&mi,m.jsxs("section",{className:"chat-pane",children:[m.jsxs("div",{className:_i,children:[vi,m.jsx("div",{className:"title",title:Fe?((yi=Fe.title)==null?void 0:yi.trim())||"Untitled":"New session",children:Fe?((ni=Fe.title)==null?void 0:ni.trim())||"Untitled":"New session"}),m.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:m.jsx(eN,{size:15})})]}),Ve?m.jsx("div",{className:"chat-thread",ref:G,onScroll:oe=>{const we=oe.currentTarget;K.current=we.scrollHeight-we.scrollTop-we.clientHeight<60},children:m.jsxs("div",{className:"chat-thread-inner",ref:X,children:[Ge.filter(NL).map(oe=>m.jsx(TL,{message:oe,onOpenFile:f&&(we=>f(we,w??void 0)),onRespond:Ut,onOpenPlan:De},oe.id)),ct&&(ht?m.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):m.jsxs("div",{className:"working",children:[m.jsx("span",{className:"spinner"})," Working…"]}))]})}):m.jsxs("div",{className:"chat-empty",children:[m.jsxs("h2",{children:["Open",m.jsx("span",{children:"Research"})]}),m.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),m.jsx(wL,{harnesses:T,selection:B??G1(T)}),t&&m.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var oe;y(`/reproduce-paper ${t} on `),(oe=L.current)==null||oe.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),m.jsxs("div",{className:"composer",children:[fe&&!(Ae&&fe.promptId===Ae.promptId)&&m.jsx(Dj,{synthesized:fe.synthesized,onView:()=>De==null?void 0:De(fe.plan,fe.promptId),onApprove:oe=>Ut({promptId:fe.promptId,approve:!0,resumeMode:oe}),onReject:()=>Ut({promptId:fe.promptId,approve:!1}),onRevise:oe=>{w&&Se({sessionId:w,promptId:fe.promptId}),Ut({promptId:fe.promptId,approve:!1,note:oe})}}),m.jsxs("div",{className:"composer-box",children:[P&&m.jsx(vL,{skills:Z,activeIndex:ee,onPick:ne,onHover:U}),E.length>0&&m.jsx("div",{className:"composer-attachments",children:E.map((oe,we)=>m.jsxs("div",{className:"attachment-thumb",children:[m.jsx("img",{src:oe.dataUrl,alt:"pasted"}),m.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>R(Ne=>Ne.filter((qe,at)=>at!==we)),children:m.jsx(Fo,{size:11})})]},we))}),m.jsx("textarea",{ref:L,value:x,placeholder:ie?"Type a custom answer…":be?`Message ${Nw[be.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:he,onDragOver:oe=>{oe.dataTransfer.types.includes("Files")&&oe.preventDefault()},onDrop:oe=>{oe.dataTransfer.files.length!==0&&(oe.preventDefault(),ge(Array.from(oe.dataTransfer.files)))},onChange:oe=>{y(oe.target.value),re(!1)},onKeyDown:oe=>{if(P){if(oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const we=oe.key==="ArrowDown"?1:-1;U((ee+we+Z.length)%Z.length);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault(),ne(Z[ee]);return}if(oe.key==="Escape"){oe.preventDefault(),re(!0);return}}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),Ie())}}),m.jsxs("div",{className:"composer-actions",children:[m.jsx(q1,{choices:(Ee==null?void 0:Ee.permissionModes)??[],value:(be==null?void 0:be.permissionMode)??null,defaultId:(Ee==null?void 0:Ee.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:rt}),m.jsx("div",{style:{flex:1}}),m.jsx(yL,{value:be,onSelect:Ce,onHarnesses:j,lockHarness:!!ye}),m.jsx(q1,{choices:(Ee==null?void 0:Ee.reasoningLevels)??[],value:(be==null?void 0:be.reasoningLevel)??null,defaultId:(Ee==null?void 0:Ee.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:bt}),ct&&!ie?m.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:Nt,children:m.jsx(Fo,{size:16})}):m.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void Ie(),disabled:!x.trim()&&E.length===0,children:m.jsx(US,{size:16})})]})]})]})]})]})}function Y1(){return{dirs:new Map,files:[]}}function jL(e){const t=Y1();for(const n of e){const r=n.split("/");let a=t;for(let l=0;l<r.length-1;l++){const u=r[l];let o=a.dirs.get(u);o||(o=Y1(),a.dirs.set(u,o)),a=o}a.files.push(r[r.length-1])}return t}function LL({name:e,node:t,path:n,depth:r,toggled:a,onToggle:l,onOpenFile:u}){const o=r===0,c=a.has(n)?!o:o;return m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+r*14},onClick:()=>l(n),title:n,children:[c?m.jsx(cs,{size:13,className:"code-tree-chev"}):m.jsx(Uu,{size:13,className:"code-tree-chev"}),c?m.jsx(qS,{size:13}):m.jsx(rN,{size:13}),m.jsx("span",{className:"code-tree-name",children:e})]}),c&&m.jsx(jw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function jw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return m.jsxs(m.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return m.jsx(LL,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[m.jsx(QA,{size:13}),m.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function OL({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=q.useState(null),[p,d]=q.useState(null),[_,v]=q.useState(!0),w=q.useRef(0),C=q.useCallback(()=>{const E=++w.current;v(!0),GN(e,r?{ref:r}:{}).then(R=>{E===w.current&&(f(R),d(null))}).catch(R=>{E===w.current&&d(R.message)}).finally(()=>{E===w.current&&v(!1)})},[e,r]);q.useEffect(()=>(f(null),d(null),C(),()=>{w.current++}),[C]);const b=q.useMemo(()=>c?jL(c.entries):null,[c]),S=q.useCallback(E=>{const R=new Set(a);R.has(E)?R.delete(E):R.add(E),u(R)},[a,u]),x=q.useMemo(()=>{const E=new Set,R=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),R.push({branch:N.branchName,label:N.slug}));return R},[n]),y=r||(c==null?void 0:c.branch)||null;return m.jsxs("div",{className:"code-tab",children:[m.jsxs("div",{className:"code-tab-header",children:[m.jsx("span",{className:"ctl-label",children:"Source"}),m.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[m.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&m.jsx("option",{value:r,children:r}),x.map(E=>m.jsx("option",{value:E.branch,children:E.label},E.branch))]}),y&&m.jsx("a",{className:"icon-btn",href:xg(t.githubOwner,t.githubRepo,y),target:"_blank",rel:"noopener noreferrer",title:`Open ${y} on GitHub`,children:m.jsx(pm,{size:13})}),m.jsx("span",{style:{flex:1}}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:C,children:_?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),(c==null?void 0:c.truncated)&&m.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&b&&m.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),m.jsx("div",{className:"code-tab-body",children:b?b.dirs.size===0&&b.files.length===0?m.jsx("div",{className:"code-tab-note",children:"No files."}):m.jsx("div",{className:"code-tree",children:m.jsx(jw,{node:b,parentPath:"",depth:0,toggled:a,onToggle:S,onOpenFile:E=>o(E,void 0,r||void 0)})}):m.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}const BL="project";function IL(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function zL(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const HL=/\.(png|jpe?g|gif|webp|svg)$/i;function Yp(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Yp(n.children??[],t);if(r)return r}}return null}function FL({projectId:e,folder:t,markdown:n}){const r=a=>IL(a)?a:Np(e,`${t}/${a.replace(/^\.?\//,"")}`);return m.jsx("div",{className:"md report-md",children:m.jsx($x,{remarkPlugins:[dw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return m.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return m.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[m.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&m.jsx("span",{className:"report-img-caption",children:l})]})},...ww},children:zL(n)})})}function PL({projectId:e,entry:t,onBack:n,onDelete:r}){const[a,l]=q.useState(null),[u,o]=q.useState(null);return q.useEffect(()=>{uT(e,t.path).then(c=>l(c.markdown)).catch(c=>o(c instanceof Error?c.message:String(c)))},[e,t.path,t.modifiedAt]),m.jsx("div",{className:"report-view",children:m.jsxs("div",{className:"report-view-col",children:[m.jsxs("div",{className:"report-view-head",children:[m.jsxs("button",{className:"report-back",onClick:n,children:[m.jsx(jo,{size:13})," Files"]}),m.jsx("span",{style:{flex:1}}),m.jsx("span",{className:"report-date",children:new Date(t.modifiedAt).toLocaleString()}),m.jsx("button",{className:"icon-btn",title:"Delete report folder","aria-label":"Delete report folder",onClick:()=>{window.confirm(`Delete the "${t.path}" folder from the files dir?`)&&r()},children:m.jsx(Gu,{size:14})})]}),u?m.jsx("div",{className:"error",children:u}):a===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading report…"]}):m.jsx(FL,{projectId:e,folder:t.path,markdown:a})]})})}function UL({dir:e}){const[t,n]=q.useState(!1);return m.jsxs("div",{className:"files-pill files-pill-dir",title:e,children:[m.jsx("code",{children:e}),m.jsx("button",{className:"icon-btn",title:"Copy path","aria-label":"Copy files directory path",onClick:()=>{var r;(r=navigator.clipboard)==null||r.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},children:t?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})})]})}function Lw({projectId:e,entries:t,depth:n,expanded:r,onToggle:a,onOpenReport:l,onDelete:u}){return m.jsx(m.Fragment,{children:t.map(o=>{var p;const c={paddingLeft:14+n*22},f=m.jsx("button",{className:"icon-btn ftree-del",title:`Delete ${o.path}`,"aria-label":`Delete ${o.path}`,onClick:d=>{d.stopPropagation(),window.confirm(`Delete "${o.path}" from the files dir?`)&&u(o.path)},children:m.jsx(Gu,{size:13})});if(o.isDir){const d=o.reportTitle!==void 0,_=r.has(o.path),v=n===0?o.experiment:void 0,w=d&&n>0,C=v?[v.title,v.branchName].filter(Boolean).join(" — "):d&&!w?o.reportTitle:void 0;return m.jsxs("div",{children:[m.jsxs("div",{className:"ftree-row clickable",style:c,title:C,onClick:()=>d?l(o.path):a(o.path),children:[m.jsx("button",{className:`ftree-chevron ${_?"open":""}`,"aria-label":_?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:b=>{b.stopPropagation(),a(o.path)},children:m.jsx(Uu,{size:13})}),w?m.jsx("span",{className:"ftree-title",children:o.reportTitle}):m.jsxs("span",{className:"ftree-dirname",children:[o.name,"/"]}),d&&m.jsx("span",{className:"ftree-tag",children:"report"}),(v==null?void 0:v.latestRunStatus)&&m.jsx("span",{className:"ftree-status",children:v.latestRunStatus}),f,m.jsx("span",{className:"ftree-date",children:new Date(o.modifiedAt).toLocaleDateString()})]}),_&&(((p=o.children)==null?void 0:p.length)??0)>0&&m.jsx("div",{className:"ftree-children",children:m.jsx(Lw,{projectId:e,entries:o.children??[],depth:n+1,expanded:r,onToggle:a,onOpenReport:l,onDelete:u})})]},o.path)}return m.jsxs("div",{className:"ftree-row",style:c,children:[m.jsx("span",{className:"ftree-chevron spacer"}),m.jsxs("a",{className:"ftree-link",href:Np(e,o.path),target:"_blank",rel:"noopener noreferrer",title:o.path,children:[HL.test(o.name)&&m.jsx("img",{className:"ftree-thumb",src:Np(e,o.path),alt:"",loading:"lazy"}),m.jsx("span",{className:"ftree-name",children:o.name})]}),f,m.jsx("span",{className:"ftree-size",children:ns(o.size)})]},o.path)})})}function $L(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===BL?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function GL({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=q.useState(null),[u,o]=q.useState(new Set),c=a&&t?Yp(t.entries,a):null;q.useEffect(()=>{var b;a&&t&&!((b=Yp(t.entries,a))!=null&&b.reportTitle)&&l(null)},[a,t]);const f=b=>o(S=>{const x=new Set(S);return x.has(b)?x.delete(b):x.add(b),x}),p=b=>{hT(e.id,b).catch(()=>{}).finally(n)};if(c!=null&&c.reportTitle)return m.jsx(PL,{projectId:e.id,entry:c,onBack:()=>l(null),onDelete:()=>{p(c.path),l(null)}});if(!t)return m.jsx("div",{className:"files-tab",children:m.jsx("div",{className:"files-col",children:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading files…"]})})});const{project:d,experiments:_,other:v}=$L(t.entries),w=b=>m.jsx(Lw,{projectId:e.id,entries:b,depth:0,expanded:u,onToggle:f,onOpenReport:l,onDelete:p}),C=`https://github.com/${e.githubOwner}/${e.githubRepo}`;return m.jsx("div",{className:"files-tab",children:m.jsxs("div",{className:"files-col",children:[m.jsxs("div",{className:"files-meta",children:[m.jsxs("a",{className:"files-pill",href:C,target:"_blank",rel:"noopener noreferrer",children:[m.jsxs("code",{children:[e.githubOwner,"/",e.githubRepo]}),m.jsx($S,{size:12})]}),m.jsx(UL,{dir:t.dir}),m.jsx("button",{type:"button",className:"files-pill files-pill-link",onClick:r,children:"Change storage location →"})]}),m.jsxs("p",{className:"files-hint",children:["An explorer over this folder — the agent writes each experiment's reports and figures into the folder named for its slug (project-wide reports under ",m.jsx("code",{children:"project/"}),"), and you can drop in your own files."]}),t.entries.length===0?m.jsxs("p",{className:"files-empty",children:["Nothing here yet. Ask the agent for a write-up of its findings — it saves each experiment's report folder (",m.jsx("code",{children:"report.md"})," + images) into the folder above."]}):m.jsxs("div",{className:"files-card",children:[w(d),w(_),v.length>0&&(_.length>0||d.length>0)&&m.jsx("div",{className:"ftree-divider",children:"Not linked to an experiment"}),w(v),t.truncated&&m.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]})]})})}function Gc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return m.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,m.jsx("span",{className:"tab-label",children:t}),m.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:m.jsx(Fo,{size:12})})]})}function qL({owner:e,repo:t,branch:n}){return m.jsxs("a",{className:"files-pill",href:xg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[m.jsx("code",{children:n}),m.jsx(pm,{size:12})]})}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach((function(r){Wp(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Wp(e,t,n){return(t=(function(r){var a=(function(l,u){if(typeof l!="object"||l===null)return l;var o=l[Symbol.toPrimitive];if(o!==void 0){var c=o.call(l,u);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(l)})(r,"string");return typeof a=="symbol"?a:String(a)})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(e,t){if(e==null)return{};var n,r,a=(function(u,o){if(u==null)return{};var c,f,p={},d=Object.keys(u);for(f=0;f<d.length;f++)c=d[f],o.indexOf(c)>=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Je(e,t){return Bw(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(_){d=!0,u=_}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||nh(e,t)||zw()}function Ow(e){return Bw(e)||Iw(e)||nh(e)||zw()}function Rn(e){return(function(t){if(Array.isArray(t))return Xp(t)})(e)||Iw(e)||nh(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Bw(e){if(Array.isArray(e))return e}function Iw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nh(e,t){if(e){if(typeof e=="string")return Xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xp(e,t):void 0}}function Xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +Its transcript is permanently removed.`)){try{await mT(oe.id)}catch(qe){window.alert(`Failed to delete "${we}": ${qe instanceof Error?qe.message:String(qe)}`);return}Ct(oe.id)}}function Ut(oe){if(!w)return Promise.resolve(!1);const we=w;return D({type:"busy",sessionId:we,busy:!0}),xT(we,oe).then(()=>!0).catch(()=>!1).finally(()=>{Hy(we).then(Ne=>D({type:"seed",sessionId:we,messages:Ne})).catch(()=>{}),zy(e).then(Ne=>{var qe;return D({type:"busy",sessionId:we,busy:!!((qe=Ne.find(at=>at.id===we))!=null&&qe.busy)})}).catch(()=>{})})}const ps=_.filter(oe=>b==="all"?!0:b==="archived"?oe.archived:!oe.archived),gi=m.jsxs("aside",{className:"session-rail floating-panel",children:[n,m.jsxs("nav",{className:"rail-nav",children:[m.jsxs("button",{className:"rail-nav-item",onClick:()=>{C(null),u("chat")},children:[m.jsx(bg,{size:15}),"New session"]}),m.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,onClick:()=>u("files"),children:[m.jsx($S,{size:15}),"Files"]}),dL.map(oe=>m.jsxs("button",{className:`rail-nav-item ${l===oe.id?"active":""}`,onClick:()=>u(oe.id),children:[oe.icon,oe.label]},oe.id))]}),m.jsxs("div",{className:"rail-body",children:[m.jsxs("div",{className:"rail-section-head",children:[m.jsx("div",{className:"rail-section-label",children:((On=Tw.find(oe=>oe.id===b))==null?void 0:On.railLabel)??"Recents"}),m.jsx(AL,{value:b,onChange:S})]}),ps.map(oe=>m.jsx(NL,{session:oe,active:oe.id===w&&l==="chat",busy:N.busySessions.has(oe.id),waiting:Pt(oe.id),onOpen:()=>{C(oe.id),u("chat")},onRename:we=>st(oe,we),onSetArchived:we=>qt(oe,we),onDelete:()=>void Ln(oe)},oe.id)),ps.length===0&&m.jsx("div",{className:"rail-empty",children:b==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),mi=`chat-header${r?"":" rail-hidden"}`,_i=!r&&m.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:m.jsx(qS,{size:15})});return l!=="chat"?m.jsxs(m.Fragment,{children:[r&&gi,m.jsxs("section",{className:"chat-pane",children:[!r&&m.jsx("div",{className:mi,children:_i}),m.jsx("div",{className:"settings-view-scroll",children:d})]})]}):m.jsxs(m.Fragment,{children:[r&&gi,m.jsxs("section",{className:"chat-pane",children:[m.jsxs("div",{className:mi,children:[_i,m.jsx("div",{className:"title",title:Fe?((vi=Fe.title)==null?void 0:vi.trim())||"Untitled":"New session",children:Fe?((ni=Fe.title)==null?void 0:ni.trim())||"Untitled":"New session"}),m.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:m.jsx(KA,{size:15})})]}),Ve?m.jsx("div",{className:"chat-thread",ref:q,onScroll:oe=>{const we=oe.currentTarget;K.current=we.scrollHeight-we.scrollTop-we.clientHeight<60},children:m.jsxs("div",{className:"chat-thread-inner",ref:X,children:[Ge.filter(EL).map(oe=>m.jsx(kL,{message:oe,onOpenFile:f&&(we=>f(we,w??void 0)),onRespond:Ut,onOpenPlan:De},oe.id)),ct&&(ht?m.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):m.jsxs("div",{className:"working",children:[m.jsx("span",{className:"spinner"})," Working…"]}))]})}):m.jsxs("div",{className:"chat-empty",children:[m.jsxs("h2",{children:["Open",m.jsx("span",{children:"Research"})]}),m.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),m.jsx(bL,{harnesses:T,selection:B??G1(T)}),t&&m.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var oe;y(`/reproduce-paper ${t} on `),(oe=L.current)==null||oe.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),m.jsxs("div",{className:"composer",children:[fe&&!(Ae&&fe.promptId===Ae.promptId)&&m.jsx(Nj,{synthesized:fe.synthesized,onView:()=>De==null?void 0:De(fe.plan,fe.promptId),onApprove:oe=>Ut({promptId:fe.promptId,approve:!0,resumeMode:oe}),onReject:()=>Ut({promptId:fe.promptId,approve:!1}),onRevise:oe=>{w&&Se({sessionId:w,promptId:fe.promptId}),Ut({promptId:fe.promptId,approve:!1,note:oe})}}),m.jsxs("div",{className:"composer-box",children:[P&&m.jsx(gL,{skills:Z,activeIndex:ee,onPick:ne,onHover:F}),E.length>0&&m.jsx("div",{className:"composer-attachments",children:E.map((oe,we)=>m.jsxs("div",{className:"attachment-thumb",children:[m.jsx("img",{src:oe.dataUrl,alt:"pasted"}),m.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>R(Ne=>Ne.filter((qe,at)=>at!==we)),children:m.jsx(Fo,{size:11})})]},we))}),m.jsx("textarea",{ref:L,value:x,placeholder:ie?"Type a custom answer…":be?`Message ${Ew[be.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:he,onDragOver:oe=>{oe.dataTransfer.types.includes("Files")&&oe.preventDefault()},onDrop:oe=>{oe.dataTransfer.files.length!==0&&(oe.preventDefault(),ge(Array.from(oe.dataTransfer.files)))},onChange:oe=>{y(oe.target.value),re(!1)},onKeyDown:oe=>{if(P){if(oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const we=oe.key==="ArrowDown"?1:-1;F((ee+we+Z.length)%Z.length);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault(),ne(Z[ee]);return}if(oe.key==="Escape"){oe.preventDefault(),re(!0);return}}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),Ie())}}),m.jsxs("div",{className:"composer-actions",children:[m.jsx(q1,{choices:(Ee==null?void 0:Ee.permissionModes)??[],value:(be==null?void 0:be.permissionMode)??null,defaultId:(Ee==null?void 0:Ee.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:rt}),m.jsx("div",{style:{flex:1}}),m.jsx(mL,{value:be,onSelect:Ce,onHarnesses:j,lockHarness:!!ye}),m.jsx(q1,{choices:(Ee==null?void 0:Ee.reasoningLevels)??[],value:(be==null?void 0:be.reasoningLevel)??null,defaultId:(Ee==null?void 0:Ee.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:bt}),ct&&!ie?m.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:Nt,children:m.jsx(Fo,{size:16})}):m.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void Ie(),disabled:!x.trim()&&E.length===0,children:m.jsx(FS,{size:16})})]})]})]})]})]})}function Y1(){return{dirs:new Map,files:[]}}function RL(e){const t=Y1();for(const n of e){const r=n.split("/");let a=t;for(let l=0;l<r.length-1;l++){const u=r[l];let o=a.dirs.get(u);o||(o=Y1(),a.dirs.set(u,o)),a=o}a.files.push(r[r.length-1])}return t}function DL({name:e,node:t,path:n,depth:r,toggled:a,onToggle:l,onOpenFile:u}){const o=r===0,c=a.has(n)?!o:o;return m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+r*14},onClick:()=>l(n),title:n,children:[c?m.jsx(cs,{size:13,className:"code-tree-chev"}):m.jsx(Uu,{size:13,className:"code-tree-chev"}),c?m.jsx($S,{size:13}):m.jsx(eN,{size:13}),m.jsx("span",{className:"code-tree-name",children:e})]}),c&&m.jsx(Rw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function Rw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return m.jsxs(m.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return m.jsx(DL,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[m.jsx(WA,{size:13}),m.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function ML({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=V.useState(null),[p,d]=V.useState(null),[_,v]=V.useState(!0),w=V.useRef(0),C=V.useCallback(()=>{const E=++w.current;v(!0),FN(e,r?{ref:r}:{}).then(R=>{E===w.current&&(f(R),d(null))}).catch(R=>{E===w.current&&d(R.message)}).finally(()=>{E===w.current&&v(!1)})},[e,r]);V.useEffect(()=>(f(null),d(null),C(),()=>{w.current++}),[C]);const b=V.useMemo(()=>c?RL(c.entries):null,[c]),S=V.useCallback(E=>{const R=new Set(a);R.has(E)?R.delete(E):R.add(E),u(R)},[a,u]),x=V.useMemo(()=>{const E=new Set,R=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),R.push({branch:N.branchName,label:N.slug}));return R},[n]),y=r||(c==null?void 0:c.branch)||null;return m.jsxs("div",{className:"code-tab",children:[m.jsxs("div",{className:"code-tab-header",children:[m.jsx("span",{className:"ctl-label",children:"Source"}),m.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[m.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&m.jsx("option",{value:r,children:r}),x.map(E=>m.jsx("option",{value:E.branch,children:E.label},E.branch))]}),y&&m.jsx("a",{className:"icon-btn",href:xg(t.githubOwner,t.githubRepo,y),target:"_blank",rel:"noopener noreferrer",title:`Open ${y} on GitHub`,children:m.jsx(pm,{size:13})}),m.jsx("span",{style:{flex:1}}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:C,children:_?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),(c==null?void 0:c.truncated)&&m.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&b&&m.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),m.jsx("div",{className:"code-tab-body",children:b?b.dirs.size===0&&b.files.length===0?m.jsx("div",{className:"code-tab-note",children:"No files."}):m.jsx("div",{className:"code-tree",children:m.jsx(Rw,{node:b,parentPath:"",depth:0,toggled:a,onToggle:S,onOpenFile:E=>o(E,void 0,r||void 0)})}):m.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}const jL="project";function LL(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function OL(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` +---`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const BL=/\.(png|jpe?g|gif|webp|svg)$/i;function Yp(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Yp(n.children??[],t);if(r)return r}}return null}function IL({projectId:e,folder:t,markdown:n}){const r=a=>LL(a)?a:Np(e,`${t}/${a.replace(/^\.?\//,"")}`);return m.jsx("div",{className:"md report-md",children:m.jsx(Fx,{remarkPlugins:[uw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return m.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return m.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[m.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&m.jsx("span",{className:"report-img-caption",children:l})]})},...bw},children:OL(n)})})}function zL({projectId:e,entry:t,onBack:n,onDelete:r}){const[a,l]=V.useState(null),[u,o]=V.useState(null);return V.useEffect(()=>{aT(e,t.path).then(c=>l(c.markdown)).catch(c=>o(c instanceof Error?c.message:String(c)))},[e,t.path,t.modifiedAt]),m.jsx("div",{className:"report-view",children:m.jsxs("div",{className:"report-view-col",children:[m.jsxs("div",{className:"report-view-head",children:[m.jsxs("button",{className:"report-back",onClick:n,children:[m.jsx(jo,{size:13})," Files"]}),m.jsx("span",{style:{flex:1}}),m.jsx("span",{className:"report-date",children:new Date(t.modifiedAt).toLocaleString()}),m.jsx("button",{className:"icon-btn",title:"Delete report folder","aria-label":"Delete report folder",onClick:()=>{window.confirm(`Delete the "${t.path}" folder from the files dir?`)&&r()},children:m.jsx(Gu,{size:14})})]}),u?m.jsx("div",{className:"error",children:u}):a===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading report…"]}):m.jsx(IL,{projectId:e,folder:t.path,markdown:a})]})})}function HL({dir:e}){const[t,n]=V.useState(!1);return m.jsxs("div",{className:"files-pill files-pill-dir",title:e,children:[m.jsx("code",{children:e}),m.jsx("button",{className:"icon-btn",title:"Copy path","aria-label":"Copy files directory path",onClick:()=>{var r;(r=navigator.clipboard)==null||r.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},children:t?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})})]})}function Dw({projectId:e,entries:t,depth:n,expanded:r,onToggle:a,onOpenReport:l,onDelete:u}){return m.jsx(m.Fragment,{children:t.map(o=>{var p;const c={paddingLeft:14+n*22},f=m.jsx("button",{className:"icon-btn ftree-del",title:`Delete ${o.path}`,"aria-label":`Delete ${o.path}`,onClick:d=>{d.stopPropagation(),window.confirm(`Delete "${o.path}" from the files dir?`)&&u(o.path)},children:m.jsx(Gu,{size:13})});if(o.isDir){const d=o.reportTitle!==void 0,_=r.has(o.path),v=n===0?o.experiment:void 0,w=d&&n>0,C=v?[v.title,v.branchName].filter(Boolean).join(" — "):d&&!w?o.reportTitle:void 0;return m.jsxs("div",{children:[m.jsxs("div",{className:"ftree-row clickable",style:c,title:C,onClick:()=>d?l(o.path):a(o.path),children:[m.jsx("button",{className:`ftree-chevron ${_?"open":""}`,"aria-label":_?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:b=>{b.stopPropagation(),a(o.path)},children:m.jsx(Uu,{size:13})}),w?m.jsx("span",{className:"ftree-title",children:o.reportTitle}):m.jsxs("span",{className:"ftree-dirname",children:[o.name,"/"]}),d&&m.jsx("span",{className:"ftree-tag",children:"report"}),(v==null?void 0:v.latestRunStatus)&&m.jsx("span",{className:"ftree-status",children:v.latestRunStatus}),f,m.jsx("span",{className:"ftree-date",children:new Date(o.modifiedAt).toLocaleDateString()})]}),_&&(((p=o.children)==null?void 0:p.length)??0)>0&&m.jsx("div",{className:"ftree-children",children:m.jsx(Dw,{projectId:e,entries:o.children??[],depth:n+1,expanded:r,onToggle:a,onOpenReport:l,onDelete:u})})]},o.path)}return m.jsxs("div",{className:"ftree-row",style:c,children:[m.jsx("span",{className:"ftree-chevron spacer"}),m.jsxs("a",{className:"ftree-link",href:Np(e,o.path),target:"_blank",rel:"noopener noreferrer",title:o.path,children:[BL.test(o.name)&&m.jsx("img",{className:"ftree-thumb",src:Np(e,o.path),alt:"",loading:"lazy"}),m.jsx("span",{className:"ftree-name",children:o.name})]}),f,m.jsx("span",{className:"ftree-size",children:ns(o.size)})]},o.path)})})}function FL(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===jL?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function PL({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=V.useState(null),[u,o]=V.useState(new Set),c=a&&t?Yp(t.entries,a):null;V.useEffect(()=>{var b;a&&t&&!((b=Yp(t.entries,a))!=null&&b.reportTitle)&&l(null)},[a,t]);const f=b=>o(S=>{const x=new Set(S);return x.has(b)?x.delete(b):x.add(b),x}),p=b=>{oT(e.id,b).catch(()=>{}).finally(n)};if(c!=null&&c.reportTitle)return m.jsx(zL,{projectId:e.id,entry:c,onBack:()=>l(null),onDelete:()=>{p(c.path),l(null)}});if(!t)return m.jsx("div",{className:"files-tab",children:m.jsx("div",{className:"files-col",children:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading files…"]})})});const{project:d,experiments:_,other:v}=FL(t.entries),w=b=>m.jsx(Dw,{projectId:e.id,entries:b,depth:0,expanded:u,onToggle:f,onOpenReport:l,onDelete:p}),C=`https://github.com/${e.githubOwner}/${e.githubRepo}`;return m.jsx("div",{className:"files-tab",children:m.jsxs("div",{className:"files-col",children:[m.jsxs("div",{className:"files-meta",children:[m.jsxs("a",{className:"files-pill",href:C,target:"_blank",rel:"noopener noreferrer",children:[m.jsxs("code",{children:[e.githubOwner,"/",e.githubRepo]}),m.jsx(PS,{size:12})]}),m.jsx(HL,{dir:t.dir}),m.jsx("button",{type:"button",className:"files-pill files-pill-link",onClick:r,children:"Change storage location →"})]}),m.jsxs("p",{className:"files-hint",children:["An explorer over this folder — the agent writes each experiment's reports and figures into the folder named for its slug (project-wide reports under ",m.jsx("code",{children:"project/"}),"), and you can drop in your own files."]}),t.entries.length===0?m.jsxs("p",{className:"files-empty",children:["Nothing here yet. Ask the agent for a write-up of its findings — it saves each experiment's report folder (",m.jsx("code",{children:"report.md"})," + images) into the folder above."]}):m.jsxs("div",{className:"files-card",children:[w(d),w(_),v.length>0&&(_.length>0||d.length>0)&&m.jsx("div",{className:"ftree-divider",children:"Not linked to an experiment"}),w(v),t.truncated&&m.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]})]})})}function Gc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return m.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,m.jsx("span",{className:"tab-label",children:t}),m.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:m.jsx(Fo,{size:12})})]})}function UL({owner:e,repo:t,branch:n}){return m.jsxs("a",{className:"files-pill",href:xg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[m.jsx("code",{children:n}),m.jsx(pm,{size:12})]})}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach((function(r){Wp(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Wp(e,t,n){return(t=(function(r){var a=(function(l,u){if(typeof l!="object"||l===null)return l;var o=l[Symbol.toPrimitive];if(o!==void 0){var c=o.call(l,u);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(l)})(r,"string");return typeof a=="symbol"?a:String(a)})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(e,t){if(e==null)return{};var n,r,a=(function(u,o){if(u==null)return{};var c,f,p={},d=Object.keys(u);for(f=0;f<d.length;f++)c=d[f],o.indexOf(c)>=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Je(e,t){return jw(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(_){d=!0,u=_}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||nh(e,t)||Ow()}function Mw(e){return jw(e)||Lw(e)||nh(e)||Ow()}function Rn(e){return(function(t){if(Array.isArray(t))return Xp(t)})(e)||Lw(e)||nh(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function jw(e){if(Array.isArray(e))return e}function Lw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nh(e,t){if(e){if(typeof e=="string")return Xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xp(e,t):void 0}}function Xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ow(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gm(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=nh(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return u=c.done,c},e:function(c){o=!0,l=c},f:function(){try{u||n.return==null||n.return()}finally{if(o)throw l}}}}var qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(e,t){return e(t={exports:{}},t.exports),t.exports}var Nn=fl((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var l=arguments[a];if(l){var u=typeof l;if(u==="string"||u==="number")r.push(l);else if(Array.isArray(l)){if(l.length){var o=n.apply(null,l);o&&r.push(o)}}else if(u==="object"){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){r.push(l.toString());continue}for(var c in l)t.call(l,c)&&l[c]&&r.push(c)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),gn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Hw=q.createContext(gn),VL=Hw.Provider,YL=function(){return q.useContext(Hw)},WL=fl((function(e,t){(function(n){function r(l){var u=l.slice(11),o=null,c=null;switch(u.indexOf('"')){case-1:o=(d=u.split(" "))[0].slice(2),c=d[1].slice(2);break;case 0:var f=u.indexOf('"',2);o=u.slice(3,f);var p=u.indexOf('"',f+1);c=p<0?u.slice(f+4):u.slice(p+3,-1);break;default:var d;o=(d=u.split(" "))[0].slice(2),c=d[1].slice(3,-1)}return{oldPath:o,newPath:c}}var a={parse:function(l){for(var u,o,c,f,p,d=[],_=2,v=l.split(` -`),w=v.length,C=0;C<w;){var b=v[C];if(b.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(p=r(b)).oldPath,newPath:p.newPath},d.push(u);var S,x=null;e:for(;S=v[++C];){var y=S.indexOf(" "),E=y>-1?S.slice(0,y):E;switch(E){case"diff":C--;break e;case"deleted":case"new":var R=S.slice(y+1);R.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=R.slice(10));break;case"similarity":u.similarity=parseInt(S.split(" ")[2],10);break;case"index":var N=S.slice(y+1).split(" "),D=N[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=S.slice(y+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=S.slice(y+1),B=v[++C].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),_=5;break e}}u.type=x||"modify"}else if(b.indexOf("Binary")===0)u.isBinary=!0,u.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",_=2,u=null;else if(_===5)if(b.indexOf("@@")===0){var F=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);o={content:b,oldStart:F[1]-0,newStart:F[4]-0,oldLines:F[3]-0||1,newLines:F[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var Y=b.slice(0,1),H={content:b.slice(1)};switch(Y){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=f,f++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=c,c++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=c,H.newLineNumber=f,c++,f++;break;case"\\":var z=o.changes[o.changes.length-1];z.isDelete||(u.newEndingNewLine=!1),z.isInsert||(u.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}C++}return d}};e.exports=a})()}));function Tr(e){return e.type==="insert"}function Dn(e){return e.type==="delete"}function $i(e){return e.type==="normal"}function XL(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=Je(l,3),f=c[0],p=c[1],d=c[2];return p?Tr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Dn(u)&&Dn(p)?d:o]):(f.push(u),[f,u,Dn(u)?o:-1])}),[[],null,-1]);return Je(a,1)[0]})(e.changes):e.changes;return lt(lt({},e),{},{isPlain:!1,changes:n})}function KL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` +*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var l=arguments[a];if(l){var u=typeof l;if(u==="string"||u==="number")r.push(l);else if(Array.isArray(l)){if(l.length){var o=n.apply(null,l);o&&r.push(o)}}else if(u==="object"){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){r.push(l.toString());continue}for(var c in l)t.call(l,c)&&l[c]&&r.push(c)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),gn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Bw=V.createContext(gn),$L=Bw.Provider,GL=function(){return V.useContext(Bw)},qL=fl((function(e,t){(function(n){function r(l){var u=l.slice(11),o=null,c=null;switch(u.indexOf('"')){case-1:o=(d=u.split(" "))[0].slice(2),c=d[1].slice(2);break;case 0:var f=u.indexOf('"',2);o=u.slice(3,f);var p=u.indexOf('"',f+1);c=p<0?u.slice(f+4):u.slice(p+3,-1);break;default:var d;o=(d=u.split(" "))[0].slice(2),c=d[1].slice(3,-1)}return{oldPath:o,newPath:c}}var a={parse:function(l){for(var u,o,c,f,p,d=[],_=2,v=l.split(` +`),w=v.length,C=0;C<w;){var b=v[C];if(b.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(p=r(b)).oldPath,newPath:p.newPath},d.push(u);var S,x=null;e:for(;S=v[++C];){var y=S.indexOf(" "),E=y>-1?S.slice(0,y):E;switch(E){case"diff":C--;break e;case"deleted":case"new":var R=S.slice(y+1);R.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=R.slice(10));break;case"similarity":u.similarity=parseInt(S.split(" ")[2],10);break;case"index":var N=S.slice(y+1).split(" "),D=N[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=S.slice(y+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=S.slice(y+1),B=v[++C].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),_=5;break e}}u.type=x||"modify"}else if(b.indexOf("Binary")===0)u.isBinary=!0,u.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",_=2,u=null;else if(_===5)if(b.indexOf("@@")===0){var z=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);o={content:b,oldStart:z[1]-0,newStart:z[4]-0,oldLines:z[3]-0||1,newLines:z[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var G=b.slice(0,1),U={content:b.slice(1)};switch(G){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=f,f++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=c,c++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=c,U.newLineNumber=f,c++,f++;break;case"\\":var H=o.changes[o.changes.length-1];H.isDelete||(u.newEndingNewLine=!1),H.isInsert||(u.oldEndingNewLine=!1)}U.type&&o.changes.push(U)}C++}return d}};e.exports=a})()}));function Tr(e){return e.type==="insert"}function Dn(e){return e.type==="delete"}function Ui(e){return e.type==="normal"}function VL(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=Je(l,3),f=c[0],p=c[1],d=c[2];return p?Tr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Dn(u)&&Dn(p)?d:o]):(f.push(u),[f,u,Dn(u)?o:-1])}),[[],null,-1]);return Je(a,1)[0]})(e.changes):e.changes;return lt(lt({},e),{},{isPlain:!1,changes:n})}function YL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` `),l=r.indexOf(` `,a+1),u=r.slice(0,a),o=r.slice(a+1,l),c=u.split(" ").slice(1,-3).join(" "),f=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(f),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(f),r.slice(l+1)].join(` -`)})(e.trimStart());return WL.parse(n).map((function(r){return(function(a,l){var u=a.hunks.map((function(o){return XL(o,l)}));return lt(lt({},a),{},{hunks:u})})(r,t)}))}function ZL(e){return e[0]}function QL(e){return e[e.length-1]}function Kp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Yo(e){return e==="old"?function(t){return Tr(t)?-1:$i(t)?t.oldLineNumber:t.lineNumber}:function(t){return Dn(t)?-1:$i(t)?t.newLineNumber:t.lineNumber}}function Fw(e,t){return function(n,r){var a=n[e],l=a+n[t];return r>=a&&r<l}}function JL(e,t){return function(n,r,a){var l=n[e]+n[t],u=r[e];return a>=l&&a<u}}function Pw(e){var t=Yo(e),n=(function(r){var a=Je(Kp(r),2),l=Fw(a[0],a[1]);return function(u,o){return u.find((function(c){return l(c,o)}))}})(e);return function(r,a){var l=n(r,a);if(l)return l.changes.find((function(u){return t(u)===a}))}}function mm(e){var t=e==="old"?"new":"old",n=Je(Kp(e),2),r=n[0],a=n[1],l=Je(Kp(t),2),u=l[0],o=l[1],c=Yo(e),f=Yo(t),p=Fw(r,a),d=JL(r,a);return function(_,v){var w=ZL(_);if(v<w[r]){var C=w[r]-v;return w[u]-C}var b=QL(_);if(b[r]+b[a]<=v){var S=v-b[r]-b[a];return b[u]+b[o]+S}for(var x=0;x<_.length;x++){var y=_[x],E=_[x+1];if(p(y,v)){var R=y.changes.findIndex((function(F){return c(F)===v})),N=y.changes[R];if($i(N))return f(N);var D=Dn(N)?R+1:R-1,T=y.changes[D];if(!T)return-1;var j=Tr(N)?"delete":"insert";return T.type===j?f(T):-1}if(d(y,E,v)){var B=v-y[r]-y[a];return y[u]+y[o]+B}}throw new Error("Unexpected line position ".concat(v))}}var eO=function(e,t,n,r){for(var a=e.length,l=n+-1;++l<a;)if(t(e[l],l,e))return l;return-1},tO=function(){this.__data__=[],this.size=0},Uw=function(e,t){return e===t||e!=e&&t!=t},ih=function(e,t){for(var n=e.length;n--;)if(Uw(e[n][0],t))return n;return-1},nO=Array.prototype.splice,iO=function(e){var t=this.__data__,n=ih(t,e);return!(n<0)&&(n==t.length-1?t.pop():nO.call(t,n,1),--this.size,!0)},rO=function(e){var t=this.__data__,n=ih(t,e);return n<0?void 0:t[n][1]},sO=function(e){return ih(this.__data__,e)>-1},aO=function(e,t){var n=this.__data__,r=ih(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ia(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ia.prototype.clear=tO,ia.prototype.delete=iO,ia.prototype.get=rO,ia.prototype.has=sO,ia.prototype.set=aO;var rh=ia,oO=function(){this.__data__=new rh,this.size=0},lO=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},cO=function(e){return this.__data__.get(e)},uO=function(e){return this.__data__.has(e)},$w=typeof qc=="object"&&qc&&qc.Object===Object&&qc,hO=typeof self=="object"&&self&&self.Object===Object&&self,Vi=$w||hO||Function("return this")(),hi=Vi.Symbol,Gw=Object.prototype,fO=Gw.hasOwnProperty,dO=Gw.toString,No=hi?hi.toStringTag:void 0,pO=function(e){var t=fO.call(e,No),n=e[No];try{e[No]=void 0;var r=!0}catch{}var a=dO.call(e);return r&&(t?e[No]=n:delete e[No]),a},gO=Object.prototype.toString,mO=function(e){return gO.call(e)},X1=hi?hi.toStringTag:void 0,Ea=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":X1&&X1 in Object(e)?pO(e):mO(e)},Wo=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},qw=function(e){if(!Wo(e))return!1;var t=Ea(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},cp=Vi["__core-js_shared__"],K1=(function(){var e=/[^.]+$/.exec(cp&&cp.keys&&cp.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),_O=function(e){return!!K1&&K1 in e},vO=Function.prototype.toString,fs=function(e){if(e!=null){try{return vO.call(e)}catch{}try{return e+""}catch{}}return""},yO=/^\[object .+?Constructor\]$/,bO=Function.prototype,SO=Object.prototype,xO=bO.toString,wO=SO.hasOwnProperty,CO=RegExp("^"+xO.call(wO).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),EO=function(e){return!(!Wo(e)||_O(e))&&(qw(e)?CO:yO).test(fs(e))},kO=function(e,t){return e==null?void 0:e[t]},ds=function(e,t){var n=kO(e,t);return EO(n)?n:void 0},Xo=ds(Vi,"Map"),Ko=ds(Object,"create"),AO=function(){this.__data__=Ko?Ko(null):{},this.size=0},NO=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},TO=Object.prototype.hasOwnProperty,RO=function(e){var t=this.__data__;if(Ko){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return TO.call(t,e)?t[e]:void 0},DO=Object.prototype.hasOwnProperty,MO=function(e){var t=this.__data__;return Ko?t[e]!==void 0:DO.call(t,e)},jO=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ko&&t===void 0?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=AO,ra.prototype.delete=NO,ra.prototype.get=RO,ra.prototype.has=MO,ra.prototype.set=jO;var Z1=ra,LO=function(){this.size=0,this.__data__={hash:new Z1,map:new(Xo||rh),string:new Z1}},OO=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},sh=function(e,t){var n=e.__data__;return OO(t)?n[typeof t=="string"?"string":"hash"]:n.map},BO=function(e){var t=sh(this,e).delete(e);return this.size-=t?1:0,t},IO=function(e){return sh(this,e).get(e)},zO=function(e){return sh(this,e).has(e)},HO=function(e,t){var n=sh(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=LO,sa.prototype.delete=BO,sa.prototype.get=IO,sa.prototype.has=zO,sa.prototype.set=HO;var ah=sa,FO=function(e,t){var n=this.__data__;if(n instanceof rh){var r=n.__data__;if(!Xo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ah(r)}return n.set(e,t),this.size=n.size,this};function aa(e){var t=this.__data__=new rh(e);this.size=t.size}aa.prototype.clear=oO,aa.prototype.delete=lO,aa.prototype.get=cO,aa.prototype.has=uO,aa.prototype.set=FO;var fu=aa,PO=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},UO=function(e){return this.__data__.has(e)};function du(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ah;++t<n;)this.add(e[t])}du.prototype.add=du.prototype.push=PO,du.prototype.has=UO;var $O=du,GO=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},qO=function(e,t){return e.has(t)},Vw=function(e,t,n,r,a,l){var u=1&n,o=e.length,c=t.length;if(o!=c&&!(u&&c>o))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,_=!0,v=2&n?new $O:void 0;for(l.set(e,t),l.set(t,e);++d<o;){var w=e[d],C=t[d];if(r)var b=u?r(C,w,d,t,e,l):r(w,C,d,e,t,l);if(b!==void 0){if(b)continue;_=!1;break}if(v){if(!GO(t,(function(S,x){if(!qO(v,x)&&(w===S||a(w,S,n,r,l)))return v.push(x)}))){_=!1;break}}else if(w!==C&&!a(w,C,n,r,l)){_=!1;break}}return l.delete(e),l.delete(t),_},Q1=Vi.Uint8Array,VO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r,a){n[++t]=[a,r]})),n},YO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r){n[++t]=r})),n},J1=hi?hi.prototype:void 0,up=J1?J1.valueOf:void 0,WO=function(e,t,n,r,a,l,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new Q1(e),new Q1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Uw(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=VO;case"[object Set]":var c=1&r;if(o||(o=YO),e.size!=t.size&&!c)return!1;var f=u.get(e);if(f)return f==t;r|=2,u.set(e,t);var p=Vw(o(e),o(t),r,a,l,u);return u.delete(e),p;case"[object Symbol]":if(up)return up.call(e)==up.call(t)}return!1},Yw=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Mn=Array.isArray,XO=function(e,t,n){var r=t(e);return Mn(e)?r:Yw(r,n(e))},KO=function(e,t){for(var n=-1,r=e==null?0:e.length,a=0,l=[];++n<r;){var u=e[n];t(u,n,e)&&(l[a++]=u)}return l},ZO=function(){return[]},QO=Object.prototype.propertyIsEnumerable,eb=Object.getOwnPropertySymbols,JO=eb?function(e){return e==null?[]:(e=Object(e),KO(eb(e),(function(t){return QO.call(e,t)})))}:ZO,e6=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},da=function(e){return e!=null&&typeof e=="object"},tb=function(e){return da(e)&&Ea(e)=="[object Arguments]"},Ww=Object.prototype,t6=Ww.hasOwnProperty,n6=Ww.propertyIsEnumerable,oh=tb((function(){return arguments})())?tb:function(e){return da(e)&&t6.call(e,"callee")&&!n6.call(e,"callee")},i6=function(){return!1},Au=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?Vi.Buffer:void 0,l=(a?a.isBuffer:void 0)||i6;e.exports=l})),r6=/^(?:0|[1-9]\d*)$/,Xw=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&r6.test(e))&&e>-1&&e%1==0&&e<t},_m=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},wt={};wt["[object Float32Array]"]=wt["[object Float64Array]"]=wt["[object Int8Array]"]=wt["[object Int16Array]"]=wt["[object Int32Array]"]=wt["[object Uint8Array]"]=wt["[object Uint8ClampedArray]"]=wt["[object Uint16Array]"]=wt["[object Uint32Array]"]=!0,wt["[object Arguments]"]=wt["[object Array]"]=wt["[object ArrayBuffer]"]=wt["[object Boolean]"]=wt["[object DataView]"]=wt["[object Date]"]=wt["[object Error]"]=wt["[object Function]"]=wt["[object Map]"]=wt["[object Number]"]=wt["[object Object]"]=wt["[object RegExp]"]=wt["[object Set]"]=wt["[object String]"]=wt["[object WeakMap]"]=!1;var s6=function(e){return da(e)&&_m(e.length)&&!!wt[Ea(e)]},a6=function(e){return function(t){return e(t)}},nb=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&$w.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),ib=nb&&nb.isTypedArray,vm=ib?a6(ib):s6,o6=Object.prototype.hasOwnProperty,l6=function(e,t){var n=Mn(e),r=!n&&oh(e),a=!n&&!r&&Au(e),l=!n&&!r&&!a&&vm(e),u=n||r||a||l,o=u?e6(e.length,String):[],c=o.length;for(var f in e)!o6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Xw(f,c))||o.push(f);return o},c6=Object.prototype,Kw=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||c6)},u6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),h6=Object.prototype.hasOwnProperty,Zw=function(e){if(!Kw(e))return u6(e);var t=[];for(var n in Object(e))h6.call(e,n)&&n!="constructor"&&t.push(n);return t},lh=function(e){return e!=null&&_m(e.length)&&!qw(e)},ym=function(e){return lh(e)?l6(e):Zw(e)},rb=function(e){return XO(e,ym,JO)},f6=Object.prototype.hasOwnProperty,d6=function(e,t,n,r,a,l){var u=1&n,o=rb(e),c=o.length;if(c!=rb(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:f6.call(t,p)))return!1}var d=l.get(e),_=l.get(t);if(d&&_)return d==t&&_==e;var v=!0;l.set(e,t),l.set(t,e);for(var w=u;++f<c;){var C=e[p=o[f]],b=t[p];if(r)var S=u?r(b,C,p,t,e,l):r(C,b,p,e,t,l);if(!(S===void 0?C===b||a(C,b,n,r,l):S)){v=!1;break}w||(w=p=="constructor")}if(v&&!w){var x=e.constructor,y=t.constructor;x==y||!("constructor"in e)||!("constructor"in t)||typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y||(v=!1)}return l.delete(e),l.delete(t),v},Zp=ds(Vi,"DataView"),Qp=ds(Vi,"Promise"),Jp=ds(Vi,"Set"),eg=ds(Vi,"WeakMap"),p6=fs(Zp),g6=fs(Xo),m6=fs(Qp),_6=fs(Jp),v6=fs(eg),Kr=Ea;(Zp&&Kr(new Zp(new ArrayBuffer(1)))!="[object DataView]"||Xo&&Kr(new Xo)!="[object Map]"||Qp&&Kr(Qp.resolve())!="[object Promise]"||Jp&&Kr(new Jp)!="[object Set]"||eg&&Kr(new eg)!="[object WeakMap]")&&(Kr=function(e){var t=Ea(e),n=t=="[object Object]"?e.constructor:void 0,r=n?fs(n):"";if(r)switch(r){case p6:return"[object DataView]";case g6:return"[object Map]";case m6:return"[object Promise]";case _6:return"[object Set]";case v6:return"[object WeakMap]"}return t});var tg=Kr,Vc="[object Object]",sb=Object.prototype.hasOwnProperty,y6=function(e,t,n,r,a,l){var u=Mn(e),o=Mn(t),c=u?"[object Array]":tg(e),f=o?"[object Array]":tg(t),p=(c=c=="[object Arguments]"?Vc:c)==Vc,d=(f=f=="[object Arguments]"?Vc:f)==Vc,_=c==f;if(_&&Au(e)){if(!Au(t))return!1;u=!0,p=!1}if(_&&!p)return l||(l=new fu),u||vm(e)?Vw(e,t,n,r,a,l):WO(e,t,c,n,r,a,l);if(!(1&n)){var v=p&&sb.call(e,"__wrapped__"),w=d&&sb.call(t,"__wrapped__");if(v||w){var C=v?e.value():e,b=w?t.value():t;return l||(l=new fu),a(C,b,n,r,l)}}return!!_&&(l||(l=new fu),d6(e,t,n,r,a,l))},ch=function e(t,n,r,a,l){return t===n||(t==null||n==null||!da(t)&&!da(n)?t!=t&&n!=n:y6(t,n,r,a,e,l))},b6=function(e,t,n,r){var a=n.length,l=a;if(e==null)return!l;for(e=Object(e);a--;){var u=n[a];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<l;){var o=(u=n[a])[0],c=e[o],f=u[1];if(u[2]){if(c===void 0&&!(o in e))return!1}else{var p=new fu,d;if(!(d===void 0?ch(f,c,3,r,p):d))return!1}}return!0},Qw=function(e){return e==e&&!Wo(e)},S6=function(e){for(var t=ym(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,Qw(a)]}return t},Jw=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},x6=function(e){var t=S6(e);return t.length==1&&t[0][2]?Jw(t[0][0],t[0][1]):function(n){return n===e||b6(n,e,t)}},uh=function(e){return typeof e=="symbol"||da(e)&&Ea(e)=="[object Symbol]"},w6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C6=/^\w*$/,bm=function(e,t){if(Mn(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!uh(e))||C6.test(e)||!w6.test(e)||t!=null&&e in Object(t)};function Sm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],l=n.cache;if(l.has(a))return l.get(a);var u=e.apply(this,r);return n.cache=l.set(a,u)||l,u};return n.cache=new(Sm.Cache||ah),n}Sm.Cache=ah;var E6=Sm,k6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A6=/\\(\\)?/g,N6=(function(e){var t=E6(e,(function(r){return n.size===500&&n.clear(),r})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(k6,(function(n,r,a,l){t.push(a?l.replace(A6,"$1"):r||n)})),t})),eC=function(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},ab=hi?hi.prototype:void 0,ob=ab?ab.toString:void 0,T6=function e(t){if(typeof t=="string")return t;if(Mn(t))return eC(t,e)+"";if(uh(t))return ob?ob.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},R6=function(e){return e==null?"":T6(e)},tC=function(e,t){return Mn(e)?e:bm(e,t)?[e]:N6(R6(e))},hh=function(e){if(typeof e=="string"||uh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},nC=function(e,t){for(var n=0,r=(t=tC(t,e)).length;e!=null&&n<r;)e=e[hh(t[n++])];return n&&n==r?e:void 0},D6=function(e,t,n){var r=e==null?void 0:nC(e,t);return r===void 0?n:r},M6=function(e,t){return e!=null&&t in Object(e)},j6=function(e,t,n){for(var r=-1,a=(t=tC(t,e)).length,l=!1;++r<a;){var u=hh(t[r]);if(!(l=e!=null&&n(e,u)))break;e=e[u]}return l||++r!=a?l:!!(a=e==null?0:e.length)&&_m(a)&&Xw(u,a)&&(Mn(e)||oh(e))},L6=function(e,t){return e!=null&&j6(e,t,M6)},O6=function(e,t){return bm(e)&&Qw(t)?Jw(hh(e),t):function(n){var r=D6(n,e);return r===void 0&&r===t?L6(n,e):ch(t,r,3)}},B6=function(e){return e},I6=function(e){return function(t){return t==null?void 0:t[e]}},z6=function(e){return function(t){return nC(t,e)}},H6=function(e){return bm(e)?I6(hh(e)):z6(e)},fh=function(e){return typeof e=="function"?e:e==null?B6:typeof e=="object"?Mn(e)?O6(e[0],e[1]):x6(e):H6(e)},F6=/\s/,P6=function(e){for(var t=e.length;t--&&F6.test(e.charAt(t)););return t},U6=/^\s+/,$6=function(e){return e&&e.slice(0,P6(e)+1).replace(U6,"")},G6=/^[-+]0x[0-9a-f]+$/i,q6=/^0b[01]+$/i,V6=/^0o[0-7]+$/i,Y6=parseInt,W6=function(e){if(typeof e=="number")return e;if(uh(e))return NaN;if(Wo(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Wo(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$6(e);var n=q6.test(e);return n||V6.test(e)?Y6(e.slice(2),n?2:8):G6.test(e)?NaN:+e},X6=function(e){return e?(e=W6(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},K6=function(e){var t=X6(e),n=t%1;return t==t?n?t-n:t:0};function kr(e){if(!e)throw new Error("change is not provided");if($i(e))return"N".concat(e.oldLineNumber);var t=Tr(e)?"I":"D";return"".concat(t).concat(e.lineNumber)}mm("old");var dh=Yo("old"),ph=Yo("new");Pw("old");Pw("new");mm("new");mm("old");var lb=(function(){try{var e=ds(Object,"defineProperty");return e({},"",{}),e}catch{}})(),xm=function(e,t,n){t=="__proto__"&&lb?lb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Z6=function(e){return function(t,n,r){for(var a=-1,l=Object(t),u=r(t),o=u.length;o--;){var c=u[++a];if(n(l[c],c,l)===!1)break}return t}},Q6=Z6(),iC=function(e,t){return e&&Q6(e,t,ym)},rC=function(e,t){var n={};return t=fh(t),iC(e,(function(r,a,l){xm(n,a,t(r,a,l))})),n},J6=["changeKey","text","tokens","renderToken"],cb=function e(t,n){var r=t.type,a=t.value,l=t.markType,u=t.properties,o=t.className,c=t.children,f=function(d){return m.jsx("span",{className:d,children:a||c&&c.map(e)},n)};switch(r){case"text":return a;case"mark":return f("diff-code-mark diff-code-mark-".concat(l));case"edit":return f("diff-code-edit");default:var p=u&&u.className;return f(Nn(o||p))}};function e8(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=Je(e,1)[0];return t.type==="text"&&!t.value}return!0}function t8(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Ar(e,J6),u=a?function(o,c){return a(o,cb,c)}:cb;return m.jsx("td",lt(lt({},l),{},{"data-change-key":t,children:r?e8(r)?" ":r.map(u):n||" "}))}var sC=q.memo(t8);function aC(e,t){return function(){var n=t==="old"?dh(e):ph(e);return n===-1?void 0:n}}function oC(e,t){return function(n){return e&&n?m.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Nu(e,t){return t?function(n){e(),t(n)}:e}function ub(e,t,n,r){return q.useMemo((function(){var a=rC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=Nu(n,a.onMouseEnter),a.onMouseLeave=Nu(r,a.onMouseLeave),a}),[e,n,r,t])}function hb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:aC(t,r),wrapInAnchor:oC(a,l)};return m.jsx("td",lt(lt({className:e},u),{},{"data-change-key":n,children:c(f)}))}function n8(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.gutterAnchor,C=e.generateAnchorID,b=e.renderToken,S=e.renderGutter,x=a.type,y=a.content,E=kr(a),R=(t=Je(q.useState(!1),2),n=t[0],r=t[1],[n,q.useCallback((function(){return r(!0)}),[]),q.useCallback((function(){return r(!1)}),[])]),N=Je(R,3),D=N[0],T=N[1],j=N[2],B=q.useMemo((function(){return{change:a}}),[a]),F=ub(d,B,T,j),Y=ub(_,B,T,j),H=C(a),z=c({changes:[a],defaultGenerate:function(){return o}}),V=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),G=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return m.jsxs("tr",{id:H,className:Nn("diff-line",z),children:[!v&&hb(V,a,E,"old",w,H,F,D,S),!v&&hb(V,a,E,"new",w,H,F,D,S),m.jsx(sC,lt({className:G,changeKey:E,text:y,tokens:u,renderToken:b},Y))]})}var i8=q.memo(n8);function r8(e){var t=e.hideGutter,n=e.element;return m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var s8=["hideGutter","selectedChanges","tokens","lineClassName"],a8=["hunk","widgets","className"];function o8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,a8),l=(function(u,o){return u.reduce((function(c,f){var p=kr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,3),p=f[0],d=f[1],_=f[2],v=c.hideGutter,w=c.selectedChanges,C=c.tokens,b=c.lineClassName,S=Ar(c,s8);if(p==="change"){var x=Dn(_)?"old":"new",y=Dn(_)?dh(_):ph(_),E=C?C[x][y-1]:null;return m.jsx(i8,lt({className:b,change:_,hideGutter:v,selected:w.includes(d),tokens:E},S),"change".concat(d))}return p==="widget"?m.jsx(r8,{hideGutter:v,element:_},"widget".concat(d)):null})(u,a)}))})}var lC=0;function Yc(e,t,n,r){var a=q.useCallback((function(){return t(e)}),[e,t]),l=q.useCallback((function(){return t("")}),[t]);return q.useMemo((function(){var u=rC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=Nu(a,u.onMouseEnter),u.onMouseLeave=Nu(l,u.onMouseLeave),u}),[n,r,a,e,l])}function hp(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,_=e.hideGutter,v=e.hover,w=e.renderToken,C=e.renderGutter;if(!t){var b=Nn("diff-gutter","diff-gutter-omit",l),S=Nn("diff-code","diff-code-omit",u);return[!_&&m.jsx("td",{className:b},"gutter"),m.jsx("td",{className:S},"code")]}var x=t.type,y=t.content,E=kr(t),R=n===lC?"old":"new",N=lt({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),Wp({"diff-gutter-selected":r},"diff-line-hover-"+R,v),l),children:C({change:t,side:R,inHoverState:v,renderDefault:aC(t,R),wrapInAnchor:oC(p,d)})},o),D=Nn("diff-code","diff-code-".concat(x),Wp({"diff-code-selected":r},"diff-line-hover-"+R,v),u);return[!_&&m.jsx("td",lt(lt({},N),{},{"data-change-key":E}),"gutter"),m.jsx(sC,lt({className:D,changeKey:E,text:y,tokens:a,renderToken:w},c),"code")]}function l8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.generateAnchorID,C=e.generateLineClassName,b=e.gutterAnchor,S=e.renderToken,x=e.renderGutter,y=Je(q.useState(""),2),E=y[0],R=y[1],N=Yc("old",R,n,d),D=Yc("new",R,r,d),T=Yc("old",R,n,_),j=Yc("new",R,r,_),B=n&&w(n),F=r&&w(r),Y=C({changes:[n,r],defaultGenerate:function(){return t}}),H={monotonous:c,hideGutter:v,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:_,renderToken:S,renderGutter:x},z=lt(lt({},H),{},{change:n,side:lC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:b,gutterAnchorTarget:B,hover:E==="old"}),V=lt(lt({},H),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:D,codeEvents:j,anchorID:n===r?null:F,gutterAnchor:b,gutterAnchorTarget:n===r?B:F,hover:E==="new"});if(c)return m.jsx("tr",{className:Nn("diff-line",Y),children:hp(n?z:V)});var G=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return m.jsxs("tr",{className:Nn("diff-line",G,Y),children:[hp(z),hp(V)]})}var c8=q.memo(l8);function u8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):m.jsxs("tr",{className:"diff-widget",children:[m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var h8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],f8=["hunk","widgets","className"];function Wc(e,t){return(e?kr(e):"00")+(t?kr(t):"00")}function d8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,f8),l=(function(u,o){for(var c=function(S){if(!S)return null;var x=kr(S);return o[x]||null},f=[],p=0;p<u.length;p++){var d=u[p];if($i(d))f.push(["change",Wc(d,d),d,d]);else if(Dn(d)){var _=u[p+1];_&&Tr(_)?(p+=1,f.push(["change",Wc(d,_),d,_])):f.push(["change",Wc(d,null),d,null])}else f.push(["change",Wc(null,d),null,d]);var v=f[f.length-1],w=c(v[2]),C=c(v[3]);if(w||C){var b=v[1];f.push(["widget",b,w,C])}}return f})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,4),p=f[0],d=f[1],_=f[2],v=f[3],w=c.selectedChanges,C=c.monotonous,b=c.hideGutter,S=c.tokens,x=c.lineClassName,y=Ar(c,h8);if(p==="change"){var E=!!_&&w.includes(kr(_)),R=!!v&&w.includes(kr(v)),N=_&&S?S.old[dh(_)-1]:null,D=v&&S?S.new[ph(v)-1]:null;return m.jsx(c8,lt({className:x,oldChange:_,newChange:v,monotonous:C,hideGutter:b,oldSelected:E,newSelected:R,oldTokens:N,newTokens:D},y),"change".concat(d))}return p==="widget"?m.jsx(u8,{monotonous:C,hideGutter:b,oldElement:_,newElement:v},"widget".concat(d)):null})(u,a)}))})}var p8=["gutterType","hunkClassName"];function g8(e){var t=e.hunk,n=YL(),r=n.gutterType,a=n.hunkClassName,l=Ar(n,p8),u=r==="none",o=r==="anchor",c=l.viewType==="unified"?o8:d8;return m.jsx(c,lt(lt({},l),{},{hunk:t,hideGutter:u,gutterAnchor:o,className:a}))}function m8(){}function fb(e,t){var n=t?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function _8(e){return e.map((function(t){return m.jsx(g8,{hunk:t},(function(n){return"-".concat(n.oldStart,",").concat(n.oldLines," +").concat(n.newStart,",").concat(n.newLines)})(t))}))}function v8(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,a=e.className,l=e.hunkClassName,u=l===void 0?gn.hunkClassName:l,o=e.lineClassName,c=o===void 0?gn.lineClassName:o,f=e.generateLineClassName,p=f===void 0?gn.generateLineClassName:f,d=e.gutterClassName,_=d===void 0?gn.gutterClassName:d,v=e.codeClassName,w=v===void 0?gn.codeClassName:v,C=e.gutterType,b=C===void 0?gn.gutterType:C,S=e.viewType,x=S===void 0?gn.viewType:S,y=e.gutterEvents,E=y===void 0?gn.gutterEvents:y,R=e.codeEvents,N=R===void 0?gn.codeEvents:R,D=e.generateAnchorID,T=D===void 0?gn.generateAnchorID:D,j=e.selectedChanges,B=j===void 0?gn.selectedChanges:j,F=e.widgets,Y=F===void 0?gn.widgets:F,H=e.renderGutter,z=H===void 0?gn.renderGutter:H,V=e.tokens,G=e.renderToken,X=e.children,K=X===void 0?_8:X,L=q.useRef(null),M=q.useCallback((function(ae){var Z=ae.target;if(ae.button===0){var P=(function(be,ke){for(var Ee=be;Ee&&Ee!==document.documentElement&&!Ee.classList.contains(ke);)Ee=Ee.parentElement;return Ee===document.documentElement?null:Ee})(Z,"diff-code");if(P&&P.parentElement){var ee=window.getSelection();ee&&ee.removeAllRanges();var ne=Rn(P.parentElement.children).indexOf(P);if(ne===1||ne===3){var ge,he=gm(L.current?L.current.querySelectorAll(".diff-line"):[]);try{for(he.s();!(ge=he.n()).done;){var ye=ge.value.children;fb(ye[1],ne===1),fb(ye[3],ne===3)}}catch(be){he.e(be)}finally{he.f()}}}}}),[]),O=b==="none",$=t==="add"||t==="delete",U=x==="split"&&!$&&r?M:m8,Q=q.useMemo((function(){return m.jsxs("colgroup",x==="unified"?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:$?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]})}),[x,$,O]),re=q.useMemo((function(){return{hunkClassName:u,lineClassName:c,generateLineClassName:p,gutterClassName:_,codeClassName:w,monotonous:$,hideGutter:O,viewType:x,gutterType:b,codeEvents:N,gutterEvents:E,generateAnchorID:T,selectedChanges:B,widgets:Y,renderGutter:z,tokens:V,renderToken:G}}),[w,N,T,_,E,b,O,u,c,p,$,z,G,B,V,x,Y]);return m.jsx(VL,{value:re,children:m.jsxs("table",{ref:L,className:Nn("diff","diff-".concat(x),a),onMouseDown:U,children:[Q,K(n)]})})}var y8=q.memo(v8),b8=function(e,t,n,r){for(var a=-1,l=e==null?0:e.length;++a<l;){var u=e[a];t(r,u,n(u),e)}return r},S8=function(e,t){return function(n,r){if(n==null)return n;if(!lh(n))return e(n,r);for(var a=n.length,l=-1,u=Object(n);++l<a&&r(u[l],l,u)!==!1;);return n}},cC=S8(iC),x8=function(e,t,n,r){return cC(e,(function(a,l,u){t(r,a,n(a),u)})),r},uC=function(e,t){return function(n,r){var a=Mn(n)?b8:x8,l=t?t():{};return a(n,e,fh(r),l)}},w8=uC((function(e,t,n){xm(e,n,t)})),db=hi?hi.isConcatSpreadable:void 0,C8=function(e){return Mn(e)||oh(e)||!!(db&&e&&e[db])},hC=function(t,n,r,a,l){var u=-1,o=t.length;for(r||(r=C8),l||(l=[]);++u<o;){var c=t[u];r(c)?Yw(l,c):l[l.length]=c}return l},E8=function(e,t){var n=-1,r=lh(e)?Array(e.length):[];return cC(e,(function(a,l,u){r[++n]=t(a,l,u)})),r},k8=function(e,t){return(Mn(e)?eC:E8)(e,fh(t))},wm=function(e,t){return hC(k8(e,t))};function A8(e,t){var n=t.newStart,r=t.changes.reduce((function(a,l){var u=Je(a,2),o=u[0],c=u[1];return Dn(l)?(o.splice(c,1),[o,c]):(Tr(l)&&o.splice(c,0,l.content),[o,c+1])}),[e,n-1]);return Je(r,1)[0]}function pb(e,t,n){if(!e.length)return[];var r=t==="old"?dh:ph,a=w8(e,r),l=r(e[e.length-1]);return Array.from({length:l}).map((function(u,o){return n(a[o+1])}))}function N8(e){var t=(function(u){return wm(u,(function(o){return o.changes})).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1];return $i(c)?(p.push(c),d.push(c)):Dn(c)?p.push(c):d.push(c),[p,d]}),[[],[]])})(e),n=Je(t,2),r=n[0],a=n[1],l=function(u){return u?u.content:""};return[pb(r,"old",l).join(` +`)})(e.trimStart());return qL.parse(n).map((function(r){return(function(a,l){var u=a.hunks.map((function(o){return VL(o,l)}));return lt(lt({},a),{},{hunks:u})})(r,t)}))}function WL(e){return e[0]}function XL(e){return e[e.length-1]}function Kp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Yo(e){return e==="old"?function(t){return Tr(t)?-1:Ui(t)?t.oldLineNumber:t.lineNumber}:function(t){return Dn(t)?-1:Ui(t)?t.newLineNumber:t.lineNumber}}function Iw(e,t){return function(n,r){var a=n[e],l=a+n[t];return r>=a&&r<l}}function KL(e,t){return function(n,r,a){var l=n[e]+n[t],u=r[e];return a>=l&&a<u}}function zw(e){var t=Yo(e),n=(function(r){var a=Je(Kp(r),2),l=Iw(a[0],a[1]);return function(u,o){return u.find((function(c){return l(c,o)}))}})(e);return function(r,a){var l=n(r,a);if(l)return l.changes.find((function(u){return t(u)===a}))}}function mm(e){var t=e==="old"?"new":"old",n=Je(Kp(e),2),r=n[0],a=n[1],l=Je(Kp(t),2),u=l[0],o=l[1],c=Yo(e),f=Yo(t),p=Iw(r,a),d=KL(r,a);return function(_,v){var w=WL(_);if(v<w[r]){var C=w[r]-v;return w[u]-C}var b=XL(_);if(b[r]+b[a]<=v){var S=v-b[r]-b[a];return b[u]+b[o]+S}for(var x=0;x<_.length;x++){var y=_[x],E=_[x+1];if(p(y,v)){var R=y.changes.findIndex((function(z){return c(z)===v})),N=y.changes[R];if(Ui(N))return f(N);var D=Dn(N)?R+1:R-1,T=y.changes[D];if(!T)return-1;var j=Tr(N)?"delete":"insert";return T.type===j?f(T):-1}if(d(y,E,v)){var B=v-y[r]-y[a];return y[u]+y[o]+B}}throw new Error("Unexpected line position ".concat(v))}}var ZL=function(e,t,n,r){for(var a=e.length,l=n+-1;++l<a;)if(t(e[l],l,e))return l;return-1},QL=function(){this.__data__=[],this.size=0},Hw=function(e,t){return e===t||e!=e&&t!=t},ih=function(e,t){for(var n=e.length;n--;)if(Hw(e[n][0],t))return n;return-1},JL=Array.prototype.splice,eO=function(e){var t=this.__data__,n=ih(t,e);return!(n<0)&&(n==t.length-1?t.pop():JL.call(t,n,1),--this.size,!0)},tO=function(e){var t=this.__data__,n=ih(t,e);return n<0?void 0:t[n][1]},nO=function(e){return ih(this.__data__,e)>-1},iO=function(e,t){var n=this.__data__,r=ih(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ia(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ia.prototype.clear=QL,ia.prototype.delete=eO,ia.prototype.get=tO,ia.prototype.has=nO,ia.prototype.set=iO;var rh=ia,rO=function(){this.__data__=new rh,this.size=0},sO=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},aO=function(e){return this.__data__.get(e)},oO=function(e){return this.__data__.has(e)},Fw=typeof qc=="object"&&qc&&qc.Object===Object&&qc,lO=typeof self=="object"&&self&&self.Object===Object&&self,qi=Fw||lO||Function("return this")(),hi=qi.Symbol,Pw=Object.prototype,cO=Pw.hasOwnProperty,uO=Pw.toString,No=hi?hi.toStringTag:void 0,hO=function(e){var t=cO.call(e,No),n=e[No];try{e[No]=void 0;var r=!0}catch{}var a=uO.call(e);return r&&(t?e[No]=n:delete e[No]),a},fO=Object.prototype.toString,dO=function(e){return fO.call(e)},X1=hi?hi.toStringTag:void 0,Ea=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":X1&&X1 in Object(e)?hO(e):dO(e)},Wo=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},Uw=function(e){if(!Wo(e))return!1;var t=Ea(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},cp=qi["__core-js_shared__"],K1=(function(){var e=/[^.]+$/.exec(cp&&cp.keys&&cp.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),pO=function(e){return!!K1&&K1 in e},gO=Function.prototype.toString,fs=function(e){if(e!=null){try{return gO.call(e)}catch{}try{return e+""}catch{}}return""},mO=/^\[object .+?Constructor\]$/,_O=Function.prototype,vO=Object.prototype,yO=_O.toString,bO=vO.hasOwnProperty,SO=RegExp("^"+yO.call(bO).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xO=function(e){return!(!Wo(e)||pO(e))&&(Uw(e)?SO:mO).test(fs(e))},wO=function(e,t){return e==null?void 0:e[t]},ds=function(e,t){var n=wO(e,t);return xO(n)?n:void 0},Xo=ds(qi,"Map"),Ko=ds(Object,"create"),CO=function(){this.__data__=Ko?Ko(null):{},this.size=0},EO=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kO=Object.prototype.hasOwnProperty,AO=function(e){var t=this.__data__;if(Ko){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return kO.call(t,e)?t[e]:void 0},NO=Object.prototype.hasOwnProperty,TO=function(e){var t=this.__data__;return Ko?t[e]!==void 0:NO.call(t,e)},RO=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ko&&t===void 0?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=CO,ra.prototype.delete=EO,ra.prototype.get=AO,ra.prototype.has=TO,ra.prototype.set=RO;var Z1=ra,DO=function(){this.size=0,this.__data__={hash:new Z1,map:new(Xo||rh),string:new Z1}},MO=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},sh=function(e,t){var n=e.__data__;return MO(t)?n[typeof t=="string"?"string":"hash"]:n.map},jO=function(e){var t=sh(this,e).delete(e);return this.size-=t?1:0,t},LO=function(e){return sh(this,e).get(e)},OO=function(e){return sh(this,e).has(e)},BO=function(e,t){var n=sh(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=DO,sa.prototype.delete=jO,sa.prototype.get=LO,sa.prototype.has=OO,sa.prototype.set=BO;var ah=sa,IO=function(e,t){var n=this.__data__;if(n instanceof rh){var r=n.__data__;if(!Xo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ah(r)}return n.set(e,t),this.size=n.size,this};function aa(e){var t=this.__data__=new rh(e);this.size=t.size}aa.prototype.clear=rO,aa.prototype.delete=sO,aa.prototype.get=aO,aa.prototype.has=oO,aa.prototype.set=IO;var fu=aa,zO=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},HO=function(e){return this.__data__.has(e)};function du(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ah;++t<n;)this.add(e[t])}du.prototype.add=du.prototype.push=zO,du.prototype.has=HO;var FO=du,PO=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},UO=function(e,t){return e.has(t)},$w=function(e,t,n,r,a,l){var u=1&n,o=e.length,c=t.length;if(o!=c&&!(u&&c>o))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,_=!0,v=2&n?new FO:void 0;for(l.set(e,t),l.set(t,e);++d<o;){var w=e[d],C=t[d];if(r)var b=u?r(C,w,d,t,e,l):r(w,C,d,e,t,l);if(b!==void 0){if(b)continue;_=!1;break}if(v){if(!PO(t,(function(S,x){if(!UO(v,x)&&(w===S||a(w,S,n,r,l)))return v.push(x)}))){_=!1;break}}else if(w!==C&&!a(w,C,n,r,l)){_=!1;break}}return l.delete(e),l.delete(t),_},Q1=qi.Uint8Array,$O=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r,a){n[++t]=[a,r]})),n},GO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r){n[++t]=r})),n},J1=hi?hi.prototype:void 0,up=J1?J1.valueOf:void 0,qO=function(e,t,n,r,a,l,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new Q1(e),new Q1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Hw(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=$O;case"[object Set]":var c=1&r;if(o||(o=GO),e.size!=t.size&&!c)return!1;var f=u.get(e);if(f)return f==t;r|=2,u.set(e,t);var p=$w(o(e),o(t),r,a,l,u);return u.delete(e),p;case"[object Symbol]":if(up)return up.call(e)==up.call(t)}return!1},Gw=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Mn=Array.isArray,VO=function(e,t,n){var r=t(e);return Mn(e)?r:Gw(r,n(e))},YO=function(e,t){for(var n=-1,r=e==null?0:e.length,a=0,l=[];++n<r;){var u=e[n];t(u,n,e)&&(l[a++]=u)}return l},WO=function(){return[]},XO=Object.prototype.propertyIsEnumerable,eb=Object.getOwnPropertySymbols,KO=eb?function(e){return e==null?[]:(e=Object(e),YO(eb(e),(function(t){return XO.call(e,t)})))}:WO,ZO=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},da=function(e){return e!=null&&typeof e=="object"},tb=function(e){return da(e)&&Ea(e)=="[object Arguments]"},qw=Object.prototype,QO=qw.hasOwnProperty,JO=qw.propertyIsEnumerable,oh=tb((function(){return arguments})())?tb:function(e){return da(e)&&QO.call(e,"callee")&&!JO.call(e,"callee")},e6=function(){return!1},Au=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?qi.Buffer:void 0,l=(a?a.isBuffer:void 0)||e6;e.exports=l})),t6=/^(?:0|[1-9]\d*)$/,Vw=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&t6.test(e))&&e>-1&&e%1==0&&e<t},_m=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},wt={};wt["[object Float32Array]"]=wt["[object Float64Array]"]=wt["[object Int8Array]"]=wt["[object Int16Array]"]=wt["[object Int32Array]"]=wt["[object Uint8Array]"]=wt["[object Uint8ClampedArray]"]=wt["[object Uint16Array]"]=wt["[object Uint32Array]"]=!0,wt["[object Arguments]"]=wt["[object Array]"]=wt["[object ArrayBuffer]"]=wt["[object Boolean]"]=wt["[object DataView]"]=wt["[object Date]"]=wt["[object Error]"]=wt["[object Function]"]=wt["[object Map]"]=wt["[object Number]"]=wt["[object Object]"]=wt["[object RegExp]"]=wt["[object Set]"]=wt["[object String]"]=wt["[object WeakMap]"]=!1;var n6=function(e){return da(e)&&_m(e.length)&&!!wt[Ea(e)]},i6=function(e){return function(t){return e(t)}},nb=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&Fw.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),ib=nb&&nb.isTypedArray,vm=ib?i6(ib):n6,r6=Object.prototype.hasOwnProperty,s6=function(e,t){var n=Mn(e),r=!n&&oh(e),a=!n&&!r&&Au(e),l=!n&&!r&&!a&&vm(e),u=n||r||a||l,o=u?ZO(e.length,String):[],c=o.length;for(var f in e)!r6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Vw(f,c))||o.push(f);return o},a6=Object.prototype,Yw=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||a6)},o6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),l6=Object.prototype.hasOwnProperty,Ww=function(e){if(!Yw(e))return o6(e);var t=[];for(var n in Object(e))l6.call(e,n)&&n!="constructor"&&t.push(n);return t},lh=function(e){return e!=null&&_m(e.length)&&!Uw(e)},ym=function(e){return lh(e)?s6(e):Ww(e)},rb=function(e){return VO(e,ym,KO)},c6=Object.prototype.hasOwnProperty,u6=function(e,t,n,r,a,l){var u=1&n,o=rb(e),c=o.length;if(c!=rb(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:c6.call(t,p)))return!1}var d=l.get(e),_=l.get(t);if(d&&_)return d==t&&_==e;var v=!0;l.set(e,t),l.set(t,e);for(var w=u;++f<c;){var C=e[p=o[f]],b=t[p];if(r)var S=u?r(b,C,p,t,e,l):r(C,b,p,e,t,l);if(!(S===void 0?C===b||a(C,b,n,r,l):S)){v=!1;break}w||(w=p=="constructor")}if(v&&!w){var x=e.constructor,y=t.constructor;x==y||!("constructor"in e)||!("constructor"in t)||typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y||(v=!1)}return l.delete(e),l.delete(t),v},Zp=ds(qi,"DataView"),Qp=ds(qi,"Promise"),Jp=ds(qi,"Set"),eg=ds(qi,"WeakMap"),h6=fs(Zp),f6=fs(Xo),d6=fs(Qp),p6=fs(Jp),g6=fs(eg),Kr=Ea;(Zp&&Kr(new Zp(new ArrayBuffer(1)))!="[object DataView]"||Xo&&Kr(new Xo)!="[object Map]"||Qp&&Kr(Qp.resolve())!="[object Promise]"||Jp&&Kr(new Jp)!="[object Set]"||eg&&Kr(new eg)!="[object WeakMap]")&&(Kr=function(e){var t=Ea(e),n=t=="[object Object]"?e.constructor:void 0,r=n?fs(n):"";if(r)switch(r){case h6:return"[object DataView]";case f6:return"[object Map]";case d6:return"[object Promise]";case p6:return"[object Set]";case g6:return"[object WeakMap]"}return t});var tg=Kr,Vc="[object Object]",sb=Object.prototype.hasOwnProperty,m6=function(e,t,n,r,a,l){var u=Mn(e),o=Mn(t),c=u?"[object Array]":tg(e),f=o?"[object Array]":tg(t),p=(c=c=="[object Arguments]"?Vc:c)==Vc,d=(f=f=="[object Arguments]"?Vc:f)==Vc,_=c==f;if(_&&Au(e)){if(!Au(t))return!1;u=!0,p=!1}if(_&&!p)return l||(l=new fu),u||vm(e)?$w(e,t,n,r,a,l):qO(e,t,c,n,r,a,l);if(!(1&n)){var v=p&&sb.call(e,"__wrapped__"),w=d&&sb.call(t,"__wrapped__");if(v||w){var C=v?e.value():e,b=w?t.value():t;return l||(l=new fu),a(C,b,n,r,l)}}return!!_&&(l||(l=new fu),u6(e,t,n,r,a,l))},ch=function e(t,n,r,a,l){return t===n||(t==null||n==null||!da(t)&&!da(n)?t!=t&&n!=n:m6(t,n,r,a,e,l))},_6=function(e,t,n,r){var a=n.length,l=a;if(e==null)return!l;for(e=Object(e);a--;){var u=n[a];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<l;){var o=(u=n[a])[0],c=e[o],f=u[1];if(u[2]){if(c===void 0&&!(o in e))return!1}else{var p=new fu,d;if(!(d===void 0?ch(f,c,3,r,p):d))return!1}}return!0},Xw=function(e){return e==e&&!Wo(e)},v6=function(e){for(var t=ym(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,Xw(a)]}return t},Kw=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},y6=function(e){var t=v6(e);return t.length==1&&t[0][2]?Kw(t[0][0],t[0][1]):function(n){return n===e||_6(n,e,t)}},uh=function(e){return typeof e=="symbol"||da(e)&&Ea(e)=="[object Symbol]"},b6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S6=/^\w*$/,bm=function(e,t){if(Mn(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!uh(e))||S6.test(e)||!b6.test(e)||t!=null&&e in Object(t)};function Sm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],l=n.cache;if(l.has(a))return l.get(a);var u=e.apply(this,r);return n.cache=l.set(a,u)||l,u};return n.cache=new(Sm.Cache||ah),n}Sm.Cache=ah;var x6=Sm,w6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C6=/\\(\\)?/g,E6=(function(e){var t=x6(e,(function(r){return n.size===500&&n.clear(),r})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(w6,(function(n,r,a,l){t.push(a?l.replace(C6,"$1"):r||n)})),t})),Zw=function(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},ab=hi?hi.prototype:void 0,ob=ab?ab.toString:void 0,k6=function e(t){if(typeof t=="string")return t;if(Mn(t))return Zw(t,e)+"";if(uh(t))return ob?ob.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},A6=function(e){return e==null?"":k6(e)},Qw=function(e,t){return Mn(e)?e:bm(e,t)?[e]:E6(A6(e))},hh=function(e){if(typeof e=="string"||uh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},Jw=function(e,t){for(var n=0,r=(t=Qw(t,e)).length;e!=null&&n<r;)e=e[hh(t[n++])];return n&&n==r?e:void 0},N6=function(e,t,n){var r=e==null?void 0:Jw(e,t);return r===void 0?n:r},T6=function(e,t){return e!=null&&t in Object(e)},R6=function(e,t,n){for(var r=-1,a=(t=Qw(t,e)).length,l=!1;++r<a;){var u=hh(t[r]);if(!(l=e!=null&&n(e,u)))break;e=e[u]}return l||++r!=a?l:!!(a=e==null?0:e.length)&&_m(a)&&Vw(u,a)&&(Mn(e)||oh(e))},D6=function(e,t){return e!=null&&R6(e,t,T6)},M6=function(e,t){return bm(e)&&Xw(t)?Kw(hh(e),t):function(n){var r=N6(n,e);return r===void 0&&r===t?D6(n,e):ch(t,r,3)}},j6=function(e){return e},L6=function(e){return function(t){return t==null?void 0:t[e]}},O6=function(e){return function(t){return Jw(t,e)}},B6=function(e){return bm(e)?L6(hh(e)):O6(e)},fh=function(e){return typeof e=="function"?e:e==null?j6:typeof e=="object"?Mn(e)?M6(e[0],e[1]):y6(e):B6(e)},I6=/\s/,z6=function(e){for(var t=e.length;t--&&I6.test(e.charAt(t)););return t},H6=/^\s+/,F6=function(e){return e&&e.slice(0,z6(e)+1).replace(H6,"")},P6=/^[-+]0x[0-9a-f]+$/i,U6=/^0b[01]+$/i,$6=/^0o[0-7]+$/i,G6=parseInt,q6=function(e){if(typeof e=="number")return e;if(uh(e))return NaN;if(Wo(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Wo(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=F6(e);var n=U6.test(e);return n||$6.test(e)?G6(e.slice(2),n?2:8):P6.test(e)?NaN:+e},V6=function(e){return e?(e=q6(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},Y6=function(e){var t=V6(e),n=t%1;return t==t?n?t-n:t:0};function kr(e){if(!e)throw new Error("change is not provided");if(Ui(e))return"N".concat(e.oldLineNumber);var t=Tr(e)?"I":"D";return"".concat(t).concat(e.lineNumber)}mm("old");var dh=Yo("old"),ph=Yo("new");zw("old");zw("new");mm("new");mm("old");var lb=(function(){try{var e=ds(Object,"defineProperty");return e({},"",{}),e}catch{}})(),xm=function(e,t,n){t=="__proto__"&&lb?lb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},W6=function(e){return function(t,n,r){for(var a=-1,l=Object(t),u=r(t),o=u.length;o--;){var c=u[++a];if(n(l[c],c,l)===!1)break}return t}},X6=W6(),eC=function(e,t){return e&&X6(e,t,ym)},tC=function(e,t){var n={};return t=fh(t),eC(e,(function(r,a,l){xm(n,a,t(r,a,l))})),n},K6=["changeKey","text","tokens","renderToken"],cb=function e(t,n){var r=t.type,a=t.value,l=t.markType,u=t.properties,o=t.className,c=t.children,f=function(d){return m.jsx("span",{className:d,children:a||c&&c.map(e)},n)};switch(r){case"text":return a;case"mark":return f("diff-code-mark diff-code-mark-".concat(l));case"edit":return f("diff-code-edit");default:var p=u&&u.className;return f(Nn(o||p))}};function Z6(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=Je(e,1)[0];return t.type==="text"&&!t.value}return!0}function Q6(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Ar(e,K6),u=a?function(o,c){return a(o,cb,c)}:cb;return m.jsx("td",lt(lt({},l),{},{"data-change-key":t,children:r?Z6(r)?" ":r.map(u):n||" "}))}var nC=V.memo(Q6);function iC(e,t){return function(){var n=t==="old"?dh(e):ph(e);return n===-1?void 0:n}}function rC(e,t){return function(n){return e&&n?m.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Nu(e,t){return t?function(n){e(),t(n)}:e}function ub(e,t,n,r){return V.useMemo((function(){var a=tC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=Nu(n,a.onMouseEnter),a.onMouseLeave=Nu(r,a.onMouseLeave),a}),[e,n,r,t])}function hb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:iC(t,r),wrapInAnchor:rC(a,l)};return m.jsx("td",lt(lt({className:e},u),{},{"data-change-key":n,children:c(f)}))}function J6(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.gutterAnchor,C=e.generateAnchorID,b=e.renderToken,S=e.renderGutter,x=a.type,y=a.content,E=kr(a),R=(t=Je(V.useState(!1),2),n=t[0],r=t[1],[n,V.useCallback((function(){return r(!0)}),[]),V.useCallback((function(){return r(!1)}),[])]),N=Je(R,3),D=N[0],T=N[1],j=N[2],B=V.useMemo((function(){return{change:a}}),[a]),z=ub(d,B,T,j),G=ub(_,B,T,j),U=C(a),H=c({changes:[a],defaultGenerate:function(){return o}}),Y=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),q=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return m.jsxs("tr",{id:U,className:Nn("diff-line",H),children:[!v&&hb(Y,a,E,"old",w,U,z,D,S),!v&&hb(Y,a,E,"new",w,U,z,D,S),m.jsx(nC,lt({className:q,changeKey:E,text:y,tokens:u,renderToken:b},G))]})}var e8=V.memo(J6);function t8(e){var t=e.hideGutter,n=e.element;return m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var n8=["hideGutter","selectedChanges","tokens","lineClassName"],i8=["hunk","widgets","className"];function r8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,i8),l=(function(u,o){return u.reduce((function(c,f){var p=kr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,3),p=f[0],d=f[1],_=f[2],v=c.hideGutter,w=c.selectedChanges,C=c.tokens,b=c.lineClassName,S=Ar(c,n8);if(p==="change"){var x=Dn(_)?"old":"new",y=Dn(_)?dh(_):ph(_),E=C?C[x][y-1]:null;return m.jsx(e8,lt({className:b,change:_,hideGutter:v,selected:w.includes(d),tokens:E},S),"change".concat(d))}return p==="widget"?m.jsx(t8,{hideGutter:v,element:_},"widget".concat(d)):null})(u,a)}))})}var sC=0;function Yc(e,t,n,r){var a=V.useCallback((function(){return t(e)}),[e,t]),l=V.useCallback((function(){return t("")}),[t]);return V.useMemo((function(){var u=tC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=Nu(a,u.onMouseEnter),u.onMouseLeave=Nu(l,u.onMouseLeave),u}),[n,r,a,e,l])}function hp(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,_=e.hideGutter,v=e.hover,w=e.renderToken,C=e.renderGutter;if(!t){var b=Nn("diff-gutter","diff-gutter-omit",l),S=Nn("diff-code","diff-code-omit",u);return[!_&&m.jsx("td",{className:b},"gutter"),m.jsx("td",{className:S},"code")]}var x=t.type,y=t.content,E=kr(t),R=n===sC?"old":"new",N=lt({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),Wp({"diff-gutter-selected":r},"diff-line-hover-"+R,v),l),children:C({change:t,side:R,inHoverState:v,renderDefault:iC(t,R),wrapInAnchor:rC(p,d)})},o),D=Nn("diff-code","diff-code-".concat(x),Wp({"diff-code-selected":r},"diff-line-hover-"+R,v),u);return[!_&&m.jsx("td",lt(lt({},N),{},{"data-change-key":E}),"gutter"),m.jsx(nC,lt({className:D,changeKey:E,text:y,tokens:a,renderToken:w},c),"code")]}function s8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.generateAnchorID,C=e.generateLineClassName,b=e.gutterAnchor,S=e.renderToken,x=e.renderGutter,y=Je(V.useState(""),2),E=y[0],R=y[1],N=Yc("old",R,n,d),D=Yc("new",R,r,d),T=Yc("old",R,n,_),j=Yc("new",R,r,_),B=n&&w(n),z=r&&w(r),G=C({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:c,hideGutter:v,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:_,renderToken:S,renderGutter:x},H=lt(lt({},U),{},{change:n,side:sC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:b,gutterAnchorTarget:B,hover:E==="old"}),Y=lt(lt({},U),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:D,codeEvents:j,anchorID:n===r?null:z,gutterAnchor:b,gutterAnchorTarget:n===r?B:z,hover:E==="new"});if(c)return m.jsx("tr",{className:Nn("diff-line",G),children:hp(n?H:Y)});var q=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return m.jsxs("tr",{className:Nn("diff-line",q,G),children:[hp(H),hp(Y)]})}var a8=V.memo(s8);function o8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):m.jsxs("tr",{className:"diff-widget",children:[m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var l8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],c8=["hunk","widgets","className"];function Wc(e,t){return(e?kr(e):"00")+(t?kr(t):"00")}function u8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,c8),l=(function(u,o){for(var c=function(S){if(!S)return null;var x=kr(S);return o[x]||null},f=[],p=0;p<u.length;p++){var d=u[p];if(Ui(d))f.push(["change",Wc(d,d),d,d]);else if(Dn(d)){var _=u[p+1];_&&Tr(_)?(p+=1,f.push(["change",Wc(d,_),d,_])):f.push(["change",Wc(d,null),d,null])}else f.push(["change",Wc(null,d),null,d]);var v=f[f.length-1],w=c(v[2]),C=c(v[3]);if(w||C){var b=v[1];f.push(["widget",b,w,C])}}return f})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,4),p=f[0],d=f[1],_=f[2],v=f[3],w=c.selectedChanges,C=c.monotonous,b=c.hideGutter,S=c.tokens,x=c.lineClassName,y=Ar(c,l8);if(p==="change"){var E=!!_&&w.includes(kr(_)),R=!!v&&w.includes(kr(v)),N=_&&S?S.old[dh(_)-1]:null,D=v&&S?S.new[ph(v)-1]:null;return m.jsx(a8,lt({className:x,oldChange:_,newChange:v,monotonous:C,hideGutter:b,oldSelected:E,newSelected:R,oldTokens:N,newTokens:D},y),"change".concat(d))}return p==="widget"?m.jsx(o8,{monotonous:C,hideGutter:b,oldElement:_,newElement:v},"widget".concat(d)):null})(u,a)}))})}var h8=["gutterType","hunkClassName"];function f8(e){var t=e.hunk,n=GL(),r=n.gutterType,a=n.hunkClassName,l=Ar(n,h8),u=r==="none",o=r==="anchor",c=l.viewType==="unified"?r8:u8;return m.jsx(c,lt(lt({},l),{},{hunk:t,hideGutter:u,gutterAnchor:o,className:a}))}function d8(){}function fb(e,t){var n=t?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function p8(e){return e.map((function(t){return m.jsx(f8,{hunk:t},(function(n){return"-".concat(n.oldStart,",").concat(n.oldLines," +").concat(n.newStart,",").concat(n.newLines)})(t))}))}function g8(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,a=e.className,l=e.hunkClassName,u=l===void 0?gn.hunkClassName:l,o=e.lineClassName,c=o===void 0?gn.lineClassName:o,f=e.generateLineClassName,p=f===void 0?gn.generateLineClassName:f,d=e.gutterClassName,_=d===void 0?gn.gutterClassName:d,v=e.codeClassName,w=v===void 0?gn.codeClassName:v,C=e.gutterType,b=C===void 0?gn.gutterType:C,S=e.viewType,x=S===void 0?gn.viewType:S,y=e.gutterEvents,E=y===void 0?gn.gutterEvents:y,R=e.codeEvents,N=R===void 0?gn.codeEvents:R,D=e.generateAnchorID,T=D===void 0?gn.generateAnchorID:D,j=e.selectedChanges,B=j===void 0?gn.selectedChanges:j,z=e.widgets,G=z===void 0?gn.widgets:z,U=e.renderGutter,H=U===void 0?gn.renderGutter:U,Y=e.tokens,q=e.renderToken,X=e.children,K=X===void 0?p8:X,L=V.useRef(null),M=V.useCallback((function(ae){var Z=ae.target;if(ae.button===0){var P=(function(be,ke){for(var Ee=be;Ee&&Ee!==document.documentElement&&!Ee.classList.contains(ke);)Ee=Ee.parentElement;return Ee===document.documentElement?null:Ee})(Z,"diff-code");if(P&&P.parentElement){var ee=window.getSelection();ee&&ee.removeAllRanges();var ne=Rn(P.parentElement.children).indexOf(P);if(ne===1||ne===3){var ge,he=gm(L.current?L.current.querySelectorAll(".diff-line"):[]);try{for(he.s();!(ge=he.n()).done;){var ye=ge.value.children;fb(ye[1],ne===1),fb(ye[3],ne===3)}}catch(be){he.e(be)}finally{he.f()}}}}}),[]),O=b==="none",$=t==="add"||t==="delete",F=x==="split"&&!$&&r?M:d8,Q=V.useMemo((function(){return m.jsxs("colgroup",x==="unified"?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:$?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]})}),[x,$,O]),re=V.useMemo((function(){return{hunkClassName:u,lineClassName:c,generateLineClassName:p,gutterClassName:_,codeClassName:w,monotonous:$,hideGutter:O,viewType:x,gutterType:b,codeEvents:N,gutterEvents:E,generateAnchorID:T,selectedChanges:B,widgets:G,renderGutter:H,tokens:Y,renderToken:q}}),[w,N,T,_,E,b,O,u,c,p,$,H,q,B,Y,x,G]);return m.jsx($L,{value:re,children:m.jsxs("table",{ref:L,className:Nn("diff","diff-".concat(x),a),onMouseDown:F,children:[Q,K(n)]})})}var m8=V.memo(g8),_8=function(e,t,n,r){for(var a=-1,l=e==null?0:e.length;++a<l;){var u=e[a];t(r,u,n(u),e)}return r},v8=function(e,t){return function(n,r){if(n==null)return n;if(!lh(n))return e(n,r);for(var a=n.length,l=-1,u=Object(n);++l<a&&r(u[l],l,u)!==!1;);return n}},aC=v8(eC),y8=function(e,t,n,r){return aC(e,(function(a,l,u){t(r,a,n(a),u)})),r},oC=function(e,t){return function(n,r){var a=Mn(n)?_8:y8,l=t?t():{};return a(n,e,fh(r),l)}},b8=oC((function(e,t,n){xm(e,n,t)})),db=hi?hi.isConcatSpreadable:void 0,S8=function(e){return Mn(e)||oh(e)||!!(db&&e&&e[db])},lC=function(t,n,r,a,l){var u=-1,o=t.length;for(r||(r=S8),l||(l=[]);++u<o;){var c=t[u];r(c)?Gw(l,c):l[l.length]=c}return l},x8=function(e,t){var n=-1,r=lh(e)?Array(e.length):[];return aC(e,(function(a,l,u){r[++n]=t(a,l,u)})),r},w8=function(e,t){return(Mn(e)?Zw:x8)(e,fh(t))},wm=function(e,t){return lC(w8(e,t))};function C8(e,t){var n=t.newStart,r=t.changes.reduce((function(a,l){var u=Je(a,2),o=u[0],c=u[1];return Dn(l)?(o.splice(c,1),[o,c]):(Tr(l)&&o.splice(c,0,l.content),[o,c+1])}),[e,n-1]);return Je(r,1)[0]}function pb(e,t,n){if(!e.length)return[];var r=t==="old"?dh:ph,a=b8(e,r),l=r(e[e.length-1]);return Array.from({length:l}).map((function(u,o){return n(a[o+1])}))}function E8(e){var t=(function(u){return wm(u,(function(o){return o.changes})).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1];return Ui(c)?(p.push(c),d.push(c)):Dn(c)?p.push(c):d.push(c),[p,d]}),[[],[]])})(e),n=Je(t,2),r=n[0],a=n[1],l=function(u){return u?u.content:""};return[pb(r,"old",l).join(` `),pb(a,"new",l).join(` -`)]}function Xc(e){return{type:"root",children:e}}function T8(e,t){if(t.oldSource){var n=(function(c,f){return f.reduce(A8,c.split(` +`)]}function Xc(e){return{type:"root",children:e}}function k8(e,t){if(t.oldSource){var n=(function(c,f){return f.reduce(C8,c.split(` `)).join(` -`)})(t.oldSource,e),r=t.highlight?function(c){return t.refractor.highlight(c,t.language)}:function(c){return[{type:"text",value:c}]};return[Xc(r(t.oldSource)),Xc(r(n))]}var a=Je(N8(e),2),l=a[0],u=a[1],o=t.highlight?function(c){return Xc(t.refractor.highlight(c,t.language))}:function(c){return Xc([{type:"text",value:c}])};return[o(l),o(u)]}function oa(e){return e.map((function(t){return lt({},t)}))}function R8(e,t){return[].concat(Rn(oa(e.slice(0,-1))),[t])}function D8(e){return e.type==="text"}function Cm(e){var t=e[e.length-1];if(D8(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function M8(e,t,n,r){var a=e.slice(0,-1),l=Cm(e),u=[];if(n<=0||t>=(l==null?void 0:l.value.length))return[e];var o=function(d,_){var v=l.value.slice(d,_);return[].concat(Rn(a),[lt(lt({},l),{},{value:v})])};if(t>0){var c=o(0,t);u.push(oa(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,_){return[_].concat(Rn(oa(d)))})(f,r):oa(f)),n<l.value.length){var p=o(n);u.push(oa(p))}return u}var j8=["children"];function fC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Ar(e,j8);n.push(a);var l,u=gm(r);try{for(u.s();!(l=u.n()).done;)fC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(oa([].concat(Rn(n.slice(1)),[e])));return t}function L8(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Cm(c);return f.value.includes(` +`)})(t.oldSource,e),r=t.highlight?function(c){return t.refractor.highlight(c,t.language)}:function(c){return[{type:"text",value:c}]};return[Xc(r(t.oldSource)),Xc(r(n))]}var a=Je(E8(e),2),l=a[0],u=a[1],o=t.highlight?function(c){return Xc(t.refractor.highlight(c,t.language))}:function(c){return Xc([{type:"text",value:c}])};return[o(l),o(u)]}function oa(e){return e.map((function(t){return lt({},t)}))}function A8(e,t){return[].concat(Rn(oa(e.slice(0,-1))),[t])}function N8(e){return e.type==="text"}function Cm(e){var t=e[e.length-1];if(N8(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function T8(e,t,n,r){var a=e.slice(0,-1),l=Cm(e),u=[];if(n<=0||t>=(l==null?void 0:l.value.length))return[e];var o=function(d,_){var v=l.value.slice(d,_);return[].concat(Rn(a),[lt(lt({},l),{},{value:v})])};if(t>0){var c=o(0,t);u.push(oa(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,_){return[_].concat(Rn(oa(d)))})(f,r):oa(f)),n<l.value.length){var p=o(n);u.push(oa(p))}return u}var R8=["children"];function cC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Ar(e,R8);n.push(a);var l,u=gm(r);try{for(u.s();!(l=u.n()).done;)cC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(oa([].concat(Rn(n.slice(1)),[e])));return t}function D8(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Cm(c);return f.value.includes(` `)?f.value.split(` -`).map((function(p){return R8(c,lt(lt({},f),{},{value:p}))})):[c]})(n),l=Ow(a),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(r),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function gb(e){return L8(fC(e))}var O8=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?ch(e,t,void 0,n):!!r},B8=function(e,t){return ch(e,t)},I8=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function z8(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,a=I8(e.children);return a&&(r=t,(n=a).type===r.type&&(n.type==="text"||n.children&&r.children&&O8(n,r,(function(l,u,o){return o==="chlidren"||B8(l,u)}))))?e.children[e.children.length-1]=(function(l,u){return"value"in l&&"value"in u?lt(lt({},l),{},{value:"".concat(l.value).concat(u.value)}):l})(a,t):e.children.push(t),e.children[e.children.length-1]}function mb(e){var t,n={type:"root",children:[]},r=gm(e);try{var a=function(){var l=t.value;l.reduce((function(u,o,c){return z8(u,c===l.length-1?lt({},o):lt(lt({},o),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)a()}catch(l){r.e(l)}finally{r.f()}return n}var H8=Object.prototype.hasOwnProperty,F8=uC((function(e,t,n){H8.call(e,n)?e[n].push(t):xm(e,n,[t])})),P8=Object.prototype.hasOwnProperty,U8=function(e){if(e==null)return!0;if(lh(e)&&(Mn(e)||typeof e=="string"||typeof e.splice=="function"||Au(e)||vm(e)||oh(e)))return!e.length;var t=tg(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(Kw(e))return!Zw(e).length;for(var n in e)if(P8.call(e,n))return!1;return!0},$8=function(e,t){var n=t.start,r=t.length,a=n+r,l=e.reduce((function(u,o){var c=Je(u,2),f=c[0],p=c[1],d=p+Cm(o).value.length;if(p>a||d<n)f.push(o);else{var _=M8(o,n-p,a-p,t);f.push.apply(f,Rn(_))}return[f,d]}),[[],0]);return Je(l,1)[0]};function _b(e,t){var n=F8(t,"lineNumber");return e.map((function(r,a){return(function(l,u){return U8(u)?l:u.reduce($8,l)})(r,n[a+1])}))}function G8(e,t){return function(n){var r=Je(n,2),a=r[0],l=r[1];return[_b(a,e),_b(l,t)]}}var vb=function(e){return e!=null&&e.length?hC(e):[]},q8=Math.max,yb=function(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:K6(n);return a<0&&(a=q8(r+a,0)),eO(e,fh(t),a)},gh=fl((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(n,r){return[n,r]},t.prototype.diff_main=function(n,r,a,l){l===void 0&&(l=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=l;if(n==null||r==null)throw new Error("Null input. (diff_main)");if(n==r)return n?[new t.Diff(0,n)]:[];a===void 0&&(a=!0);var o=a,c=this.diff_commonPrefix(n,r),f=n.substring(0,c);n=n.substring(c),r=r.substring(c),c=this.diff_commonSuffix(n,r);var p=n.substring(n.length-c);n=n.substring(0,n.length-c),r=r.substring(0,r.length-c);var d=this.diff_compute_(n,r,o,u);return f&&d.unshift(new t.Diff(0,f)),p&&d.push(new t.Diff(0,p)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(n,r,a,l){var u;if(!n)return[new t.Diff(1,r)];if(!r)return[new t.Diff(-1,n)];var o=n.length>r.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],_=p[1],v=p[2],w=p[3],C=p[4],b=this.diff_main(d,v,a,l),S=this.diff_main(_,w,a,l);return b.concat([new t.Diff(0,C)],S)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",_="";c<o.length;){switch(o[c][0]){case 1:p++,_+=o[c][1];break;case-1:f++,d+=o[c][1];break;case 0:if(f>=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var v=this.diff_main(d,_,!1,a),w=v.length-1;w>=0;w--)o.splice(c,0,v[w]);c+=v.length}p=0,f=0,d="",_=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),_=0;_<f;_++)p[_]=-1,d[_]=-1;p[c+1]=0,d[c+1]=0;for(var v=l-u,w=v%2!=0,C=0,b=0,S=0,x=0,y=0;y<o&&!(new Date().getTime()>a);y++){for(var E=-y+C;E<=y-b;E+=2){for(var R=c+E,N=(F=E==-y||E!=y&&p[R-1]<p[R+1]?p[R+1]:p[R-1]+1)-E;F<l&&N<u&&n.charAt(F)==r.charAt(N);)F++,N++;if(p[R]=F,F>l)b+=2;else if(N>u)C+=2;else if(w&&(j=c+v-E)>=0&&j<f&&d[j]!=-1&&F>=(T=l-d[j]))return this.diff_bisectSplit_(n,r,F,N,a)}for(var D=-y+S;D<=y-x;D+=2){for(var T,j=c+D,B=(T=D==-y||D!=y&&d[j-1]<d[j+1]?d[j+1]:d[j-1]+1)-D;T<l&&B<u&&n.charAt(l-T-1)==r.charAt(u-B-1);)T++,B++;if(d[j]=T,T>l)x+=2;else if(B>u)S+=2;else if(!w&&(R=c+v-D)>=0&&R<f&&p[R]!=-1){var F;if(N=c+(F=p[R])-R,F>=(T=l-T))return this.diff_bisectSplit_(n,r,F,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),_=this.diff_main(f,p,!1,u);return d.concat(_)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,_=-1,v=a.length;_<f.length-1;){(_=f.indexOf(` +`).map((function(p){return A8(c,lt(lt({},f),{},{value:p}))})):[c]})(n),l=Mw(a),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(r),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function gb(e){return D8(cC(e))}var M8=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?ch(e,t,void 0,n):!!r},j8=function(e,t){return ch(e,t)},L8=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function O8(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,a=L8(e.children);return a&&(r=t,(n=a).type===r.type&&(n.type==="text"||n.children&&r.children&&M8(n,r,(function(l,u,o){return o==="chlidren"||j8(l,u)}))))?e.children[e.children.length-1]=(function(l,u){return"value"in l&&"value"in u?lt(lt({},l),{},{value:"".concat(l.value).concat(u.value)}):l})(a,t):e.children.push(t),e.children[e.children.length-1]}function mb(e){var t,n={type:"root",children:[]},r=gm(e);try{var a=function(){var l=t.value;l.reduce((function(u,o,c){return O8(u,c===l.length-1?lt({},o):lt(lt({},o),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)a()}catch(l){r.e(l)}finally{r.f()}return n}var B8=Object.prototype.hasOwnProperty,I8=oC((function(e,t,n){B8.call(e,n)?e[n].push(t):xm(e,n,[t])})),z8=Object.prototype.hasOwnProperty,H8=function(e){if(e==null)return!0;if(lh(e)&&(Mn(e)||typeof e=="string"||typeof e.splice=="function"||Au(e)||vm(e)||oh(e)))return!e.length;var t=tg(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(Yw(e))return!Ww(e).length;for(var n in e)if(z8.call(e,n))return!1;return!0},F8=function(e,t){var n=t.start,r=t.length,a=n+r,l=e.reduce((function(u,o){var c=Je(u,2),f=c[0],p=c[1],d=p+Cm(o).value.length;if(p>a||d<n)f.push(o);else{var _=T8(o,n-p,a-p,t);f.push.apply(f,Rn(_))}return[f,d]}),[[],0]);return Je(l,1)[0]};function _b(e,t){var n=I8(t,"lineNumber");return e.map((function(r,a){return(function(l,u){return H8(u)?l:u.reduce(F8,l)})(r,n[a+1])}))}function P8(e,t){return function(n){var r=Je(n,2),a=r[0],l=r[1];return[_b(a,e),_b(l,t)]}}var vb=function(e){return e!=null&&e.length?lC(e):[]},U8=Math.max,yb=function(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Y6(n);return a<0&&(a=U8(r+a,0)),ZL(e,fh(t),a)},gh=fl((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(n,r){return[n,r]},t.prototype.diff_main=function(n,r,a,l){l===void 0&&(l=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=l;if(n==null||r==null)throw new Error("Null input. (diff_main)");if(n==r)return n?[new t.Diff(0,n)]:[];a===void 0&&(a=!0);var o=a,c=this.diff_commonPrefix(n,r),f=n.substring(0,c);n=n.substring(c),r=r.substring(c),c=this.diff_commonSuffix(n,r);var p=n.substring(n.length-c);n=n.substring(0,n.length-c),r=r.substring(0,r.length-c);var d=this.diff_compute_(n,r,o,u);return f&&d.unshift(new t.Diff(0,f)),p&&d.push(new t.Diff(0,p)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(n,r,a,l){var u;if(!n)return[new t.Diff(1,r)];if(!r)return[new t.Diff(-1,n)];var o=n.length>r.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],_=p[1],v=p[2],w=p[3],C=p[4],b=this.diff_main(d,v,a,l),S=this.diff_main(_,w,a,l);return b.concat([new t.Diff(0,C)],S)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",_="";c<o.length;){switch(o[c][0]){case 1:p++,_+=o[c][1];break;case-1:f++,d+=o[c][1];break;case 0:if(f>=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var v=this.diff_main(d,_,!1,a),w=v.length-1;w>=0;w--)o.splice(c,0,v[w]);c+=v.length}p=0,f=0,d="",_=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),_=0;_<f;_++)p[_]=-1,d[_]=-1;p[c+1]=0,d[c+1]=0;for(var v=l-u,w=v%2!=0,C=0,b=0,S=0,x=0,y=0;y<o&&!(new Date().getTime()>a);y++){for(var E=-y+C;E<=y-b;E+=2){for(var R=c+E,N=(z=E==-y||E!=y&&p[R-1]<p[R+1]?p[R+1]:p[R-1]+1)-E;z<l&&N<u&&n.charAt(z)==r.charAt(N);)z++,N++;if(p[R]=z,z>l)b+=2;else if(N>u)C+=2;else if(w&&(j=c+v-E)>=0&&j<f&&d[j]!=-1&&z>=(T=l-d[j]))return this.diff_bisectSplit_(n,r,z,N,a)}for(var D=-y+S;D<=y-x;D+=2){for(var T,j=c+D,B=(T=D==-y||D!=y&&d[j-1]<d[j+1]?d[j+1]:d[j-1]+1)-D;T<l&&B<u&&n.charAt(l-T-1)==r.charAt(u-B-1);)T++,B++;if(d[j]=T,T>l)x+=2;else if(B>u)S+=2;else if(!w&&(R=c+v-D)>=0&&R<f&&p[R]!=-1){var z;if(N=c+(z=p[R])-R,z>=(T=l-T))return this.diff_bisectSplit_(n,r,z,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),_=this.diff_main(f,p,!1,u);return d.concat(_)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,_=-1,v=a.length;_<f.length-1;){(_=f.indexOf(` `,d))==-1&&(_=f.length-1);var w=f.substring(d,_+1);(l.hasOwnProperty?l.hasOwnProperty(w):l[w]!==void 0)?p+=String.fromCharCode(l[w]):(v==o&&(w=f.substring(d),_=f.length),p+=String.fromCharCode(v),l[w]=v,a[v++]=w),d=_+1}return p}a[0]="";var o=4e4,c=u(n);return o=65535,{chars1:c,chars2:u(r),lineArray:a}},t.prototype.diff_charsToLines_=function(n,r){for(var a=0;a<n.length;a++){for(var l=n[a][1],u=[],o=0;o<l.length;o++)u[o]=r[l.charCodeAt(o)];n[a][1]=u.join("")}},t.prototype.diff_commonPrefix=function(n,r){if(!n||!r||n.charAt(0)!=r.charAt(0))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(o,u)==r.substring(o,u)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonSuffix=function(n,r){if(!n||!r||n.charAt(n.length-1)!=r.charAt(r.length-1))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(n.length-u,n.length-o)==r.substring(r.length-u,r.length-o)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonOverlap_=function(n,r){var a=n.length,l=r.length;if(a==0||l==0)return 0;a>l?n=n.substring(a-l):a<l&&(r=r.substring(0,a));var u=Math.min(a,l);if(n==r)return u;for(var o=0,c=1;;){var f=n.substring(u-c),p=r.indexOf(f);if(p==-1)return o;c+=p,p!=0&&n.substring(u-c)!=r.substring(0,c)||(o=c,c++)}},t.prototype.diff_halfMatch_=function(n,r){if(this.Diff_Timeout<=0)return null;var a=n.length>r.length?n:r,l=n.length>r.length?r:n;if(a.length<4||2*l.length<a.length)return null;var u=this;function o(C,b,S){for(var x,y,E,R,N=C.substring(S,S+Math.floor(C.length/4)),D=-1,T="";(D=b.indexOf(N,D+1))!=-1;){var j=u.diff_commonPrefix(C.substring(S),b.substring(D)),B=u.diff_commonSuffix(C.substring(0,S),b.substring(0,D));T.length<B+j&&(T=b.substring(D-B,D)+b.substring(D,D+j),x=C.substring(0,S-B),y=C.substring(S+j),E=b.substring(0,D-B),R=b.substring(D+j))}return 2*T.length>=C.length?[x,y,E,R,T]:null}var c,f,p,d,_,v=o(a,l,Math.ceil(a.length/4)),w=o(a,l,Math.ceil(a.length/2));return v||w?(c=w?v&&v[4].length>w[4].length?v:w:v,n.length>r.length?(f=c[0],p=c[1],d=c[2],_=c[3]):(d=c[0],_=c[1],f=c[2],p=c[3]),[f,p,d,_,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=0,f=0,p=0,d=0;o<n.length;)n[o][0]==0?(a[l++]=o,c=p,f=d,p=0,d=0,u=n[o][1]):(n[o][0]==1?p+=n[o][1].length:d+=n[o][1].length,u&&u.length<=Math.max(c,f)&&u.length<=Math.max(p,d)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,o=--l>0?a[l-1]:-1,c=0,f=0,p=0,d=0,u=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o<n.length;){if(n[o-1][0]==-1&&n[o][0]==1){var _=n[o-1][1],v=n[o][1],w=this.diff_commonOverlap_(_,v),C=this.diff_commonOverlap_(v,_);w>=C?(w>=_.length/2||w>=v.length/2)&&(n.splice(o,0,new t.Diff(0,v.substring(0,w))),n[o-1][1]=_.substring(0,_.length-w),n[o+1][1]=v.substring(w),o++):(C>=_.length/2||C>=v.length/2)&&(n.splice(o,0,new t.Diff(0,_.substring(0,C))),n[o-1][0]=1,n[o-1][1]=v.substring(0,v.length-C),n[o+1][0]=-1,n[o+1][1]=_.substring(C),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(C,b){if(!C||!b)return 6;var S=C.charAt(C.length-1),x=b.charAt(0),y=S.match(t.nonAlphaNumericRegex_),E=x.match(t.nonAlphaNumericRegex_),R=y&&S.match(t.whitespaceRegex_),N=E&&x.match(t.whitespaceRegex_),D=R&&S.match(t.linebreakRegex_),T=N&&x.match(t.linebreakRegex_),j=D&&C.match(t.blanklineEndRegex_),B=T&&b.match(t.blanklineStartRegex_);return j||B?5:D||T?4:y&&!R&&N?3:R||N?2:y||E?1:0}for(var a=1;a<n.length-1;){if(n[a-1][0]==0&&n[a+1][0]==0){var l=n[a-1][1],u=n[a][1],o=n[a+1][1],c=this.diff_commonSuffix(l,u);if(c){var f=u.substring(u.length-c);l=l.substring(0,l.length-c),u=f+u.substring(0,u.length-c),o=f+o}for(var p=l,d=u,_=o,v=r(l,u)+r(u,o);u.charAt(0)===o.charAt(0);){l+=u.charAt(0),u=u.substring(1)+o.charAt(0),o=o.substring(1);var w=r(l,u)+r(u,o);w>=v&&(v=w,p=l,d=u,_=o)}n[a-1][1]!=p&&(p?n[a-1][1]=p:(n.splice(a-1,1),a--),n[a][1]=d,_?n[a+1][1]=_:(n.splice(a+1,1),a--))}a++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=!1,f=!1,p=!1,d=!1;o<n.length;)n[o][0]==0?(n[o][1].length<this.Diff_EditCost&&(p||d)?(a[l++]=o,c=p,f=d,u=n[o][1]):(l=0,u=null),p=d=!1):(n[o][0]==-1?d=!0:p=!0,u&&(c&&f&&p&&d||u.length<this.Diff_EditCost/2&&c+f+p+d==3)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,u=null,c&&f?(p=d=!0,l=0):(o=--l>0?a[l-1]:-1,p=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,a=0,l=0,u=0,o="",c="";a<n.length;)switch(n[a][0]){case 1:u++,c+=n[a][1],a++;break;case-1:l++,o+=n[a][1],a++;break;case 0:l+u>1?(l!==0&&u!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(a-l-u>0&&n[a-l-u-1][0]==0?n[a-l-u-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),a++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-r)+n[a][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),a-=l+u,n.splice(a,l+u),o.length&&(n.splice(a,0,new t.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new t.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,u=0,l=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var f=!1;for(a=1;a<n.length-1;)n[a-1][0]==0&&n[a+1][0]==0&&(n[a][1].substring(n[a][1].length-n[a-1][1].length)==n[a-1][1]?(n[a][1]=n[a-1][1]+n[a][1].substring(0,n[a][1].length-n[a-1][1].length),n[a+1][1]=n[a-1][1]+n[a+1][1],n.splice(a-1,1),f=!0):n[a][1].substring(0,n[a+1][1].length)==n[a+1][1]&&(n[a-1][1]+=n[a+1][1],n[a][1]=n[a][1].substring(n[a+1][1].length)+n[a+1][1],n.splice(a+1,1),f=!0)),a++;f&&this.diff_cleanupMerge(n)},t.prototype.diff_xIndex=function(n,r){var a,l=0,u=0,o=0,c=0;for(a=0;a<n.length&&(n[a][0]!==1&&(l+=n[a][1].length),n[a][0]!==-1&&(u+=n[a][1].length),!(l>r));a++)o=l,c=u;return n.length!=a&&n[a][0]===-1?c:c+(r-o)},t.prototype.diff_prettyHtml=function(n){for(var r=[],a=/&/g,l=/</g,u=/>/g,o=/\n/g,c=0;c<n.length;c++){var f=n[c][0],p=n[c][1].replace(a,"&").replace(l,"<").replace(u,">").replace(o,"¶<br>");switch(f){case 1:r[c]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case-1:r[c]='<del style="background:#ffe6e6;">'+p+"</del>";break;case 0:r[c]="<span>"+p+"</span>"}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_text2=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==-1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_levenshtein=function(n){for(var r=0,a=0,l=0,u=0;u<n.length;u++){var o=n[u][0],c=n[u][1];switch(o){case 1:a+=c.length;break;case-1:l+=c.length;break;case 0:r+=Math.max(a,l),a=0,l=0}}return r+=Math.max(a,l)},t.prototype.diff_toDelta=function(n){for(var r=[],a=0;a<n.length;a++)switch(n[a][0]){case 1:r[a]="+"+encodeURI(n[a][1]);break;case-1:r[a]="-"+n[a][1].length;break;case 0:r[a]="="+n[a][1].length}return r.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(n,r){for(var a=[],l=0,u=0,o=r.split(/\t/g),c=0;c<o.length;c++){var f=o[c].substring(1);switch(o[c].charAt(0)){case"+":try{a[l++]=new t.Diff(1,decodeURI(f))}catch{throw new Error("Illegal escape in diff_fromDelta: "+f)}break;case"-":case"=":var p=parseInt(f,10);if(isNaN(p)||p<0)throw new Error("Invalid number in diff_fromDelta: "+f);var d=n.substring(u,u+=p);o[c].charAt(0)=="="?a[l++]=new t.Diff(0,d):a[l++]=new t.Diff(-1,d);break;default:if(o[c])throw new Error("Invalid diff operation in diff_fromDelta: "+o[c])}}if(u!=n.length)throw new Error("Delta length ("+u+") does not equal source text length ("+n.length+").");return a},t.prototype.match_main=function(n,r,a){if(n==null||r==null||a==null)throw new Error("Null input. (match_main)");return a=Math.max(0,Math.min(a,n.length)),n==r?0:n.length?n.substring(a,a+r.length)==r?a:this.match_bitap_(n,r,a):-1},t.prototype.match_bitap_=function(n,r,a){if(r.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(r),u=this;function o(N,D){var T=N/r.length,j=Math.abs(a-D);return u.Match_Distance?T+j/u.Match_Distance:j?1:T}var c=this.Match_Threshold,f=n.indexOf(r,a);f!=-1&&(c=Math.min(o(0,f),c),(f=n.lastIndexOf(r,a+r.length))!=-1&&(c=Math.min(o(0,f),c)));var p,d,_=1<<r.length-1;f=-1;for(var v,w=r.length+n.length,C=0;C<r.length;C++){for(p=0,d=w;p<d;)o(C,a+d)<=c?p=d:w=d,d=Math.floor((w-p)/2+p);w=d;var b=Math.max(1,a-d+1),S=Math.min(a+d,n.length)+r.length,x=Array(S+2);x[S+1]=(1<<C)-1;for(var y=S;y>=b;y--){var E=l[n.charAt(y-1)];if(x[y]=C===0?(x[y+1]<<1|1)&E:(x[y+1]<<1|1)&E|(v[y+1]|v[y])<<1|1|v[y+1],x[y]&_){var R=o(C,y-1);if(R<=c){if(c=R,!((f=y-1)>a))break;b=Math.max(1,2*a-f)}}}if(o(C+1,a)>c)break;v=x}return f},t.prototype.match_alphabet_=function(n){for(var r={},a=0;a<n.length;a++)r[n.charAt(a)]=0;for(a=0;a<n.length;a++)r[n.charAt(a)]|=1<<n.length-a-1;return r},t.prototype.patch_addContext_=function(n,r){if(r.length!=0){if(n.start2===null)throw Error("patch not initialized");for(var a=r.substring(n.start2,n.start2+n.length1),l=0;r.indexOf(a)!=r.lastIndexOf(a)&&a.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)l+=this.Patch_Margin,a=r.substring(n.start2-l,n.start2+n.length1+l);l+=this.Patch_Margin;var u=r.substring(n.start2-l,n.start2);u&&n.diffs.unshift(new t.Diff(0,u));var o=r.substring(n.start2+n.length1,n.start2+n.length1+l);o&&n.diffs.push(new t.Diff(0,o)),n.start1-=u.length,n.start2-=u.length,n.length1+=u.length+o.length,n.length2+=u.length+o.length}},t.prototype.patch_make=function(n,r,a){var l,u;if(typeof n=="string"&&typeof r=="string"&&a===void 0)l=n,(u=this.diff_main(l,r,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(n&&typeof n=="object"&&r===void 0&&a===void 0)u=n,l=this.diff_text1(u);else if(typeof n=="string"&&r&&typeof r=="object"&&a===void 0)l=n,u=r;else{if(typeof n!="string"||typeof r!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");l=n,u=a}if(u.length===0)return[];for(var o=[],c=new t.patch_obj,f=0,p=0,d=0,_=l,v=l,w=0;w<u.length;w++){var C=u[w][0],b=u[w][1];switch(f||C===0||(c.start1=p,c.start2=d),C){case 1:c.diffs[f++]=u[w],c.length2+=b.length,v=v.substring(0,d)+b+v.substring(d);break;case-1:c.length1+=b.length,c.diffs[f++]=u[w],v=v.substring(0,d)+v.substring(d+b.length);break;case 0:b.length<=2*this.Patch_Margin&&f&&u.length!=w+1?(c.diffs[f++]=u[w],c.length1+=b.length,c.length2+=b.length):b.length>=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,_),o.push(c),c=new t.patch_obj,f=0,_=v,p=d)}C!==1&&(p+=b.length),C!==-1&&(d+=b.length)}return f&&(this.patch_addContext_(c,_),o.push(c)),o},t.prototype.patch_deepCopy=function(n){for(var r=[],a=0;a<n.length;a++){var l=n[a],u=new t.patch_obj;u.diffs=[];for(var o=0;o<l.diffs.length;o++)u.diffs[o]=new t.Diff(l.diffs[o][0],l.diffs[o][1]);u.start1=l.start1,u.start2=l.start2,u.length1=l.length1,u.length2=l.length2,r[a]=u}return r},t.prototype.patch_apply=function(n,r){if(n.length==0)return[r,[]];n=this.patch_deepCopy(n);var a=this.patch_addPadding(n);r=a+r+a,this.patch_splitMax(n);for(var l=0,u=[],o=0;o<n.length;o++){var c,f,p=n[o].start2+l,d=this.diff_text1(n[o].diffs),_=-1;if(d.length>this.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),p))!=-1&&((_=this.match_main(r,d.substring(d.length-this.Match_MaxBits),p+d.length-this.Match_MaxBits))==-1||c>=_)&&(c=-1):c=this.match_main(r,d,p),c==-1)u[o]=!1,l-=n[o].length2-n[o].length1;else if(u[o]=!0,l=c-p,d==(f=_==-1?r.substring(c,c+d.length):r.substring(c,_+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[o].diffs)+r.substring(c+d.length);else{var v=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(v)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(v);for(var w,C=0,b=0;b<n[o].diffs.length;b++){var S=n[o].diffs[b];S[0]!==0&&(w=this.diff_xIndex(v,C)),S[0]===1?r=r.substring(0,c+w)+S[1]+r.substring(c+w):S[0]===-1&&(r=r.substring(0,c+w)+r.substring(c+this.diff_xIndex(v,C+S[1].length))),S[0]!==-1&&(C+=S[1].length)}}}}return[r=r.substring(a.length,r.length-a.length),u]},t.prototype.patch_addPadding=function(n){for(var r=this.Patch_Margin,a="",l=1;l<=r;l++)a+=String.fromCharCode(l);for(l=0;l<n.length;l++)n[l].start1+=r,n[l].start2+=r;var u=n[0],o=u.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,a)),u.start1-=r,u.start2-=r,u.length1+=r,u.length2+=r;else if(r>o[0][1].length){var c=r-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],u.start1-=c,u.start2-=c,u.length1+=c,u.length2+=c}return(o=(u=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,a)),u.length1+=r,u.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),u.length1+=c,u.length2+=c),a},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,a=0;a<n.length;a++)if(!(n[a].length1<=r)){var l=n[a];n.splice(a--,1);for(var u=l.start1,o=l.start2,c="";l.diffs.length!==0;){var f=new t.patch_obj,p=!0;for(f.start1=u-c.length,f.start2=o-c.length,c!==""&&(f.length1=f.length2=c.length,f.diffs.push(new t.Diff(0,c)));l.diffs.length!==0&&f.length1<r-this.Patch_Margin;){var d=l.diffs[0][0],_=l.diffs[0][1];d===1?(f.length2+=_.length,o+=_.length,f.diffs.push(l.diffs.shift()),p=!1):d===-1&&f.diffs.length==1&&f.diffs[0][0]==0&&_.length>2*r?(f.length1+=_.length,u+=_.length,p=!1,f.diffs.push(new t.Diff(d,_)),l.diffs.shift()):(_=_.substring(0,r-f.length1-this.Patch_Margin),f.length1+=_.length,u+=_.length,d===0?(f.length2+=_.length,o+=_.length):p=!1,f.diffs.push(new t.Diff(d,_)),_==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(_.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var v=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);v!==""&&(f.length1+=v.length,f.length2+=v.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=v:f.diffs.push(new t.Diff(0,v))),p||n.splice(++a,0,f)}}},t.prototype.patch_toText=function(n){for(var r=[],a=0;a<n.length;a++)r[a]=n[a];return r.join("")},t.prototype.patch_fromText=function(n){var r=[];if(!n)return r;for(var a=n.split(` `),l=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;l<a.length;){var o=a[l].match(u);if(!o)throw new Error("Invalid patch string: "+a[l]);var c=new t.patch_obj;for(r.push(c),c.start1=parseInt(o[1],10),o[2]===""?(c.start1--,c.length1=1):o[2]=="0"?c.length1=0:(c.start1--,c.length1=parseInt(o[2],10)),c.start2=parseInt(o[3],10),o[4]===""?(c.start2--,c.length2=1):o[4]=="0"?c.length2=0:(c.start2--,c.length2=parseInt(o[4],10)),l++;l<a.length;){var f=a[l].charAt(0);try{var p=decodeURI(a[l].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+p)}if(f=="-")c.diffs.push(new t.Diff(-1,p));else if(f=="+")c.diffs.push(new t.Diff(1,p));else if(f==" ")c.diffs.push(new t.Diff(0,p));else{if(f=="@")break;if(f!=="")throw new Error('Invalid patch mode "'+f+'" in: '+p)}l++}}return r},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var n,r=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@ `],a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case 1:n="+";break;case-1:n="-";break;case 0:n=" "}r[a+1]=n+encodeURI(this.diffs[a][1])+` -`}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0})),V8=gh.DIFF_EQUAL,Y8=gh.DIFF_DELETE,W8=gh.DIFF_INSERT;function dC(e){var t=yb(e,(function(r){return!$i(r)}));if(t===-1)return[];var n=yb(e,(function(r){return!!$i(r)}),t);return n===-1?[e.slice(t)]:[e.slice(t,n)].concat(Rn(dC(e.slice(n))))}function bb(e){return e.reduce((function(t,n){var r=Je(n,2),a=r[0],l=Ow(r[1].split(` -`).map((function(c){return[a,c]}))),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(t[t.length-1]),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function ng(e,t){return e.reduce((function(n,r){var a=Je(n,2),l=a[0],u=a[1],o=Je(r,2),c=o[0],f=o[1];if(c!==V8){var p={type:"edit",lineNumber:t,start:u,length:f.length};l.push(p)}return[l,u+f.length]}),[[],0])[0]}function Sb(e,t){return wm(e,(function(n,r){return ng(n,t+r)}))}function pC(e,t){var n=new gh,r=n.diff_main(e,t);return n.diff_cleanupSemantic(r),r.length<=1?[[],[]]:(function(a){return a.reduce((function(l,u){var o=Je(l,2),c=o[0],f=o[1];switch(Je(u,1)[0]){case W8:f.push(u);break;case Y8:c.push(u);break;default:c.push(u),f.push(u)}return[c,f]}),[[],[]])})(r)}function X8(e){var t=e.reduce((function(f,p){var d=Je(f,2),_=d[0],v=d[1];return Dn(p)?[_+(_?` +`}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0})),$8=gh.DIFF_EQUAL,G8=gh.DIFF_DELETE,q8=gh.DIFF_INSERT;function uC(e){var t=yb(e,(function(r){return!Ui(r)}));if(t===-1)return[];var n=yb(e,(function(r){return!!Ui(r)}),t);return n===-1?[e.slice(t)]:[e.slice(t,n)].concat(Rn(uC(e.slice(n))))}function bb(e){return e.reduce((function(t,n){var r=Je(n,2),a=r[0],l=Mw(r[1].split(` +`).map((function(c){return[a,c]}))),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(t[t.length-1]),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function ng(e,t){return e.reduce((function(n,r){var a=Je(n,2),l=a[0],u=a[1],o=Je(r,2),c=o[0],f=o[1];if(c!==$8){var p={type:"edit",lineNumber:t,start:u,length:f.length};l.push(p)}return[l,u+f.length]}),[[],0])[0]}function Sb(e,t){return wm(e,(function(n,r){return ng(n,t+r)}))}function hC(e,t){var n=new gh,r=n.diff_main(e,t);return n.diff_cleanupSemantic(r),r.length<=1?[[],[]]:(function(a){return a.reduce((function(l,u){var o=Je(l,2),c=o[0],f=o[1];switch(Je(u,1)[0]){case q8:f.push(u);break;case G8:c.push(u);break;default:c.push(u),f.push(u)}return[c,f]}),[[],[]])})(r)}function V8(e){var t=e.reduce((function(f,p){var d=Je(f,2),_=d[0],v=d[1];return Dn(p)?[_+(_?` `:"")+p.content,v]:[_,v+(v?` -`:"")+p.content]}),["",""]),n=Je(t,2),r=Je(pC(n[0],n[1]),2),a=r[0],l=r[1];if(a.length===0&&l.length===0)return[[],[]];var u=function(f){if(f&&!$i(f))return f.lineNumber},o=u(e.find(Dn)),c=u(e.find(Tr));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[Sb(bb(a),o),Sb(bb(l),c)]}function K8(e){var t=e.reduce((function(r,a){var l=Je(r,3),u=l[0],o=l[1],c=l[2];if(!c||!Dn(c)||!Tr(a))return[u,o,a];var f=Je(pC(c.content,a.content),2),p=f[0],d=f[1];return[u.concat(ng(p,c.lineNumber)),o.concat(ng(d,a.lineNumber)),a]}),[[],[],null]),n=Je(t,2);return[n[0],n[1]]}function Z8(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?X8:K8,r=wm(e.map((function(o){return o.changes})),dC).map(n).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1],_=Je(c,2),v=_[0],w=_[1];return[p.concat(v),d.concat(w)]}),[[],[]]),a=Je(r,2),l=a[0],u=a[1];return G8(vb(l),vb(u))}var Q8=["enhancers"],xb=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=Je(T8(e,Ar(n,Q8)),2),u=l[0],o=l[1],c=[gb(u),gb(o)],f=(t=[c[0],c[1]],a.reduce((function(C,b){return b(C)}),t)),p=Je(f,2),d=p[0],_=p[1],v=[d.map(mb),_.map(mb)],w=v[1];return{old:v[0].map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]})),new:w.map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]}))}};const J8=2e3,eB={highlight(e,t){return je.highlight(e,t).children}};function tB(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function nB(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function iB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function rB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function sB(e){const t=[Z8(e.hunks,{type:"line"})],n=pw(iB(e));return n&&je.registered(n)?xb(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:eB}):xb(e.hunks,{enhancers:t,highlight:!1})}const aB=({change:e,side:t})=>t==="old"?null:tB(e);function wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function oB({bytesRead:e,byteLimit:t}){return m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsxs("p",{children:["This diff is larger than ",wb(t)," (",wb(e)," read). View it locally with git."]})]})}function lB({file:e,defaultExpanded:t}){const[n,r]=q.useState(t),{additions:a,deletions:l}=q.useMemo(()=>nB(e),[e]),u=n&&a+l<=J8,o=q.useMemo(()=>{if(u)try{return sB(e)}catch{return}},[e,u]);return m.jsxs("section",{className:"diff-file-card",children:[m.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[m.jsx("span",{className:"chev",children:n?m.jsx(cs,{size:14}):m.jsx(Uu,{size:14})}),m.jsx("span",{className:"path",children:m.jsx("code",{children:rB(e)})}),m.jsxs("span",{className:"stats",children:[m.jsxs("span",{className:"diff-stat-add",children:["+",a]}),m.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?m.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):m.jsx(y8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:aB,tokens:o,viewType:"unified"}))]})}function gC({diff:e,className:t}){const n=q.useMemo(()=>{if(!e.trim())return[];try{return KL(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?m.jsx("div",{className:"diff-empty",children:"No changes."}):m.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>m.jsx(lB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var fp={exports:{}},Cb;function cB(){return Cb||(Cb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),_=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(_/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(fp)),fp.exports}var uB=cB(),dp={exports:{}},Eb;function hB(){return Eb||(Eb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),_=c(9924),v=c(844),w=c(4725),C=c(2585),b=c(3656);let S=o.AccessibilityManager=class extends v.Disposable{constructor(x,y,E,R){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`:"")+p.content]}),["",""]),n=Je(t,2),r=Je(hC(n[0],n[1]),2),a=r[0],l=r[1];if(a.length===0&&l.length===0)return[[],[]];var u=function(f){if(f&&!Ui(f))return f.lineNumber},o=u(e.find(Dn)),c=u(e.find(Tr));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[Sb(bb(a),o),Sb(bb(l),c)]}function Y8(e){var t=e.reduce((function(r,a){var l=Je(r,3),u=l[0],o=l[1],c=l[2];if(!c||!Dn(c)||!Tr(a))return[u,o,a];var f=Je(hC(c.content,a.content),2),p=f[0],d=f[1];return[u.concat(ng(p,c.lineNumber)),o.concat(ng(d,a.lineNumber)),a]}),[[],[],null]),n=Je(t,2);return[n[0],n[1]]}function W8(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?V8:Y8,r=wm(e.map((function(o){return o.changes})),uC).map(n).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1],_=Je(c,2),v=_[0],w=_[1];return[p.concat(v),d.concat(w)]}),[[],[]]),a=Je(r,2),l=a[0],u=a[1];return P8(vb(l),vb(u))}var X8=["enhancers"],xb=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=Je(k8(e,Ar(n,X8)),2),u=l[0],o=l[1],c=[gb(u),gb(o)],f=(t=[c[0],c[1]],a.reduce((function(C,b){return b(C)}),t)),p=Je(f,2),d=p[0],_=p[1],v=[d.map(mb),_.map(mb)],w=v[1];return{old:v[0].map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]})),new:w.map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]}))}};const K8=2e3,Z8={highlight(e,t){return je.highlight(e,t).children}};function Q8(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function J8(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function eB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function tB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function nB(e){const t=[W8(e.hunks,{type:"line"})],n=hw(eB(e));return n&&je.registered(n)?xb(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:Z8}):xb(e.hunks,{enhancers:t,highlight:!1})}const iB=({change:e,side:t})=>t==="old"?null:Q8(e);function wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function rB({bytesRead:e,byteLimit:t}){return m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsxs("p",{children:["This diff is larger than ",wb(t)," (",wb(e)," read). View it locally with git."]})]})}function sB({file:e,defaultExpanded:t}){const[n,r]=V.useState(t),{additions:a,deletions:l}=V.useMemo(()=>J8(e),[e]),u=n&&a+l<=K8,o=V.useMemo(()=>{if(u)try{return nB(e)}catch{return}},[e,u]);return m.jsxs("section",{className:"diff-file-card",children:[m.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[m.jsx("span",{className:"chev",children:n?m.jsx(cs,{size:14}):m.jsx(Uu,{size:14})}),m.jsx("span",{className:"path",children:m.jsx("code",{children:tB(e)})}),m.jsxs("span",{className:"stats",children:[m.jsxs("span",{className:"diff-stat-add",children:["+",a]}),m.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?m.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):m.jsx(m8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:iB,tokens:o,viewType:"unified"}))]})}function fC({diff:e,className:t}){const n=V.useMemo(()=>{if(!e.trim())return[];try{return YL(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?m.jsx("div",{className:"diff-empty",children:"No changes."}):m.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>m.jsx(sB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var fp={exports:{}},Cb;function aB(){return Cb||(Cb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),_=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(_/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(fp)),fp.exports}var oB=aB(),dp={exports:{}},Eb;function lB(){return Eb||(Eb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),_=c(9924),v=c(844),w=c(4725),C=c(2585),b=c(3656);let S=o.AccessibilityManager=class extends v.Disposable{constructor(x,y,E,R){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let y=0;y<x;y++)this._handleChar(" ")}_handleChar(x){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const E=this._terminal.buffer,R=E.lines.length.toString();for(let N=x;N<=y;N++){const D=E.lines.get(E.ydisp+N),T=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),F=this._rowElements[N];F&&(j.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=j,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",B),F.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const E=x.target,R=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==R)return;let N,D;if(y===0?(N=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:F})=>{const Y=B instanceof Text?B.parentNode:B;let H=parseInt(Y==null?void 0:Y.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(Y);if(!z)return console.warn("columns is null. Race condition?"),null;let V=F<z.length?z[F]:z.slice(-1)[0]+1;return V>=this._terminal.cols&&(++H,V=0),{row:H,column:V}},D=N(y),T=N(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x<this._terminal.rows;x++)this._refreshRowDimensions(this._rowElements[x])}}_refreshRowDimensions(x){x.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=f([p(1,C.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],S)},3614:(u,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function p(_,v,w,C){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),v.value=""}function d(_,v,w){const C=w.getBoundingClientRect(),b=_.clientX-C.left-10,S=_.clientY-C.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${b}px`,v.style.top=`${S}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,v,w,C){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),v,w,C)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(_,v,w,C,b){d(_,v,w),b&&C.rightClickSelect(_),v.value=C.selectionText,v.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,_){this._css.set(p,d,_)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,_){this._color.set(p,d,_)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),_=c(8460),v=c(844),w=c(2585),C=c(4725);let b=o.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(S,x,y,E,R){super(),this._element=S,this._mouseService=x,this._renderService=y,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=S.composedPath();for(let E=0;E<y.length;E++){const R=y[E];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&x.x===this._lastBufferCell.x&&x.y===this._lastBufferCell.y||(this._handleHover(x),this._lastBufferCell=x)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,x){var E,R;this._activeProviderReplies&&x||((E=this._activeProviderReplies)==null||E.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let y=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())x?(R=this._activeProviderReplies)!=null&&R.get(N)&&(y=this._checkLinkProviderResult(N,S,y)):D.provideLinks(S.y,(T=>{var B,F;if(this._isMouseOut)return;const j=T==null?void 0:T.map((Y=>({link:Y})));(B=this._activeProviderReplies)==null||B.set(N,j),y=this._checkLinkProviderResult(N,S,y),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,x){const y=new Set;for(let E=0;E<x.size;E++){const R=x.get(E);if(R)for(let N=0;N<R.length;N++){const D=R[N],T=D.link.range.start.y<S?0:D.link.range.start.x,j=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let B=T;B<=j;B++){if(y.has(B)){R.splice(N--,1);break}y.add(B)}}}}_checkLinkProviderResult(S,x,y){var N;if(!this._activeProviderReplies)return y;const E=this._activeProviderReplies.get(S);let R=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&E){const D=E.find((T=>this._linkAtPosition(T.link,x)));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((j=>this._linkAtPosition(j.link,x)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,x){this._currentLink&&this._lastMouseEvent&&(!S||!x||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(S.link,x)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.pointerCursor},set:y=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.underline},set:y=>{var E,R,N;(E=this._currentLink)!=null&&E.state&&((N=(R=this._currentLink)==null?void 0:R.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(S,x){const y=S.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(S,x){const y=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,R=x.y*this._bufferService.cols+x.x;return y<=R&&R<=E}_positionFromMouseEvent(S,x,y){const E=y.getCoords(S,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,x,y,E,R){return{x1:S,y1:x,x2:y,y2:E,cols:this._bufferService.cols,fg:R}}};o.Linkifier=b=f([p(1,C.IMouseService),p(2,C.IRenderService),p(3,w.IBufferService),p(4,C.ILinkProviderService)],b)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=o.OscLinkProvider=class{constructor(C,b,S){this._bufferService=C,this._optionsService=b,this._oscLinkService=S}provideLinks(C,b){var j;const S=this._bufferService.buffer.lines.get(C-1);if(!S)return void b(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,E=new d.CellData,R=S.getTrimmedLength();let N=-1,D=-1,T=!1;for(let B=0;B<R;B++)if(D!==-1||S.hasContent(B)){if(S.loadCell(B,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=B,N=E.extended.urlId;continue}T=E.extended.urlId!==N}else D!==-1&&(T=!0);if(T||D!==-1&&B===R-1){const F=(j=this._oscLinkService.getLinkData(N))==null?void 0:j.uri;if(F){const Y={start:{x:D+1,y:C},end:{x:B+(T||B!==R-1?0:1),y:C}};let H=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const z=new URL(F);["http:","https:"].includes(z.protocol)||(H=!0)}catch{H=!0}H||x.push({text:F,range:Y,activate:(z,V)=>y?y.activate(z,V,Y):w(0,V),hover:(z,V)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,z,V,Y)},leave:(z,V)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,z,V,Y)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,N=E.extended.urlId):(D=-1,N=-1)}}b(x)}};function w(C,b){if(confirm(`Do you want to navigate to ${b}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const E=this._terminal.buffer,R=E.lines.length.toString();for(let N=x;N<=y;N++){const D=E.lines.get(E.ydisp+N),T=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),z=this._rowElements[N];z&&(j.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=j,this._rowColumns.set(z,T)),z.setAttribute("aria-posinset",B),z.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const E=x.target,R=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==R)return;let N,D;if(y===0?(N=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:z})=>{const G=B instanceof Text?B.parentNode:B;let U=parseInt(G==null?void 0:G.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(G);if(!H)return console.warn("columns is null. Race condition?"),null;let Y=z<H.length?H[z]:H.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++U,Y=0),{row:U,column:Y}},D=N(y),T=N(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x<this._terminal.rows;x++)this._refreshRowDimensions(this._rowElements[x])}}_refreshRowDimensions(x){x.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=f([p(1,C.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],S)},3614:(u,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function p(_,v,w,C){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),v.value=""}function d(_,v,w){const C=w.getBoundingClientRect(),b=_.clientX-C.left-10,S=_.clientY-C.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${b}px`,v.style.top=`${S}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,v,w,C){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),v,w,C)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(_,v,w,C,b){d(_,v,w),b&&C.rightClickSelect(_),v.value=C.selectionText,v.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,_){this._css.set(p,d,_)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,_){this._color.set(p,d,_)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),_=c(8460),v=c(844),w=c(2585),C=c(4725);let b=o.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(S,x,y,E,R){super(),this._element=S,this._mouseService=x,this._renderService=y,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=S.composedPath();for(let E=0;E<y.length;E++){const R=y[E];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&x.x===this._lastBufferCell.x&&x.y===this._lastBufferCell.y||(this._handleHover(x),this._lastBufferCell=x)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,x){var E,R;this._activeProviderReplies&&x||((E=this._activeProviderReplies)==null||E.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let y=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())x?(R=this._activeProviderReplies)!=null&&R.get(N)&&(y=this._checkLinkProviderResult(N,S,y)):D.provideLinks(S.y,(T=>{var B,z;if(this._isMouseOut)return;const j=T==null?void 0:T.map((G=>({link:G})));(B=this._activeProviderReplies)==null||B.set(N,j),y=this._checkLinkProviderResult(N,S,y),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,x){const y=new Set;for(let E=0;E<x.size;E++){const R=x.get(E);if(R)for(let N=0;N<R.length;N++){const D=R[N],T=D.link.range.start.y<S?0:D.link.range.start.x,j=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let B=T;B<=j;B++){if(y.has(B)){R.splice(N--,1);break}y.add(B)}}}}_checkLinkProviderResult(S,x,y){var N;if(!this._activeProviderReplies)return y;const E=this._activeProviderReplies.get(S);let R=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&E){const D=E.find((T=>this._linkAtPosition(T.link,x)));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((j=>this._linkAtPosition(j.link,x)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,x){this._currentLink&&this._lastMouseEvent&&(!S||!x||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(S.link,x)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.pointerCursor},set:y=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.underline},set:y=>{var E,R,N;(E=this._currentLink)!=null&&E.state&&((N=(R=this._currentLink)==null?void 0:R.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(S,x){const y=S.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(S,x){const y=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,R=x.y*this._bufferService.cols+x.x;return y<=R&&R<=E}_positionFromMouseEvent(S,x,y){const E=y.getCoords(S,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,x,y,E,R){return{x1:S,y1:x,x2:y,y2:E,cols:this._bufferService.cols,fg:R}}};o.Linkifier=b=f([p(1,C.IMouseService),p(2,C.IRenderService),p(3,w.IBufferService),p(4,C.ILinkProviderService)],b)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=o.OscLinkProvider=class{constructor(C,b,S){this._bufferService=C,this._optionsService=b,this._oscLinkService=S}provideLinks(C,b){var j;const S=this._bufferService.buffer.lines.get(C-1);if(!S)return void b(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,E=new d.CellData,R=S.getTrimmedLength();let N=-1,D=-1,T=!1;for(let B=0;B<R;B++)if(D!==-1||S.hasContent(B)){if(S.loadCell(B,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=B,N=E.extended.urlId;continue}T=E.extended.urlId!==N}else D!==-1&&(T=!0);if(T||D!==-1&&B===R-1){const z=(j=this._oscLinkService.getLinkData(N))==null?void 0:j.uri;if(z){const G={start:{x:D+1,y:C},end:{x:B+(T||B!==R-1?0:1),y:C}};let U=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const H=new URL(z);["http:","https:"].includes(H.protocol)||(U=!0)}catch{U=!0}U||x.push({text:z,range:G,activate:(H,Y)=>y?y.activate(H,Y,G):w(0,Y),hover:(H,Y)=>{var q;return(q=y==null?void 0:y.hover)==null?void 0:q.call(y,H,Y,G)},leave:(H,Y)=>{var q;return(q=y==null?void 0:y.leave)==null?void 0:q.call(y,H,Y,G)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,N=E.extended.urlId):(D=-1,N=-1)}}b(x)}};function w(C,b){if(confirm(`Do you want to navigate to ${b}? -WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=v=f([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],v)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),_=c(9042),v=c(3730),w=c(1680),C=c(3107),b=c(5744),S=c(2950),x=c(1296),y=c(428),E=c(4269),R=c(5114),N=c(8934),D=c(3230),T=c(9312),j=c(4725),B=c(6731),F=c(8055),Y=c(8969),H=c(8460),z=c(844),V=c(6114),G=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),$=c(5435),U=c(4567),Q=c(779);class re extends Y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ee)=>this.refresh(P,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,z.toDisposable)((()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const P of Z){let ee,ne="";switch(P.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+P.index}switch(P.type){case 0:const ge=F.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(ge)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[P.index]=F.channels.toColor(...P.color)));else{const he=ee;this._themeService.modifyColors((ye=>ye[he]=F.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(Z);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ge=P.getWidth(ee),he=this._renderService.dimensions.css.cell.width*ge,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,be=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=be+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,f.copyHandler)(P,this._selectionService)})));const Z=P=>(0,f.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),V.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),V.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,f.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),V.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,P=this.element;function ee(he){const ye=Z._mouseService.getMouseReportCoords(he,Z.screenElement);if(!ye)return!1;let be,ke;switch(he.overrideType||he.type){case"mousemove":ke=32,he.buttons===void 0?(be=3,he.button!==void 0&&(be=he.button<3?he.button:3)):be=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":ke=0,be=he.button<3?he.button:3;break;case"mousedown":ke=1,be=he.button<3?he.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(he)===!1||Z.viewport.getLinesScrolled(he)===0)return!1;ke=he.deltaY<0?0:1,be=4;break;default:return!1}return!(ke===void 0||be===void 0||be>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:be,action:ke,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ge={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ne.mousemove||(P.addEventListener("mousemove",ge.mousemove),ne.mousemove=ge.mousemove):(P.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&he?ne.wheel||(P.addEventListener("wheel",ge.wheel,{passive:!1}),ne.wheel=ge.wheel):(P.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&he?ne.mouseup||(ne.mouseup=ge.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&he?ne.mousedrag||(ne.mousedrag=ge.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(P,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(he)}))),this.register((0,p.addDisposableDomListener)(P,"wheel",(he=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(he);if(ye===0)return;const be=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let ke="";for(let Ee=0;Ee<Math.abs(ye);Ee++)ke+=be;return this.coreService.triggerDataEvent(ke,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(P,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(P,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Z,P){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,P)}updateCursorStyle(Z){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,P,ee=0){var ne;ee===1?(super.scrollLines(Z,P,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,P,ee){this._selectionService.setSelection(Z,P,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,P){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,P)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!P&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,P){const ee=Z.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Z.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Z.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)P=Z.charCode;else if(Z.which===null||Z.which===void 0)P=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;P=Z.which}return!(!P||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=Z.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Z),!0}return!1}resize(Z,P){Z!==this.cols||P!==this.rows?super.resize(Z,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,P){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Z=this.viewport)==null||Z.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Z;(Z=this._renderService)==null||Z.clearTextureAtlas()}_reportFocus(){var Z;(Z=this.element)!=null&&Z.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ee};${P}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ge=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ge};${ne}t`)}}cancel(Z,P){if(this.options.cancelEvents||P)return Z.preventDefault(),Z.stopPropagation(),!1}}o.Terminal=re},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),w=c(844),C=c(2585);let b=o.Viewport=class extends w.Disposable{constructor(S,x,y,E,R,N,D,T){super(),this._viewportElement=S,this._scrollArea=x,this._bufferService=y,this._optionsService=E,this._charSizeService=R,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const x=this._getPixelsScrolled(S);return x!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+x:this._smoothScrollState.target+=x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const x=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?x*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._currentRowHeight*this._bufferService.rows),x}getBufferElements(S,x){var T;let y,E="";const R=[],N=x??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let j=S;j<N;j++){const B=D.get(j);if(!B)continue;const F=(T=D.get(j+1))==null?void 0:T.isWrapped;if(E+=B.translateToString(!F),!F||j===D.length-1){const Y=document.createElement("div");Y.textContent=E,R.push(Y),E.length>0&&(y=Y),E=""}}return{bufferElements:R,cursorElement:y}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(S,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const x=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}};o.Viewport=b=f([p(2,C.IBufferService),p(3,C.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],b)},3107:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),v=c(2585);let w=o.BufferDecorationRenderer=class extends _.Disposable{constructor(C,b,S,x,y){super(),this._screenElement=C,this._bufferService=b,this._coreBrowserService=S,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var x;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((x=C==null?void 0:C.options)==null?void 0:x.layer)==="top"),b.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=C.options.x??0;return S&&S>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(C,b),b}_refreshStyle(C){const b=C.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let S=this._decorationElements.get(C);S||(S=this._createElement(C),C.element=S,this._decorationElements.set(C,S),this._container.appendChild(S),C.onDispose((()=>{this._decorationElements.delete(C),S.remove()}))),S.style.top=b*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(S)}}_refreshXPosition(C,b=C.element){if(!b)return;const S=C.options.x??0;(C.options.anchor||"left")==="right"?b.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var b;(b=this._decorationElements.get(C))==null||b.remove(),this._decorationElements.delete(C),C.dispose()}};o.BufferDecorationRenderer=w=f([p(1,v.IBufferService),p(2,d.ICoreBrowserService),p(3,v.IDecorationService),p(4,d.IRenderService)],w)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),v=c(844),w=c(2585),C={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,R,N,D,T,j){var F;super(),this._viewportElement=y,this._screenElement=E,this._bufferService=R,this._decorationService=N,this._renderService=D,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var Y;(Y=this._canvas)==null||Y.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=b.left,S.right=b.left+b.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);C.left=E,C.center=E,C.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(S[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-C[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,b,S,x,y,E){this._textarea=C,this._compositionView=b,this._bufferService=S,this._optionsService=x,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,S=b.replace(C,"");this._dataAlreadySent=S,b.length>C.length?this._coreService.triggerDataEvent(S,!0):b.length<C.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):b.length===C.length&&b!==C&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,x=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=x+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=x+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=w=f([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,d.IRenderService)],w)},9806:(u,o)=>{function c(f,p,d){const _=d.getBoundingClientRect(),v=f.getComputedStyle(d),w=parseInt(v.getPropertyValue("padding-left")),C=parseInt(v.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-C]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,_,v,w,C,b,S){if(!w)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(S?C/2:0))/C),x[1]=Math.ceil(x[1]/b),x[0]=Math.min(Math.max(x[0],1),_+(S?1:0)),x[1]=Math.min(Math.max(x[1],1),v),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(b,S,x,y){const E=b-d(b,x),R=S-d(S,x),N=Math.abs(E-R)-(function(D,T,j){let B=0;const F=D-d(D,j),Y=T-d(T,j);for(let H=0;H<Math.abs(F-Y);H++){const z=_(D,T)==="A"?-1:1,V=j.buffer.lines.get(F+z*H);V!=null&&V.isWrapped&&B++}return B})(b,S,x);return C(N,w(_(b,S),y))}function d(b,S){let x=0,y=S.buffer.lines.get(b),E=y==null?void 0:y.isWrapped;for(;E&&b>=0&&b<S.rows;)x++,y=S.buffer.lines.get(--b),E=y==null?void 0:y.isWrapped;return x}function _(b,S){return b>S?"A":"B"}function v(b,S,x,y,E,R){let N=b,D=S,T="";for(;N!==x||D!==y;)N+=E?1:-1,E&&N>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,b,N),N=0,b=0,D++):!E&&N<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,b+1),N=R.cols-1,b=N,D--);return T+R.buffer.translateBufferLineToString(D,!1,b,N)}function w(b,S){const x=S?"O":"[";return f.C0.ESC+x+b}function C(b,S){b=Math.floor(b);let x="";for(let y=0;y<b;y++)x+=S;return x}o.moveToCellSequence=function(b,S,x,y){const E=x.buffer.x,R=x.buffer.y;if(!x.buffer.hasScrollback)return(function(T,j,B,F,Y,H){return p(j,F,Y,H).length===0?"":C(v(T,j,T,j-d(j,Y),!1,Y).length,w("D",H))})(E,R,0,S,x,y)+p(R,S,x,y)+(function(T,j,B,F,Y,H){let z;z=p(j,F,Y,H).length>0?F-d(F,Y):j;const V=F,G=(function(X,K,L,M,O,$){let U;return U=p(L,M,O,$).length>0?M-d(M,O):K,X<L&&U<=M||X>=L&&U<M?"C":"D"})(T,j,B,F,Y,H);return C(v(T,z,B,V,G==="C",Y).length,w(G,H))})(E,R,b,S,x,y);let N;if(R===S)return N=E>b?"D":"C",C(Math.abs(E-b),w(N,y));N=R>S?"D":"C";const D=Math.abs(R-S);return C((function(T,j){return j.cols-T})(R>S?b:E,x)+(D-1)*x.cols+1+((R>S?E:b)-1),w(N,y))}},1296:function(u,o,c){var f=this&&this.__decorate||function(H,z,V,G){var X,K=arguments.length,L=K<3?z:G===null?G=Object.getOwnPropertyDescriptor(z,V):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(H,z,V,G);else for(var M=H.length-1;M>=0;M--)(X=H[M])&&(L=(K<3?X(L):K>3?X(z,V,L):X(z,V))||L);return K>3&&L&&Object.defineProperty(z,V,L),L},p=this&&this.__param||function(H,z){return function(V,G){z(V,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),w=c(6171),C=c(6052),b=c(4725),S=c(8055),x=c(8460),y=c(844),E=c(2585),R="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let F=1,Y=o.DomRenderer=class extends y.Disposable{constructor(H,z,V,G,X,K,L,M,O,$,U,Q,re){super(),this._terminal=H,this._document=z,this._element=V,this._screenElement=G,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=$,this._bufferService=U,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const z=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=z,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let z=`${this._terminalSelector} .${N} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;z+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity(H.foreground,.5).css};}`,z+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const V=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;z+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,z+=`@keyframes ${G} { 50% { box-shadow: none; }}`,z+=`@keyframes ${X} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,z+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,z+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of H.ansi.entries())z+=`${this._terminalSelector} .${D}${K} { color: ${L.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${S.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;z+=`${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(H.background).css}; }${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${T}${v.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=z}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,z){for(let V=this._rowElements.length;V<=z;V++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,z){this._refreshRowElements(H,z),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,z,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,z,V),this.renderRows(0,this._bufferService.rows-1),!H||!z)return;this._selectionRenderModel.update(this._terminal,H,z,V);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(V){const O=H[0]>z[0];M.appendChild(this._createSelectionElement(K,O?z[0]:H[0],O?H[0]:z[0],L-K+1))}else{const O=G===K?H[0]:0,$=K===X?z[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,$));const U=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,U)),K!==L){const Q=X===L?z[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(H,z,V,G=1){const X=this._document.createElement("div"),K=z*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(V-z);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=H*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,z){const V=this._bufferService.buffer,G=V.ybase+V.y,X=Math.min(V.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=H;O<=z;O++){const $=O+V.ydisp,U=this._rowElements[O],Q=V.lines.get($);if(!U||!Q)break;U.replaceChildren(...this._rowFactory.createRow(Q,$,$===G,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,z,V,G,X,K){V<0&&(H=0),G<0&&(z=0);const L=this._bufferService.rows-1;V=Math.max(Math.min(V,L),0),G=Math.max(Math.min(G,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,$=Math.min(M.x,X-1),U=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=V;ae<=G;++ae){const Z=ae+M.ydisp,P=this._rowElements[ae],ee=M.lines.get(Z);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,$,U,this.dimensions.css.cell.width,this._widthCache,K?ae===V?H:0:-1,K?(ae===G?z:X)-1:-1))}}};o.DomRenderer=Y=f([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],Y)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,D,T,j){var B,F=arguments.length,Y=F<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(N,D,T,j);else for(var H=N.length-1;H>=0;H--)(B=N[H])&&(Y=(F<3?B(Y):F>3?B(D,T,Y):B(D,T))||Y);return F>3&&Y&&Object.defineProperty(D,T,Y),Y},p=this&&this.__param||function(N,D){return function(T,j){D(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),w=c(2585),C=c(8055),b=c(4725),S=c(4269),x=c(6171),y=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,D,T,j,B,F,Y){this._document=N,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=F,this._themeService=Y,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,T){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=T}createRow(N,D,T,j,B,F,Y,H,z,V,G){const X=[],K=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O<F+1&&(O=F+1);let $=0,U="",Q=0,re=0,ae=0,Z=!1,P=0,ee=!1,ne=0;const ge=[],he=V!==-1&&G!==-1;for(let ye=0;ye<O;ye++){N.loadCell(ye,this._workCell);let be=this._workCell.getWidth();if(be===0)continue;let ke=!1,Ee=ye,Ce=this._workCell;if(K.length>0&&ye===K[0][0]){ke=!0;const Ie=K.shift();Ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),Ee=Ie[1]-1,be=Ce.getWidth()}const rt=this._isCellInSelection(ye,D),bt=T&&ye===F,Ge=he&&ye>=V&&ye<=G;let ct=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{ct=!0}));let Pt=Ce.getChars()||_.WHITESPACE_CELL_CHAR;if(Pt===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Pt=" "),ne=be*H-z.get(Pt,Ce.isBold(),Ce.isItalic()),M){if($&&(rt&&ee||!rt&&!ee&&Ce.bg===Q)&&(rt&&ee&&L.selectionForeground||Ce.fg===re)&&Ce.extended.ext===ae&&Ge===Z&&ne===P&&!bt&&!ke&&!ct){Ce.isInvisible()?U+=_.WHITESPACE_CELL_CHAR:U+=Pt,$++;continue}$&&(M.textContent=U),M=this._document.createElement("span"),$=0,U=""}else M=this._document.createElement("span");if(Q=Ce.bg,re=Ce.fg,ae=Ce.extended.ext,Z=Ge,P=ne,ee=rt,ke&&F>=ye&&F<=Ee&&(F=ye),!this._coreService.isCursorHidden&&bt&&this._coreService.isCursorInitialized){if(ge.push("xterm-cursor"),this._coreBrowserService.isFocused)Y&&ge.push("xterm-cursor-blink"),ge.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ge.push("xterm-cursor-outline");break;case"block":ge.push("xterm-cursor-block");break;case"bar":ge.push("xterm-cursor-bar");break;case"underline":ge.push("xterm-cursor-underline")}}if(Ce.isBold()&&ge.push("xterm-bold"),Ce.isItalic()&&ge.push("xterm-italic"),Ce.isDim()&&ge.push("xterm-dim"),U=Ce.isInvisible()?_.WHITESPACE_CELL_CHAR:Ce.getChars()||_.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(ge.push(`xterm-underline-${Ce.extended.underlineStyle}`),U===" "&&(U=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ie=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ie<8&&(Ie+=8),M.style.textDecorationColor=L.ansi[Ie].css}Ce.isOverline()&&(ge.push("xterm-overline"),U===" "&&(U=" ")),Ce.isStrikethrough()&&ge.push("xterm-strikethrough"),Ge&&(M.style.textDecoration="underline");let ht=Ce.getFgColor(),Fe=Ce.getFgColorMode(),fe=Ce.getBgColor(),ie=Ce.getBgColorMode();const de=!!Ce.isInverse();if(de){const Ie=ht;ht=fe,fe=Ie;const Nt=Fe;Fe=ie,ie=Nt}let Se,Ae,De,Ve=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{Ie.options.layer!=="top"&&Ve||(Ie.backgroundColorRGB&&(ie=50331648,fe=Ie.backgroundColorRGB.rgba>>8&16777215,Se=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(Fe=50331648,ht=Ie.foregroundColorRGB.rgba>>8&16777215,Ae=Ie.foregroundColorRGB),Ve=Ie.options.layer==="top")})),!Ve&&rt&&(Se=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,fe=Se.rgba>>8&16777215,ie=50331648,Ve=!0,L.selectionForeground&&(Fe=50331648,ht=L.selectionForeground.rgba>>8&16777215,Ae=L.selectionForeground)),Ve&&ge.push("xterm-decoration-top"),ie){case 16777216:case 33554432:De=L.ansi[fe],ge.push(`xterm-bg-${fe}`);break;case 50331648:De=C.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(M,`background-color:#${R((fe>>>0).toString(16),"0",6)}`);break;default:de?(De=L.foreground,ge.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):De=L.background}switch(Se||Ce.isDim()&&(Se=C.color.multiplyOpacity(De,.5)),Fe){case 16777216:case 33554432:Ce.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(M,De,L.ansi[ht],Ce,Se,void 0)||ge.push(`xterm-fg-${ht}`);break;case 50331648:const Ie=C.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(M,De,Ie,Ce,Se,Ae)||this._addStyle(M,`color:#${R(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,De,L.foreground,Ce,Se,Ae)||de&&ge.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ge.length&&(M.className=ge.join(" "),ge.length=0),bt||ke||ct?M.textContent=U:$++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ee}return M&&$&&(M.textContent=U),X}_applyMinimumContrast(N,D,T,j,B,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const Y=this._getContrastCache(j);let H;if(B||F||(H=Y.getColor(D.rgba,T.rgba)),H===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);H=C.color.ensureContrastRatio(B||D,F||T,z),Y.setColor((B||D).rgba,(F||T).rgba,H??null)}return!!H&&(this._addStyle(N,`color:${H.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&D>=T[1]&&N<j[0]&&D<=j[1]:N<T[0]&&D>=T[1]&&N>=j[0]&&D<=j[1]:D>T[1]&&D<j[1]||T[1]===j[1]&&D===T[1]&&N>=T[0]&&N<j[0]||T[1]<j[1]&&D===j[1]&&N<j[0]||T[1]<j[1]&&D===T[1]&&N>=T[0])}};function R(N,D,T){for(;N.length<T;)N=D+N;return N}o.DomRendererRowFactory=E=f([p(1,b.ICharacterJoinerService),p(2,w.IOptionsService),p(3,b.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,b.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[p,d,_,v],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(v),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),p&&(_+="I");let v=this._holey.get(_);if(v===void 0){let w=0;f&&(w|=1),p&&(w|=2),v=this._measure(c,w),v>0&&this._holey.set(_,v)}return v}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,_,v){return d===1&&_>Math.ceil(1.5*v)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,_=0){return(p-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,_,v=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,C=d[1]-w,b=_[1]-w,S=Math.max(C,0),x=Math.min(b,p.rows-1);S>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=C,this.viewportEndRow=b,this.viewportCappedStartRow=S,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=_[0])}isCellSelected(p,d,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let w=o.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new b(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([p(2,d.IOptionsService)],w);class C extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends C{constructor(y,E,R){super(),this._document=y,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends C{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),w=c(2585);class C extends d.AttributeData{constructor(x,y,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=C;let b=o.CharacterJoinerService=class mC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===x)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(x){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(x);if(!y||y.length===0)return[];const E=[],R=y.translateToString(!0);let N=0,D=0,T=0,j=y.getFg(0),B=y.getBg(0);for(let F=0;F<y.getTrimmedLength();F++)if(y.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==B){if(F-N>1){const Y=this._getJoinedRanges(R,T,D,y,N);for(let H=0;H<Y.length;H++)E.push(Y[H])}N=F,T=D,j=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const F=this._getJoinedRanges(R,T,D,y,N);for(let Y=0;Y<F.length;Y++)E.push(F[Y])}return E}_getJoinedRanges(x,y,E,R,N){const D=x.substring(y,E);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const B=this._characterJoiners[j].handler(D);for(let F=0;F<B.length;F++)mC._mergeRanges(T,B[F])}catch(B){console.error(B)}return this._stringRangesToCellRanges(T,R,N),T}_stringRangesToCellRanges(x,y,E){let R=0,N=!1,D=0,T=x[R];if(T){for(let j=E;j<this._bufferService.cols;j++){const B=y.getWidth(j),F=y.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!N&&T[0]<=D&&(T[0]=j,N=!0),T[1]<=D){if(T[1]=j,T=x[++R],!T)break;T[0]<=D?(T[0]=j,N=!0):N=!1}D+=F}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(x,y){let E=!1;for(let R=0;R<x.length;R++){const N=x[R];if(E){if(y[1]<=N[0])return x[R-1][1]=y[1],x;if(y[1]<=N[1])return x[R-1][1]=Math.max(y[1],N[1]),x.splice(R,1),x;x.splice(R,1),R--}else{if(y[1]<=N[0])return x.splice(R,0,y),x;if(y[1]<=N[1])return N[0]=Math.min(y[0],N[0]),x;y[0]<N[1]&&(N[0]=Math.min(y[0],N[0]),E=!0)}}return E?x[x.length-1][1]=y[1]:x.push(y),x}};o.CharacterJoinerService=b=f([p(0,w.IBufferService)],b)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class _ extends f.Disposable{constructor(C,b,S){super(),this._textarea=C,this._window=b,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=_;class v extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const v=this.linkProviders.indexOf(_);v!==-1&&this.linkProviders.splice(v,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(w,C,b,S){var x,y=arguments.length,E=y<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,C,b,S);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(E=(y<3?x(E):y>3?x(C,b,E):x(C,b))||E);return y>3&&E&&Object.defineProperty(C,b,E),E},p=this&&this.__param||function(w,C){return function(b,S){C(b,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),_=c(9806);let v=o.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,b,S,x){return(0,_.getCoords)(window,w,C,b,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(w,C){const b=(0,_.getCoordsRelativeToElement)(window,w,C);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=v=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],v)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),_=c(4725),v=c(8460),w=c(844),C=c(7226),b=c(2585);let S=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,E,R,N,D,T,j){super(),this._rowCount=x,this._charSizeService=R,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,F)=>this._renderRows(B,F)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(y),this._observerDisposable.value=(0,w.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,E){var R;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=E,(R=this._renderer.value)==null||R.handleSelectionChanged(x,y,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=S=f([p(2,b.IOptionsService),p(3,_.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],S)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,F){var Y,H=arguments.length,z=H<3?j:F===null?F=Object.getOwnPropertyDescriptor(j,B):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(T,j,B,F);else for(var V=T.length-1;V>=0;V--)(Y=T[V])&&(z=(H<3?Y(z):H>3?Y(j,B,z):Y(j,B))||z);return H>3&&z&&Object.defineProperty(j,B,z),z},p=this&&this.__param||function(T,j){return function(B,F){j(B,F,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),w=c(4725),C=c(8460),b=c(844),S=c(6114),x=c(4841),y=c(511),E=c(2585),R=" ",N=new RegExp(R,"g");let D=o.SelectionService=class extends b.Disposable{constructor(T,j,B,F,Y,H,z,V,G){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=F,this._coreService=Y,this._mouseService=H,this._optionsService=z,this._renderService=V,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const Y=T[0]<j[0]?T[0]:j[0],H=T[0]<j[0]?j[0]:T[0];for(let z=T[1];z<=j[1];z++){const V=B.translateBufferLineToString(z,!0,Y,H);F.push(V)}}else{const Y=T[1]===j[1]?j[0]:void 0;F.push(B.translateBufferLineToString(T[1],!0,T[0],Y));for(let H=T[1]+1;H<=j[1]-1;H++){const z=B.lines.get(H),V=B.translateBufferLineToString(H,!0);z!=null&&z.isWrapped?F[F.length-1]+=V:F.push(V)}if(T[1]!==j[1]){const H=B.lines.get(j[1]),z=B.translateBufferLineToString(j[1],!0,0,j[0]);H&&H.isWrapped?F[F.length-1]+=z:F.push(z)}}return F.map((Y=>Y.replace(N," "))).join(S.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=v=f([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],v)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),_=c(9042),v=c(3730),w=c(1680),C=c(3107),b=c(5744),S=c(2950),x=c(1296),y=c(428),E=c(4269),R=c(5114),N=c(8934),D=c(3230),T=c(9312),j=c(4725),B=c(6731),z=c(8055),G=c(8969),U=c(8460),H=c(844),Y=c(6114),q=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),$=c(5435),F=c(4567),Q=c(779);class re extends G.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ee)=>this.refresh(P,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,H.toDisposable)((()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const P of Z){let ee,ne="";switch(P.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+P.index}switch(P.type){case 0:const ge=z.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(ge)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[P.index]=z.channels.toColor(...P.color)));else{const he=ee;this._themeService.modifyColors((ye=>ye[he]=z.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(Z);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ge=P.getWidth(ee),he=this._renderService.dimensions.css.cell.width*ge,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,be=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=be+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,f.copyHandler)(P,this._selectionService)})));const Z=P=>(0,f.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),Y.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,f.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,P=this.element;function ee(he){const ye=Z._mouseService.getMouseReportCoords(he,Z.screenElement);if(!ye)return!1;let be,ke;switch(he.overrideType||he.type){case"mousemove":ke=32,he.buttons===void 0?(be=3,he.button!==void 0&&(be=he.button<3?he.button:3)):be=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":ke=0,be=he.button<3?he.button:3;break;case"mousedown":ke=1,be=he.button<3?he.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(he)===!1||Z.viewport.getLinesScrolled(he)===0)return!1;ke=he.deltaY<0?0:1,be=4;break;default:return!1}return!(ke===void 0||be===void 0||be>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:be,action:ke,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ge={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ne.mousemove||(P.addEventListener("mousemove",ge.mousemove),ne.mousemove=ge.mousemove):(P.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&he?ne.wheel||(P.addEventListener("wheel",ge.wheel,{passive:!1}),ne.wheel=ge.wheel):(P.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&he?ne.mouseup||(ne.mouseup=ge.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&he?ne.mousedrag||(ne.mousedrag=ge.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(P,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(he)}))),this.register((0,p.addDisposableDomListener)(P,"wheel",(he=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(he);if(ye===0)return;const be=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let ke="";for(let Ee=0;Ee<Math.abs(ye);Ee++)ke+=be;return this.coreService.triggerDataEvent(ke,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(P,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(P,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Z,P){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,P)}updateCursorStyle(Z){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,P,ee=0){var ne;ee===1?(super.scrollLines(Z,P,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,P,ee){this._selectionService.setSelection(Z,P,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,P){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,P)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!P&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,P){const ee=Z.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Z.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Z.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)P=Z.charCode;else if(Z.which===null||Z.which===void 0)P=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;P=Z.which}return!(!P||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=Z.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Z),!0}return!1}resize(Z,P){Z!==this.cols||P!==this.rows?super.resize(Z,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,P){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Z=this.viewport)==null||Z.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Z;(Z=this._renderService)==null||Z.clearTextureAtlas()}_reportFocus(){var Z;(Z=this.element)!=null&&Z.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ee};${P}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ge=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ge};${ne}t`)}}cancel(Z,P){if(this.options.cancelEvents||P)return Z.preventDefault(),Z.stopPropagation(),!1}}o.Terminal=re},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),w=c(844),C=c(2585);let b=o.Viewport=class extends w.Disposable{constructor(S,x,y,E,R,N,D,T){super(),this._viewportElement=S,this._scrollArea=x,this._bufferService=y,this._optionsService=E,this._charSizeService=R,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const x=this._getPixelsScrolled(S);return x!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+x:this._smoothScrollState.target+=x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const x=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?x*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._currentRowHeight*this._bufferService.rows),x}getBufferElements(S,x){var T;let y,E="";const R=[],N=x??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let j=S;j<N;j++){const B=D.get(j);if(!B)continue;const z=(T=D.get(j+1))==null?void 0:T.isWrapped;if(E+=B.translateToString(!z),!z||j===D.length-1){const G=document.createElement("div");G.textContent=E,R.push(G),E.length>0&&(y=G),E=""}}return{bufferElements:R,cursorElement:y}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(S,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const x=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}};o.Viewport=b=f([p(2,C.IBufferService),p(3,C.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],b)},3107:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),v=c(2585);let w=o.BufferDecorationRenderer=class extends _.Disposable{constructor(C,b,S,x,y){super(),this._screenElement=C,this._bufferService=b,this._coreBrowserService=S,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var x;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((x=C==null?void 0:C.options)==null?void 0:x.layer)==="top"),b.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=C.options.x??0;return S&&S>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(C,b),b}_refreshStyle(C){const b=C.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let S=this._decorationElements.get(C);S||(S=this._createElement(C),C.element=S,this._decorationElements.set(C,S),this._container.appendChild(S),C.onDispose((()=>{this._decorationElements.delete(C),S.remove()}))),S.style.top=b*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(S)}}_refreshXPosition(C,b=C.element){if(!b)return;const S=C.options.x??0;(C.options.anchor||"left")==="right"?b.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var b;(b=this._decorationElements.get(C))==null||b.remove(),this._decorationElements.delete(C),C.dispose()}};o.BufferDecorationRenderer=w=f([p(1,v.IBufferService),p(2,d.ICoreBrowserService),p(3,v.IDecorationService),p(4,d.IRenderService)],w)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),v=c(844),w=c(2585),C={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,R,N,D,T,j){var z;super(),this._viewportElement=y,this._screenElement=E,this._bufferService=R,this._decorationService=N,this._renderService=D,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var G;(G=this._canvas)==null||G.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=b.left,S.right=b.left+b.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);C.left=E,C.center=E,C.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(S[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-C[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,b,S,x,y,E){this._textarea=C,this._compositionView=b,this._bufferService=S,this._optionsService=x,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,S=b.replace(C,"");this._dataAlreadySent=S,b.length>C.length?this._coreService.triggerDataEvent(S,!0):b.length<C.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):b.length===C.length&&b!==C&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,x=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=x+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=x+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=w=f([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,d.IRenderService)],w)},9806:(u,o)=>{function c(f,p,d){const _=d.getBoundingClientRect(),v=f.getComputedStyle(d),w=parseInt(v.getPropertyValue("padding-left")),C=parseInt(v.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-C]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,_,v,w,C,b,S){if(!w)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(S?C/2:0))/C),x[1]=Math.ceil(x[1]/b),x[0]=Math.min(Math.max(x[0],1),_+(S?1:0)),x[1]=Math.min(Math.max(x[1],1),v),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(b,S,x,y){const E=b-d(b,x),R=S-d(S,x),N=Math.abs(E-R)-(function(D,T,j){let B=0;const z=D-d(D,j),G=T-d(T,j);for(let U=0;U<Math.abs(z-G);U++){const H=_(D,T)==="A"?-1:1,Y=j.buffer.lines.get(z+H*U);Y!=null&&Y.isWrapped&&B++}return B})(b,S,x);return C(N,w(_(b,S),y))}function d(b,S){let x=0,y=S.buffer.lines.get(b),E=y==null?void 0:y.isWrapped;for(;E&&b>=0&&b<S.rows;)x++,y=S.buffer.lines.get(--b),E=y==null?void 0:y.isWrapped;return x}function _(b,S){return b>S?"A":"B"}function v(b,S,x,y,E,R){let N=b,D=S,T="";for(;N!==x||D!==y;)N+=E?1:-1,E&&N>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,b,N),N=0,b=0,D++):!E&&N<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,b+1),N=R.cols-1,b=N,D--);return T+R.buffer.translateBufferLineToString(D,!1,b,N)}function w(b,S){const x=S?"O":"[";return f.C0.ESC+x+b}function C(b,S){b=Math.floor(b);let x="";for(let y=0;y<b;y++)x+=S;return x}o.moveToCellSequence=function(b,S,x,y){const E=x.buffer.x,R=x.buffer.y;if(!x.buffer.hasScrollback)return(function(T,j,B,z,G,U){return p(j,z,G,U).length===0?"":C(v(T,j,T,j-d(j,G),!1,G).length,w("D",U))})(E,R,0,S,x,y)+p(R,S,x,y)+(function(T,j,B,z,G,U){let H;H=p(j,z,G,U).length>0?z-d(z,G):j;const Y=z,q=(function(X,K,L,M,O,$){let F;return F=p(L,M,O,$).length>0?M-d(M,O):K,X<L&&F<=M||X>=L&&F<M?"C":"D"})(T,j,B,z,G,U);return C(v(T,H,B,Y,q==="C",G).length,w(q,U))})(E,R,b,S,x,y);let N;if(R===S)return N=E>b?"D":"C",C(Math.abs(E-b),w(N,y));N=R>S?"D":"C";const D=Math.abs(R-S);return C((function(T,j){return j.cols-T})(R>S?b:E,x)+(D-1)*x.cols+1+((R>S?E:b)-1),w(N,y))}},1296:function(u,o,c){var f=this&&this.__decorate||function(U,H,Y,q){var X,K=arguments.length,L=K<3?H:q===null?q=Object.getOwnPropertyDescriptor(H,Y):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(U,H,Y,q);else for(var M=U.length-1;M>=0;M--)(X=U[M])&&(L=(K<3?X(L):K>3?X(H,Y,L):X(H,Y))||L);return K>3&&L&&Object.defineProperty(H,Y,L),L},p=this&&this.__param||function(U,H){return function(Y,q){H(Y,q,U)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),w=c(6171),C=c(6052),b=c(4725),S=c(8055),x=c(8460),y=c(844),E=c(2585),R="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let z=1,G=o.DomRenderer=class extends y.Disposable{constructor(U,H,Y,q,X,K,L,M,O,$,F,Q,re){super(),this._terminal=U,this._document=H,this._element=Y,this._screenElement=q,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=$,this._bufferService=F,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${N} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity(U.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;H+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${q} { 50% { box-shadow: none; }}`,H+=`@keyframes ${X} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,H+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of U.ansi.entries())H+=`${this._terminalSelector} .${D}${K} { color: ${L.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${S.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;H+=`${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${v.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,H){for(let Y=this._rowElements.length;Y<=H;Y++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,H){this._refreshRowElements(U,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,H,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,H,Y),this.renderRows(0,this._bufferService.rows-1),!U||!H)return;this._selectionRenderModel.update(this._terminal,U,H,Y);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(Y){const O=U[0]>H[0];M.appendChild(this._createSelectionElement(K,O?H[0]:U[0],O?U[0]:H[0],L-K+1))}else{const O=q===K?U[0]:0,$=K===X?H[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,$));const F=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,F)),K!==L){const Q=X===L?H[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(U,H,Y,q=1){const X=this._document.createElement("div"),K=H*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(Y-H);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=U*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,H){const Y=this._bufferService.buffer,q=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=U;O<=H;O++){const $=O+Y.ydisp,F=this._rowElements[O],Q=Y.lines.get($);if(!F||!Q)break;F.replaceChildren(...this._rowFactory.createRow(Q,$,$===q,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,H,Y,q,X,K){Y<0&&(U=0),q<0&&(H=0);const L=this._bufferService.rows-1;Y=Math.max(Math.min(Y,L),0),q=Math.max(Math.min(q,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,$=Math.min(M.x,X-1),F=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=Y;ae<=q;++ae){const Z=ae+M.ydisp,P=this._rowElements[ae],ee=M.lines.get(Z);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,$,F,this.dimensions.css.cell.width,this._widthCache,K?ae===Y?U:0:-1,K?(ae===q?H:X)-1:-1))}}};o.DomRenderer=G=f([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],G)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,D,T,j){var B,z=arguments.length,G=z<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(N,D,T,j);else for(var U=N.length-1;U>=0;U--)(B=N[U])&&(G=(z<3?B(G):z>3?B(D,T,G):B(D,T))||G);return z>3&&G&&Object.defineProperty(D,T,G),G},p=this&&this.__param||function(N,D){return function(T,j){D(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),w=c(2585),C=c(8055),b=c(4725),S=c(4269),x=c(6171),y=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,D,T,j,B,z,G){this._document=N,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=z,this._themeService=G,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,T){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=T}createRow(N,D,T,j,B,z,G,U,H,Y,q){const X=[],K=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O<z+1&&(O=z+1);let $=0,F="",Q=0,re=0,ae=0,Z=!1,P=0,ee=!1,ne=0;const ge=[],he=Y!==-1&&q!==-1;for(let ye=0;ye<O;ye++){N.loadCell(ye,this._workCell);let be=this._workCell.getWidth();if(be===0)continue;let ke=!1,Ee=ye,Ce=this._workCell;if(K.length>0&&ye===K[0][0]){ke=!0;const Ie=K.shift();Ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),Ee=Ie[1]-1,be=Ce.getWidth()}const rt=this._isCellInSelection(ye,D),bt=T&&ye===z,Ge=he&&ye>=Y&&ye<=q;let ct=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{ct=!0}));let Pt=Ce.getChars()||_.WHITESPACE_CELL_CHAR;if(Pt===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Pt=" "),ne=be*U-H.get(Pt,Ce.isBold(),Ce.isItalic()),M){if($&&(rt&&ee||!rt&&!ee&&Ce.bg===Q)&&(rt&&ee&&L.selectionForeground||Ce.fg===re)&&Ce.extended.ext===ae&&Ge===Z&&ne===P&&!bt&&!ke&&!ct){Ce.isInvisible()?F+=_.WHITESPACE_CELL_CHAR:F+=Pt,$++;continue}$&&(M.textContent=F),M=this._document.createElement("span"),$=0,F=""}else M=this._document.createElement("span");if(Q=Ce.bg,re=Ce.fg,ae=Ce.extended.ext,Z=Ge,P=ne,ee=rt,ke&&z>=ye&&z<=Ee&&(z=ye),!this._coreService.isCursorHidden&&bt&&this._coreService.isCursorInitialized){if(ge.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&ge.push("xterm-cursor-blink"),ge.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ge.push("xterm-cursor-outline");break;case"block":ge.push("xterm-cursor-block");break;case"bar":ge.push("xterm-cursor-bar");break;case"underline":ge.push("xterm-cursor-underline")}}if(Ce.isBold()&&ge.push("xterm-bold"),Ce.isItalic()&&ge.push("xterm-italic"),Ce.isDim()&&ge.push("xterm-dim"),F=Ce.isInvisible()?_.WHITESPACE_CELL_CHAR:Ce.getChars()||_.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(ge.push(`xterm-underline-${Ce.extended.underlineStyle}`),F===" "&&(F=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ie=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ie<8&&(Ie+=8),M.style.textDecorationColor=L.ansi[Ie].css}Ce.isOverline()&&(ge.push("xterm-overline"),F===" "&&(F=" ")),Ce.isStrikethrough()&&ge.push("xterm-strikethrough"),Ge&&(M.style.textDecoration="underline");let ht=Ce.getFgColor(),Fe=Ce.getFgColorMode(),fe=Ce.getBgColor(),ie=Ce.getBgColorMode();const de=!!Ce.isInverse();if(de){const Ie=ht;ht=fe,fe=Ie;const Nt=Fe;Fe=ie,ie=Nt}let Se,Ae,De,Ve=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{Ie.options.layer!=="top"&&Ve||(Ie.backgroundColorRGB&&(ie=50331648,fe=Ie.backgroundColorRGB.rgba>>8&16777215,Se=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(Fe=50331648,ht=Ie.foregroundColorRGB.rgba>>8&16777215,Ae=Ie.foregroundColorRGB),Ve=Ie.options.layer==="top")})),!Ve&&rt&&(Se=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,fe=Se.rgba>>8&16777215,ie=50331648,Ve=!0,L.selectionForeground&&(Fe=50331648,ht=L.selectionForeground.rgba>>8&16777215,Ae=L.selectionForeground)),Ve&&ge.push("xterm-decoration-top"),ie){case 16777216:case 33554432:De=L.ansi[fe],ge.push(`xterm-bg-${fe}`);break;case 50331648:De=C.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(M,`background-color:#${R((fe>>>0).toString(16),"0",6)}`);break;default:de?(De=L.foreground,ge.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):De=L.background}switch(Se||Ce.isDim()&&(Se=C.color.multiplyOpacity(De,.5)),Fe){case 16777216:case 33554432:Ce.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(M,De,L.ansi[ht],Ce,Se,void 0)||ge.push(`xterm-fg-${ht}`);break;case 50331648:const Ie=C.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(M,De,Ie,Ce,Se,Ae)||this._addStyle(M,`color:#${R(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,De,L.foreground,Ce,Se,Ae)||de&&ge.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ge.length&&(M.className=ge.join(" "),ge.length=0),bt||ke||ct?M.textContent=F:$++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ee}return M&&$&&(M.textContent=F),X}_applyMinimumContrast(N,D,T,j,B,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const G=this._getContrastCache(j);let U;if(B||z||(U=G.getColor(D.rgba,T.rgba)),U===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);U=C.color.ensureContrastRatio(B||D,z||T,H),G.setColor((B||D).rgba,(z||T).rgba,U??null)}return!!U&&(this._addStyle(N,`color:${U.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&D>=T[1]&&N<j[0]&&D<=j[1]:N<T[0]&&D>=T[1]&&N>=j[0]&&D<=j[1]:D>T[1]&&D<j[1]||T[1]===j[1]&&D===T[1]&&N>=T[0]&&N<j[0]||T[1]<j[1]&&D===j[1]&&N<j[0]||T[1]<j[1]&&D===T[1]&&N>=T[0])}};function R(N,D,T){for(;N.length<T;)N=D+N;return N}o.DomRendererRowFactory=E=f([p(1,b.ICharacterJoinerService),p(2,w.IOptionsService),p(3,b.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,b.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[p,d,_,v],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(v),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),p&&(_+="I");let v=this._holey.get(_);if(v===void 0){let w=0;f&&(w|=1),p&&(w|=2),v=this._measure(c,w),v>0&&this._holey.set(_,v)}return v}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,_,v){return d===1&&_>Math.ceil(1.5*v)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,_=0){return(p-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,_,v=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,C=d[1]-w,b=_[1]-w,S=Math.max(C,0),x=Math.min(b,p.rows-1);S>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=C,this.viewportEndRow=b,this.viewportCappedStartRow=S,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=_[0])}isCellSelected(p,d,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let w=o.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new b(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([p(2,d.IOptionsService)],w);class C extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends C{constructor(y,E,R){super(),this._document=y,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends C{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),w=c(2585);class C extends d.AttributeData{constructor(x,y,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=C;let b=o.CharacterJoinerService=class dC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===x)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(x){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(x);if(!y||y.length===0)return[];const E=[],R=y.translateToString(!0);let N=0,D=0,T=0,j=y.getFg(0),B=y.getBg(0);for(let z=0;z<y.getTrimmedLength();z++)if(y.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==B){if(z-N>1){const G=this._getJoinedRanges(R,T,D,y,N);for(let U=0;U<G.length;U++)E.push(G[U])}N=z,T=D,j=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const z=this._getJoinedRanges(R,T,D,y,N);for(let G=0;G<z.length;G++)E.push(z[G])}return E}_getJoinedRanges(x,y,E,R,N){const D=x.substring(y,E);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const B=this._characterJoiners[j].handler(D);for(let z=0;z<B.length;z++)dC._mergeRanges(T,B[z])}catch(B){console.error(B)}return this._stringRangesToCellRanges(T,R,N),T}_stringRangesToCellRanges(x,y,E){let R=0,N=!1,D=0,T=x[R];if(T){for(let j=E;j<this._bufferService.cols;j++){const B=y.getWidth(j),z=y.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!N&&T[0]<=D&&(T[0]=j,N=!0),T[1]<=D){if(T[1]=j,T=x[++R],!T)break;T[0]<=D?(T[0]=j,N=!0):N=!1}D+=z}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(x,y){let E=!1;for(let R=0;R<x.length;R++){const N=x[R];if(E){if(y[1]<=N[0])return x[R-1][1]=y[1],x;if(y[1]<=N[1])return x[R-1][1]=Math.max(y[1],N[1]),x.splice(R,1),x;x.splice(R,1),R--}else{if(y[1]<=N[0])return x.splice(R,0,y),x;if(y[1]<=N[1])return N[0]=Math.min(y[0],N[0]),x;y[0]<N[1]&&(N[0]=Math.min(y[0],N[0]),E=!0)}}return E?x[x.length-1][1]=y[1]:x.push(y),x}};o.CharacterJoinerService=b=f([p(0,w.IBufferService)],b)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class _ extends f.Disposable{constructor(C,b,S){super(),this._textarea=C,this._window=b,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=_;class v extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const v=this.linkProviders.indexOf(_);v!==-1&&this.linkProviders.splice(v,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(w,C,b,S){var x,y=arguments.length,E=y<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,C,b,S);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(E=(y<3?x(E):y>3?x(C,b,E):x(C,b))||E);return y>3&&E&&Object.defineProperty(C,b,E),E},p=this&&this.__param||function(w,C){return function(b,S){C(b,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),_=c(9806);let v=o.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,b,S,x){return(0,_.getCoords)(window,w,C,b,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(w,C){const b=(0,_.getCoordsRelativeToElement)(window,w,C);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=v=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],v)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),_=c(4725),v=c(8460),w=c(844),C=c(7226),b=c(2585);let S=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,E,R,N,D,T,j){super(),this._rowCount=x,this._charSizeService=R,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,z)=>this._renderRows(B,z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(y),this._observerDisposable.value=(0,w.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,E){var R;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=E,(R=this._renderer.value)==null||R.handleSelectionChanged(x,y,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=S=f([p(2,b.IOptionsService),p(3,_.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],S)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,z){var G,U=arguments.length,H=U<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,B,z);else for(var Y=T.length-1;Y>=0;Y--)(G=T[Y])&&(H=(U<3?G(H):U>3?G(j,B,H):G(j,B))||H);return U>3&&H&&Object.defineProperty(j,B,H),H},p=this&&this.__param||function(T,j){return function(B,z){j(B,z,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),w=c(4725),C=c(8460),b=c(844),S=c(6114),x=c(4841),y=c(511),E=c(2585),R=" ",N=new RegExp(R,"g");let D=o.SelectionService=class extends b.Disposable{constructor(T,j,B,z,G,U,H,Y,q){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=z,this._coreService=G,this._mouseService=U,this._optionsService=H,this._renderService=Y,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const G=T[0]<j[0]?T[0]:j[0],U=T[0]<j[0]?j[0]:T[0];for(let H=T[1];H<=j[1];H++){const Y=B.translateBufferLineToString(H,!0,G,U);z.push(Y)}}else{const G=T[1]===j[1]?j[0]:void 0;z.push(B.translateBufferLineToString(T[1],!0,T[0],G));for(let U=T[1]+1;U<=j[1]-1;U++){const H=B.lines.get(U),Y=B.translateBufferLineToString(U,!0);H!=null&&H.isWrapped?z[z.length-1]+=Y:z.push(Y)}if(T[1]!==j[1]){const U=B.lines.get(j[1]),H=B.translateBufferLineToString(j[1],!0,0,j[0]);U&&U.isWrapped?z[z.length-1]+=H:z.push(H)}}return z.map((G=>G.replace(N," "))).join(S.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(B&&F&&j)&&this._areCoordsInSelection(j,B,F)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!B||!F)&&this._areCoordsInSelection([T,j],B,F)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]<B[1]||j[1]===B[1]&&T[1]===j[1]&&T[0]>=j[0]&&T[0]<B[0]||j[1]<B[1]&&T[1]===B[1]&&T[0]<B[0]||j[1]<B[1]&&T[1]===j[1]&&T[0]>=j[0]}_selectWordAtCursor(T,j){var Y,H;const B=(H=(Y=this._linkifier.currentLink)==null?void 0:Y.link)==null?void 0:H.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return S.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const F=B.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const F=(0,_.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let F=0;j>=F;F++){const Y=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:Y>1&&j!==F&&(B+=Y-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const Y=this._bufferService.buffer,H=Y.lines.get(T[1]);if(!H)return;const z=Y.translateBufferLineToString(T[1],!1);let V=this._convertViewportColToCharacterIndex(H,T[0]),G=V;const X=T[0]-V;let K=0,L=0,M=0,O=0;if(z.charAt(V)===" "){for(;V>0&&z.charAt(V-1)===" ";)V--;for(;G<z.length&&z.charAt(G+1)===" ";)G++}else{let Q=T[0],re=T[0];H.getWidth(Q)===0&&(K++,Q--),H.getWidth(re)===2&&(L++,re++);const ae=H.getString(re).length;for(ae>1&&(O+=ae-1,G+=ae-1);Q>0&&V>0&&!this._isCharWordSeparator(H.loadCell(Q-1,this._workCell));){H.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,V-=Z-1),V--,Q--}for(;re<H.length&&G+1<z.length&&!this._isCharWordSeparator(H.loadCell(re+1,this._workCell));){H.loadCell(re+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,re++):Z>1&&(O+=Z-1,G+=Z-1),G++,re++}}G++;let $=V+X-K+M,U=Math.min(this._bufferService.cols,G-V+K+L-M-O);if(j||z.slice(V,G).trim()!==""){if(B&&$===0&&H.getCodePoint(0)!==32){const Q=Y.lines.get(T[1]-1);if(Q&&H.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const ae=this._bufferService.cols-re.start;$-=ae,U+=ae}}}if(F&&$+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Q=Y.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&(U+=re.length)}}return{start:$,length:U}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,w.IMouseService),p(6,E.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],D)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(D,T,j,B){var F,Y=arguments.length,H=Y<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(D,T,j,B);else for(var z=D.length-1;z>=0;z--)(F=D[z])&&(H=(Y<3?F(H):Y>3?F(T,j,H):F(T,j))||H);return Y>3&&H&&Object.defineProperty(T,j,H),H},p=this&&this.__param||function(D,T){return function(j,B){T(j,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),w=c(844),C=c(2585),b=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),x=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],F=T[j/6%6|0],Y=T[j%6];D.push({css:_.channels.toCss(B,F,Y),rgba:_.channels.toRgba(B,F,Y)})}for(let j=0;j<24;j++){const B=8+10*j;D.push({css:_.channels.toCss(B,B,B),rgba:_.channels.toRgba(B,B,B)})}return D})());let R=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:S,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(S,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=N(D.foreground,b),T.background=N(D.background,S),T.cursor=N(D.cursor,x),T.cursorAccent=N(D.cursorAccent,y),T.selectionBackgroundTransparent=N(D.selectionBackground,E),T.selectionBackgroundOpaque=_.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=_.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?N(D.selectionForeground,_.NULL_COLOR):void 0,T.selectionForeground===_.NULL_COLOR&&(T.selectionForeground=void 0),_.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=_.color.opacity(T.selectionBackgroundTransparent,.3)),_.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=_.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(D.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(D.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(D.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(D.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(D.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(D.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(D.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(D.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<j;B++)T.ansi[B+16]=N(D.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,T){if(D!==void 0)try{return _.css.toColor(D)}catch{}return T}o.ThemeService=R=f([p(0,C.IOptionsService)],R)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const w=new Array(v);for(let C=0;C<Math.min(v,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let w=this._length;w<v;w++)this._array[w]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,w){this._array[this._getCyclicIndex(v)]=w}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,w,...C){if(w){for(let b=v;b<this._length-w;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+w)];this._length-=w,this.onDeleteEmitter.fire({index:v,amount:w})}for(let b=this._length-1;b>=v;b--)this._array[this._getCyclicIndex(b+C.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<C.length;b++)this._array[this._getCyclicIndex(v+b)]=C[b];if(C.length&&this.onInsertEmitter.fire({index:v,amount:C.length}),this._length+C.length>this._maxLength){const b=this._length+C.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=C.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,w,C){if(!(w<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let S=w-1;S>=0;S--)this.set(v+S+C,this.get(v+S));const b=v+w+C-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<w;b++)this.set(v+b+C,this.get(v+b))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}o.CircularList=d},1439:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=p<=1?f[_]:f[_]&&c(f[_],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var _,v,w,C,b;function S(y){const E=y.toString(16);return E.length<2?"0"+E:E}function x(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,R,N,D){return D!==void 0?`#${S(E)}${S(R)}${S(N)}${S(D)}`:`#${S(E)}${S(R)}${S(N)}`},y.toRgba=function(E,R,N,D=255){return(E<<24|R<<16|N<<8|D)>>>0},y.toColor=function(E,R,N,D){return{css:y.toCss(E,R,N,D),rgba:y.toRgba(E,R,N,D)}}})(_||(o.channels=_={})),(function(y){function E(R,N){return d=Math.round(255*N),[c,f,p]=b.toChannels(R.rgba),{css:_.toCss(c,f,p,d),rgba:_.toRgba(c,f,p,d)}}y.blend=function(R,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=R.rgba>>24&255,F=R.rgba>>16&255,Y=R.rgba>>8&255;return c=B+Math.round((D-B)*d),f=F+Math.round((T-F)*d),p=Y+Math.round((j-Y)*d),{css:_.toCss(c,f,p),rgba:_.toRgba(c,f,p)}},y.isOpaque=function(R){return(255&R.rgba)==255},y.ensureContrastRatio=function(R,N,D){const T=b.ensureContrastRatio(R.rgba,N.rgba,D);if(T)return _.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(R){const N=(255|R.rgba)>>>0;return[c,f,p]=b.toChannels(N),{css:_.toCss(c,f,p),rgba:N}},y.opacity=E,y.multiplyOpacity=function(R,N){return d=255&R.rgba,E(R,d*N/255)},y.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(v||(o.color=v={})),(function(y){let E,R;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),_.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),_.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(c,f,p,d);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,p,d),css:N}}})(w||(o.css=w={})),(function(y){function E(R,N,D){const T=R/255,j=N/255,B=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},y.relativeLuminance2=E})(C||(o.rgb=C={})),(function(y){function E(N,D,T){const j=N>>24&255,B=N>>16&255,F=N>>8&255;let Y=D>>24&255,H=D>>16&255,z=D>>8&255,V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));for(;V<T&&(Y>0||H>0||z>0);)Y-=Math.max(0,Math.ceil(.1*Y)),H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));return(Y<<24|H<<16|z<<8|255)>>>0}function R(N,D,T){const j=N>>24&255,B=N>>16&255,F=N>>8&255;let Y=D>>24&255,H=D>>16&255,z=D>>8&255,V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));for(;V<T&&(Y<255||H<255||z<255);)Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));return(Y<<24|H<<16|z<<8|255)>>>0}y.blend=function(N,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,j=D>>16&255,B=D>>8&255,F=N>>24&255,Y=N>>16&255,H=N>>8&255;return c=F+Math.round((T-F)*d),f=Y+Math.round((j-Y)*d),p=H+Math.round((B-H)*d),_.toRgba(c,f,p)},y.ensureContrastRatio=function(N,D,T){const j=C.relativeLuminance(N>>8),B=C.relativeLuminance(D>>8);if(x(j,B)<T){if(B<j){const H=E(N,D,T),z=x(j,C.relativeLuminance(H>>8));if(z<T){const V=R(N,D,T);return z>x(j,C.relativeLuminance(V>>8))?H:V}return H}const F=R(N,D,T),Y=x(j,C.relativeLuminance(F>>8));if(Y<T){const H=E(N,D,T);return Y>x(j,C.relativeLuminance(H>>8))?F:H}return F}},y.reduceLuminance=E,y.increaseLuminance=R,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(b||(o.rgba=b={})),o.toPaddedHex=S,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),_=c(7866),v=c(744),w=c(7302),C=c(6975),b=c(8460),S=c(1753),x=c(1480),y=c(7994),E=c(9282),R=c(5435),N=c(5981),D=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((F=>{var Y;(Y=this._onScrollApi)==null||Y.fire(F.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(F){for(const Y in F)this.optionsService.options[Y]=F[Y]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(F)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((Y,H)=>this._inputHandler.parse(Y,H)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,Y){this._writeBuffer.write(F,Y)}writeSync(F,Y){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,Y)}input(F,Y=!0){this.coreService.triggerDataEvent(F,Y)}resize(F,Y){isNaN(F)||isNaN(Y)||(F=Math.max(F,v.MINIMUM_COLS),Y=Math.max(Y,v.MINIMUM_ROWS),this._bufferService.resize(F,Y))}scroll(F,Y=!1){this._bufferService.scroll(F,Y)}scrollLines(F,Y,H){this._bufferService.scrollLines(F,Y,H)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const Y=F-this._bufferService.buffer.ydisp;Y!==0&&this.scrollLines(Y)}registerEscHandler(F,Y){return this._inputHandler.registerEscHandler(F,Y)}registerDcsHandler(F,Y){return this._inputHandler.registerDcsHandler(F,Y)}registerCsiHandler(F,Y){return this._inputHandler.registerCsiHandler(F,Y)}registerOscHandler(F,Y){return this._inputHandler.registerOscHandler(F,Y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const Y=this.optionsService.rawOptions.windowsPty;Y&&Y.buildNumber!==void 0&&Y.buildNumber!==void 0?F=Y.backend==="conpty"&&Y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const Y of F)Y.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const p=[];for(let d=0;d<this._listeners.length;d++)p.push(this._listeners[d]);for(let d=0;d<p.length;d++)p[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c((p=>f.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var $,U=arguments.length,Q=U<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)($=K[re])&&(Q=(U<3?$(Q):U>3?$(L,M,Q):$(L,M))||Q);return U>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),w=c(844),C=c(482),b=c(8437),S=c(8460),x=c(643),y=c(511),E=c(3734),R=c(2585),N=c(1480),D=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function Y(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var H;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let z=0;class V extends w.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,$,U,Q,re,ae,Z=new v.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=$,this._optionsService=U,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=ae,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ee.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((P,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ee,payload:ne})})),this._parser.setPrintHandler(((P,ee,ne)=>this.print(P,ee,ne))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new D.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new D.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new D.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new D.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new D.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new D.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new D.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new D.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new D.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new D.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((P,ee)=>this.requestStatusString(P,ee))))}_preserveStack(L,M,O,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=$}_logSlowResolvingAsync(L){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,$=this._activeBuffer.x,U=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;$=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>F&&(Q=this._parseStack.position+F)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(P=>String.fromCharCode(P))).join("")}"`),typeof L=="string"?L.split("").map((P=>P.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(L.length,F))),re||this._dirtyRowTracker.clearRange(),L.length>F)for(let P=Q;P<L.length;P+=F){const ee=P+F<L.length?P+F:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(P,ee),this._parseBuffer):this._utf8Decoder.decode(L.subarray(P,ee),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ne))return this._preserveStack($,U,ne,P),this._logSlowResolvingAsync(O),O}else if(!re){const P=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack($,U,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===$&&this._activeBuffer.y===U||this._onCursorMove.fire();const ae=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(ae,this._bufferService.rows-1))}print(L,M,O){let $,U;const Q=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ee=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let ge=this._parser.precedingJoinState;for(let he=M;he<O;++he){if($=L[he],$<127&&Q){const Ee=Q[String.fromCharCode($)];Ee&&($=Ee.charCodeAt(0))}const ye=this._unicodeService.charProperties($,ge);U=N.UnicodeService.extractWidth(ye);const be=N.UnicodeService.extractShouldJoin(ye),ke=be?N.UnicodeService.extractWidth(ge):0;if(ge=ye,re&&this._onA11yChar.fire((0,C.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-ke>ae){if(Z){const Ee=ne;let Ce=this._activeBuffer.x-ke;for(this._activeBuffer.x=ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ke>0&&ne instanceof b.BufferLine&&ne.copyCellsFrom(Ee,Ce,0,ke,!1);Ce<ae;)Ee.setCellFromCodepoint(Ce++,0,1,ee)}else if(this._activeBuffer.x=ae-1,U===2)continue}if(be&&this._activeBuffer.x){const Ee=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-Ee,$,U);for(let Ce=U-ke;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(P&&(ne.insertCells(this._activeBuffer.x,U-ke,this._activeBuffer.getNullCell(ee)),ne.getWidth(ae-1)===2&&ne.setCellFromCodepoint(ae-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,$,U,ee),U>0)for(;--U;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=ge,this._activeBuffer.x<ae&&O-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!Y(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,$=!1,U=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),U),$&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O<this._bufferService.rows;O++)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;M--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;M--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const O=L.params[0]||1,$=N.UnicodeService.extractWidth(M),U=this._activeBuffer.x-$,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),re=new Uint32Array(Q.length*O);let ae=0;for(let P=0;P<Q.length;){const ee=Q.codePointAt(P)||0;re[ae++]=ee,P+=ee>65535?2:1}let Z=ae;for(let P=1;P<O;++P)re.copyWithin(Z,0,ae),Z+=ae;return this.print(re,0,Z),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const O=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:U}=this._coreMouseService,Q=this._coreService,{buffers:re,cols:ae}=this._bufferService,{active:Z,alt:P}=re,ee=this._optionsService.rawOptions,ne=be=>be?1:2,ge=L.params[0];return he=ge,ye=M?ge===2?4:ge===4?ne(Q.modes.insertMode):ge===12?3:ge===20?ne(ee.convertEol):0:ge===1?ne(O.applicationCursorKeys):ge===3?ee.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ge===6?ne(O.origin):ge===7?ne(O.wraparound):ge===8?3:ge===9?ne($==="X10"):ge===12?ne(ee.cursorBlink):ge===25?ne(!Q.isCursorHidden):ge===45?ne(O.reverseWraparound):ge===66?ne(O.applicationKeypad):ge===67?4:ge===1e3?ne($==="VT200"):ge===1002?ne($==="DRAG"):ge===1003?ne($==="ANY"):ge===1004?ne(O.sendFocus):ge===1005?4:ge===1006?ne(U==="SGR"):ge===1015?4:ge===1016?ne(U==="SGR_PIXELS"):ge===1048?1:ge===47||ge===1047||ge===1049?ne(Z===P):ge===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${he};${ye}$y`),!0;var he,ye}_updateAttrColor(L,M,O,$,U){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,$,U])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const $=[0,0,-1,0,0,0];let U=0,Q=0;do{if($[Q+U]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let ae=0;do $[1]===5&&(U=1),$[Q+ae+1+U]=re[ae];while(++ae<re.length&&ae+Q+1+U<$.length);break}if($[1]===5&&Q+U>=2||$[1]===2&&Q+U>=5)break;$[1]&&(U=1)}while(++Q+M<L.length&&Q+U<$.length);for(let re=2;re<$.length;++re)$[re]===-1&&($[re]=0);switch($[0]){case 38:O.fg=this._updateAttrColor(O.fg,$[1],$[3],$[4],$[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,$[1],$[3],$[4],$[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,$[1],$[3],$[4],$[5])}return Q}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=b.DEFAULT_ATTR_DATA.fg,L.bg=b.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const $=this._curAttrData;for(let U=0;U<M;U++)O=L.params[U],O>=30&&O<=37?($.fg&=-50331904,$.fg|=16777216|O-30):O>=40&&O<=47?($.bg&=-50331904,$.bg|=16777216|O-40):O>=90&&O<=97?($.fg&=-50331904,$.fg|=16777224|O-90):O>=100&&O<=107?($.bg&=-50331904,$.bg|=16777224|O-100):O===0?this._processSGR0($):O===1?$.fg|=134217728:O===3?$.bg|=67108864:O===4?($.fg|=268435456,this._processUnderline(L.hasSubParams(U)?L.getSubParams(U)[0]:1,$)):O===5?$.fg|=536870912:O===7?$.fg|=67108864:O===8?$.fg|=1073741824:O===9?$.fg|=2147483648:O===2?$.bg|=134217728:O===21?this._processUnderline(2,$):O===22?($.fg&=-134217729,$.bg&=-134217729):O===23?$.bg&=-67108865:O===24?($.fg&=-268435457,this._processUnderline(0,$)):O===25?$.fg&=-536870913:O===27?$.fg&=-67108865:O===28?$.fg&=-1073741825:O===29?$.fg&=2147483647:O===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):O===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?U+=this._extractColor(L,U,$):O===53?$.bg|=1073741824:O===55?$.bg&=-1073741825:O===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):O===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!Y(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const $=O.shift(),U=O.shift();if(/^\d+$/.exec($)){const Q=parseInt($);if(X(Q))if(U==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)(U);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let $;const U=O.findIndex((Q=>Q.startsWith("id=")));return U!==-1&&($=O[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let $=0;$<O.length&&!(M>=this._specialColors.length);++$,++M)if(O[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const U=(0,j.parseColor)(O[$]);U&&this._onColor.fire([{type:1,index:this._specialColors[M],color:U}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let $=0;$<O.length;++$)if(/^\d+$/.exec(O[$])){const U=parseInt(O[$]);X(U)&&M.push({type:2,index:U})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(B[L[0]],_.CHARSETS[L[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const O=this._activeBuffer.ybase+this._activeBuffer.y+M,$=this._activeBuffer.lines.get(O);$&&($.fill(L),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const O=this._bufferService.buffer,$=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=V;let G=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(z=K,K=L,L=z),K<this.start&&(this.start=K),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}G=f([p(0,R.IBufferService)],G)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,_){this._data[p]||(this._data[p]={}),this._data[p][d]=_}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,_,v){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,_,v)}get(f,p,d,_){var v;return(v=this._data.get(f,p))==null?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,p){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let p=0,d=this._array.length-1;for(;d>=p;){let _=p+d>>1;const v=this._getKey(this._array[_]);if(v>f)d=_-1;else{if(!(v<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}p=_+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let w=0,C=0,b=v.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),S=v.timeRemaining(),1.5*C>S)return b-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-w))}ms`),void this._start();b=S}this.clear()}}class d extends p{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=d==null?void 0:d.get(p.cols-1),v=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);v&&_&&(v.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),_=c(8437),v=c(4634),w=c(511),C=c(643),b=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,E){this._hasScrollback=x,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&x<this._rows}_getCorrectBufferLength(x){if(!this._hasScrollback)return x;const y=x+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<x)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(x,E);let D=0;if(this._rows<y)for(let T=this._rows;T<y;T++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(x,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(x,E)));else for(let T=this._rows;T>y;T--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const T=this.lines.length-N;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(x,E);this._cols=x,this._rows=y,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const E=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,v.reflowLargerCreateNewLayout)(this.lines,E);(0,v.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(x,y,R.countRemoved)}}_reflowLargerAdjustViewport(x,y,E){const R=this.getNullCell(_.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(x,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),R=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),j.unshift(T);const B=this.ybase+this.y;if(B>=D&&B<D+j.length)continue;const F=j[j.length-1].getTrimmedLength(),Y=(0,v.reflowSmallerGetNewLineLengths)(j,this._cols,x),H=Y.length-j.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const V=[];for(let O=0;O<H;O++){const $=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);V.push($)}V.length>0&&(R.push({start:D+j.length+N,newLines:V}),N+=V.length),j.push(...V);let G=Y.length-1,X=Y[G];X===0&&(G--,X=Y[G]);let K=j.length-H-1,L=F;for(;K>=0;){const O=Math.min(L,X);if(j[G]===void 0)break;if(j[G].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(G--,X=Y[G]),L-=O,L===0){K--;const $=Math.max(K,0);L=(0,v.getWrappedLineTrimmedLength)(j,$,this._cols)}}for(let O=0;O<j.length;O++)Y[O]<x&&j[O].setCell(Y[O],E);let M=H-z;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+N)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+y-1)}if(R.length>0){const D=[],T=[];for(let G=0;G<this.lines.length;G++)T.push(this.lines.get(G));const j=this.lines.length;let B=j-1,F=0,Y=R[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let H=0;for(let G=Math.min(this.lines.maxLength-1,j+N-1);G>=0;G--)if(Y&&Y.start>B+H){for(let X=Y.newLines.length-1;X>=0;X--)this.lines.set(G--,Y.newLines[X]);G++,D.push({index:B+1,amount:Y.newLines.length}),H+=Y.newLines.length,Y=R[++F]}else this.lines.set(G,T[B--]);let z=0;for(let G=D.length-1;G>=0;G--)D[G].index+=z,this.lines.onInsertEmitter.fire(D[G]),z+=D[G].amount;const V=Math.max(0,j+N-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(x,y,E=0,R){const N=this.lines.get(x);return N?N.translateToString(y,E,R):""}getWrappedRangeForLine(x){let y=x,E=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(x){for(x!=null?this.tabs[x]||(x=this.prevStop(x)):(this.tabs={},x=0);x<this._cols;x+=this._optionsService.rawOptions.tabStopWidth)this.tabs[x]=!0}prevStop(x){for(x==null&&(x=this.x);!this.tabs[--x]&&x>0;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x<this._cols;);return x>=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===x&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].dispose(),this.markers.splice(x--,1);this._isClearing=!1}addMarker(x){const y=new b.Marker(x);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let v=0;class w{constructor(b,S,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=S||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){const S=this._data[3*b+0],x=2097151&S;return[this._data[3*b+1],2097152&S?this._combined[b]:x?(0,_.stringFromCodePoint)(x):"",S>>22,2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):x]}set(b,S){this._data[3*b+1]=S[d.CHAR_DATA_ATTR_INDEX],S[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=S[1],this._data[3*b+0]=2097152|b|S[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&S}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b]:2097151&S?(0,_.stringFromCodePoint)(2097151&S):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,S){return v=3*b,S.content=this._data[v+0],S.fg=this._data[v+1],S.bg=this._data[v+2],2097152&S.content&&(S.combinedData=this._combined[b]),268435456&S.bg&&(S.extended=this._extendedAttrs[b]),S}setCell(b,S){2097152&S.content&&(this._combined[b]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=S.content,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}setCellFromCodepoint(b,S,x,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=S|x<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,S,x){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,_.stringFromCodePoint)(S):2097151&y?(this._combined[b]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(S),y&=-2097152,y|=2097152):y=S|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*b+0]=y}insertCells(b,S,x){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length-b){const y=new p.CellData;for(let E=this.length-b-S-1;E>=0;--E)this.setCell(b+S+E,this.loadCell(b+E,y));for(let E=0;E<S;++E)this.setCell(b+E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,x)}deleteCells(b,S,x){if(b%=this.length,S<this.length-b){const y=new p.CellData;for(let E=0;E<this.length-b-S;++E)this.setCell(b+E,this.loadCell(b+S+E,y));for(let E=this.length-S;E<this.length;++E)this.setCell(E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,x)}replaceCells(b,S,x,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.isProtected(b)||this.setCell(b,x),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.setCell(b++,x)}resize(b,S){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const x=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,S)}else{this._data=this._data.subarray(0,x);const y=Object.keys(this._combined);for(let R=0;R<y.length;R++){const N=parseInt(y[R],10);N>=b&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let R=0;R<E.length;R++){const N=parseInt(E[R],10);N>=b&&delete this._extendedAttrs[N]}}return this.length=b,4*x*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,S=!1){if(S)for(let x=0;x<this.length;++x)this.isProtected(x)||this.setCell(x,b);else{this._combined={},this._extendedAttrs={};for(let x=0;x<this.length;++x)this.setCell(x,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const S in b._combined)this._combined[S]=b._combined[S];this._extendedAttrs={};for(const S in b._extendedAttrs)this._extendedAttrs[S]=b._extendedAttrs[S];this.isWrapped=b.isWrapped}clone(){const b=new w(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const S in this._combined)b._combined[S]=this._combined[S];for(const S in this._extendedAttrs)b._extendedAttrs[S]=this._extendedAttrs[S];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,S,x,y,E){const R=b._data;if(E)for(let D=y-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}else for(let D=0;D<y;D++){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}const N=Object.keys(b._combined);for(let D=0;D<N.length;D++){const T=parseInt(N[D],10);T>=S&&(this._combined[T-S+x]=b._combined[T])}}translateToString(b,S,x,y){S=S??0,x=x??this.length,b&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;S<x;){const R=this._data[3*S+0],N=2097151&R,D=2097152&R?this._combined[S]:N?(0,_.stringFromCodePoint)(N):d.WHITESPACE_CELL_CHAR;if(E+=D,y)for(let T=0;T<D.length;++T)y.push(S);S+=R>>22||1}return y&&y.push(S),E}}o.BufferLine=w},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const _=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,v=f[p+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,_,v){const w=[];for(let C=0;C<f.length-1;C++){let b=C,S=f.get(++b);if(!S.isWrapped)continue;const x=[f.get(C)];for(;b<f.length&&S.isWrapped;)x.push(S),S=f.get(++b);if(_>=C&&_<b){C+=x.length-1;continue}let y=0,E=c(x,y,p),R=1,N=0;for(;R<x.length;){const T=c(x,R,p),j=T-N,B=d-E,F=Math.min(j,B);x[y].copyCellsFrom(x[R],N,E,F,!1),E+=F,E===d&&(y++,E=0),N+=F,N===T&&(R++,N=0),E===0&&y!==0&&x[y-1].getWidth(d-1)===2&&(x[y].copyCellsFrom(x[y-1],d-1,E++,1,!1),x[y-1].setCell(d-1,v))}x[y].replaceCells(E,d,v);let D=0;for(let T=x.length-1;T>0&&(T>y||x[T].getTrimmedLength()===0);T--)D++;D>0&&(w.push(C+x.length-D),w.push(D)),C+=x.length-1}return w},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let _=0,v=p[_],w=0;for(let C=0;C<f.length;C++)if(v===C){const b=p[++_];f.onDeleteEmitter.fire({index:C-w,amount:b}),C+=b-1,w+=b,v=p[++_]}else d.push(C);return{layout:d,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,p){const d=[];for(let _=0;_<p.length;_++)d.push(f.get(p[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=p.length},o.reflowSmallerGetNewLineLengths=function(f,p,d){const _=[],v=f.map(((S,x)=>c(f,x,p))).reduce(((S,x)=>S+x));let w=0,C=0,b=0;for(;b<v;){if(v-b<d){_.push(v-b);break}w+=d;const S=c(f,C,p);w>S&&(w-=S,C++);const x=f[C].getWidth(w-1)===2;x&&w--;const y=x?d-1:d;_.push(y),b+=y}return _},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class _ extends p.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=_},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const C=new _;return C.setFromCharData(w),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const b=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const S=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(b-55296)+S-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,_,v,w){const C={type:0,cancel:!1,key:void 0},b=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:C.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(C.key=f.C0.ESC+C.key);break;case 9:if(d.shiftKey){C.key=f.C0.ESC+"[Z";break}C.key=f.C0.HT,C.cancel=!0;break;case 13:C.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,C.cancel=!0;break;case 27:C.key=f.C0.ESC,d.altKey&&(C.key=f.C0.ESC+f.C0.ESC),C.cancel=!0;break;case 37:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"D",C.key===f.C0.ESC+"[1;3D"&&(C.key=f.C0.ESC+(v?"b":"[1;5D"))):C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"C",C.key===f.C0.ESC+"[1;3C"&&(C.key=f.C0.ESC+(v?"f":"[1;5C"))):C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"A",v||C.key!==f.C0.ESC+"[1;3A"||(C.key=f.C0.ESC+"[1;5A")):C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"B",v||C.key!==f.C0.ESC+"[1;3B"||(C.key=f.C0.ESC+"[1;5B")):C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(C.key=f.C0.ESC+"[2~");break;case 46:C.key=b?f.C0.ESC+"[3;"+(b+1)+"~":f.C0.ESC+"[3~";break;case 36:C.key=b?f.C0.ESC+"[1;"+(b+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:C.key=b?f.C0.ESC+"[1;"+(b+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?C.type=2:d.ctrlKey?C.key=f.C0.ESC+"[5;"+(b+1)+"~":C.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?C.type=3:d.ctrlKey?C.key=f.C0.ESC+"[6;"+(b+1)+"~":C.key=f.C0.ESC+"[6~";break;case 112:C.key=b?f.C0.ESC+"[1;"+(b+1)+"P":f.C0.ESC+"OP";break;case 113:C.key=b?f.C0.ESC+"[1;"+(b+1)+"Q":f.C0.ESC+"OQ";break;case 114:C.key=b?f.C0.ESC+"[1;"+(b+1)+"R":f.C0.ESC+"OR";break;case 115:C.key=b?f.C0.ESC+"[1;"+(b+1)+"S":f.C0.ESC+"OS";break;case 116:C.key=b?f.C0.ESC+"[15;"+(b+1)+"~":f.C0.ESC+"[15~";break;case 117:C.key=b?f.C0.ESC+"[17;"+(b+1)+"~":f.C0.ESC+"[17~";break;case 118:C.key=b?f.C0.ESC+"[18;"+(b+1)+"~":f.C0.ESC+"[18~";break;case 119:C.key=b?f.C0.ESC+"[19;"+(b+1)+"~":f.C0.ESC+"[19~";break;case 120:C.key=b?f.C0.ESC+"[20;"+(b+1)+"~":f.C0.ESC+"[20~";break;case 121:C.key=b?f.C0.ESC+"[21;"+(b+1)+"~":f.C0.ESC+"[21~";break;case 122:C.key=b?f.C0.ESC+"[23;"+(b+1)+"~":f.C0.ESC+"[23~";break;case 123:C.key=b?f.C0.ESC+"[24;"+(b+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!w||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?C.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(C.key=f.C0.US),d.key==="@"&&(C.key=f.C0.NUL)):d.keyCode===65&&(C.type=1);else{const S=p[d.keyCode],x=S==null?void 0:S[d.shiftKey?1:0];if(x)C.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(y);d.shiftKey&&(E=E.toUpperCase()),C.key=f.C0.ESC+E}else if(d.keyCode===32)C.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),C.key=f.C0.ESC+y,C.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?C.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?C.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?C.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?C.key=f.C0.DEL:d.keyCode===219?C.key=f.C0.ESC:d.keyCode===220?C.key=f.C0.FS:d.keyCode===221&&(C.key=f.C0.GS)}return C}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let _=f;_<p;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?f[d++]=1024*(this._interim-55296)+v-56320+65536:(f[d++]=this._interim,f[d++]=v),this._interim=0}for(let v=_;v<p;++v){const w=c.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=p)return this._interim=w,d;const C=c.charCodeAt(v);56320<=C&&C<=57343?f[d++]=1024*(w-55296)+C-56320+65536:(f[d++]=w,f[d++]=C)}else w!==65279&&(f[d++]=w)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,_,v,w,C=0,b=0,S=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)R<<=6,R|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-D;for(;S<j;){if(S>=p)return 0;if(N=c[S++],(192&N)!=128){S--,E=!0;break}this.interim[D++]=N,R<<=6,R|=63&N}E||(T===2?R<128?S--:f[C++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(f[C++]=R):R<65536||R>1114111||(f[C++]=R)),this.interim.fill(0)}const x=p-4;let y=S;for(;y<p;){for(;!(!(y<x)||128&(d=c[y])||128&(_=c[y+1])||128&(v=c[y+2])||128&(w=c[y+3]));)f[C++]=d,f[C++]=_,f[C++]=v,f[C++]=w,y+=4;if(d=c[y++],d<128)f[C++]=d;else if((224&d)==192){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(b=(31&d)<<6|63&_,b<128){y--;continue}f[C++]=b}else if((240&d)==224){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(b=(15&d)<<12|(63&_)<<6|63&v,b<2048||b>=55296&&b<=57343||b===65279)continue;f[C++]=b}else if((248&d)==240){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,C;if(w=c[y++],(192&w)!=128){y--;continue}if(b=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&w,b<65536||b>1114111)continue;f[C++]=b}}return C}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let v=0;v<p.length;++v)_.fill(0,p[v][0],p[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?_[v]:(function(w,C){let b,S=0,x=C.length-1;if(w<C[0][0]||w>C[x][1])return!1;for(;x>=S;)if(b=S+x>>1,w>C[b][1])S=b+1;else{if(!(w<C[b][0]))return!0;x=b-1}return!1})(v,d)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,w){let C=this.wcwidth(v),b=C===0&&w!==0;if(b){const S=f.UnicodeService.extractWidth(w);S===0?b=!1:S>C&&(C=S)}return f.UnicodeService.createPropertyValue(0,C,b)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w)}_innerWrite(v=0,w=!0){const C=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],S=this._action(b,w);if(S){const y=E=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(C,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,_){const v=d.toString(16),w=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const w=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/w*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/w*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,w=[0,0,0];for(let C=0;C<3;++C){const b=parseInt(_.slice(v*C,v*C+v),16);w[C]=v===1?b<<4:v===2?b:v===3?b>>4:b>>8}return w}},o.toRgbString=function(d,_=16){const[v,w,C]=d;return`rgb:${p(v,_)}/${p(w,_)}/${p(C,_)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const b=this._handlers[w];return b.push(C),{dispose:()=>{const S=b.indexOf(C);S!==-1&&b.splice(S,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,b){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(w,C,b);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,C,b))}unhook(w,C=!0){if(this._active.length){let b=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,b=C,x=this._stack.fallThrough,this._stack.paused=!1),!x&&b===!1){for(;S>=0&&(b=this._active[S].unhook(w),b!==!0);S--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,b;S--}for(;S>=0;S--)if(b=this._active[S].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const v=new p.Params;v.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=v,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():v,this._data="",this._hitLimit=!1}put(w,C,b){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,C,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((b=>(this._params=v,this._data="",this._hitLimit=!1,b)));return this._params=v,this._data="",this._hitLimit=!1,C}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),_=c(6351);class v{constructor(S){this.table=new Uint8Array(S)}setDefault(S,x){this.table.fill(S<<4|x)}add(S,x,y,E){this.table[x<<8|S]=y<<4|E}addMany(S,x,y,E){for(let R=0;R<S.length;R++)this.table[x<<8|S[R]]=y<<4|E}}o.TransitionTable=v;const w=160;o.VT500_TRANSITION_TABLE=(function(){const b=new v(4095),S=Array.apply(null,Array(256)).map(((D,T)=>T)),x=(D,T)=>S.slice(D,T),y=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const R=x(0,14);let N;for(N in b.setDefault(1,0),b.addMany(y,0,2,0),R)b.addMany([24,26,153,154],N,3,0),b.addMany(x(128,144),N,3,0),b.addMany(x(144,152),N,3,0),b.add(156,N,0,0),b.add(27,N,11,1),b.add(157,N,4,8),b.addMany([152,158,159],N,0,7),b.add(155,N,11,3),b.add(144,N,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(x(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(x(64,127),3,7,0),b.addMany(x(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(x(48,60),4,8,4),b.addMany(x(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(x(32,64),6,0,6),b.add(127,6,0,6),b.addMany(x(64,127),6,0,0),b.addMany(x(32,48),3,9,5),b.addMany(x(32,48),5,9,5),b.addMany(x(48,64),5,0,6),b.addMany(x(64,127),5,7,0),b.addMany(x(32,48),4,9,5),b.addMany(x(32,48),1,9,2),b.addMany(x(32,48),2,9,2),b.addMany(x(48,127),2,10,0),b.addMany(x(48,80),1,10,0),b.addMany(x(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(x(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(x(28,32),9,0,9),b.addMany(x(32,48),9,9,12),b.addMany(x(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(x(32,128),11,0,11),b.addMany(x(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(x(28,32),10,0,10),b.addMany(x(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(x(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(x(28,32),12,0,12),b.addMany(x(32,48),12,9,12),b.addMany(x(48,64),12,0,11),b.addMany(x(64,127),12,12,13),b.addMany(x(64,127),10,12,13),b.addMany(x(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(w,0,2,0),b.add(w,8,5,8),b.add(w,6,0,6),b.add(w,11,0,11),b.add(w,13,13,13),b})();class C extends f.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,x=[64,126]){let y=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=S.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<S.intermediates.length;++R){const N=S.intermediates.charCodeAt(R);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=E,y}identToString(S){const x=[];for(;S;)x.push(String.fromCharCode(255&S)),S>>=8;return x.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,x){const y=this._identifier(S,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,x){this._executeHandlers[S.charCodeAt(0)]=x}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,x){const y=this._identifier(S);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,x){return this._dcsParser.registerHandler(this._identifier(S),x)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,x){return this._oscParser.registerHandler(S,x)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,x,y,E,R){this._parseStack.state=S,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(S,x,y){let E,R=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(R=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=S[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<x;++T){switch(R=S[T],N=this._transitions.table[this.currentState<<8|(R<160?R:w)],N>>4){case 2:for(let H=T+1;;++H){if(H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|R];let B=j?j.length-1:-1;for(;B>=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<x&&(R=S[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const F=this._escHandlers[this._collect<<8|R];let Y=F?F.length-1:-1;for(;Y>=0&&(E=F[Y](),E!==!0);Y--)if(E instanceof Promise)return this._preserveStack(4,F,Y,N,T),E;Y<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let H=T+1;;++H)if(H>=x||(R=S[H])===24||R===26||R===27||R>127&&R<w){this._dcsParser.put(S,T,H),T=H-1;break}break;case 14:if(E=this._dcsParser.unhook(R!==24&&R!==26),E)return this._preserveStack(6,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=T+1;;H++)if(H>=x||(R=S[H])<32||R>127&&R<w){this._oscParser.put(S,T,H),T=H-1;break}break;case 6:if(E=this._oscParser.end(R!==24&&R!==26),E)return this._preserveStack(5,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}o.EscapeSequenceParser=C},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(v),{dispose:()=>{const C=w.indexOf(v);C!==-1&&w.splice(C,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(_,v,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,v,w))}start(){this.reset(),this._state=1}put(_,v,w){if(this._state!==3){if(this._state===1)for(;v<w;){const C=_[v++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-v>0&&this._put(_,v,w)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,b=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=v,b=this._stack.fallThrough,this._stack.paused=!1),!b&&w===!1){for(;C>=0&&(w=this._active[C].end(_),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,v,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,v}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const w=d[v];if(Array.isArray(w))for(let C=0;C<w.length;++C)_.addSubParam(w[C]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&(d[_]=this._subParams.slice(v,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,w=v[_-1];v[_-1]=~w?Math.min(10*w+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){f=p;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,_){return this._line.translateToString(p,d,_)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=_},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let C=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(b,this))}resize(b,S){this.cols=b,this.rows=S,this.buffers.resize(b,S),this._onResize.fire({cols:b,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,S=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=x.getBlankLine(b,S),this._cachedBlankLine=y),y.isWrapped=S;const E=x.ybase+x.scrollTop,R=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;R===x.lines.length-1?N?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(R+1,0,y.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=R-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(R,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(b,S,x){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(S||this._onScroll.fire(y.ydisp))}};o.BufferService=C=f([p(0,w.IOptionsService)],C)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function C(y,E){let R=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(R|=64,R|=y.action):(R|=3&y.button,4&y.button&&(R|=64),8&y.button&&(R|=128),y.action===32?R|=32:y.action!==0||E||(R|=3)),R}const b=String.fromCharCode,S={DEFAULT:y=>{const E=[C(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.x};${y.y}${E}`}};let x=o.CoreMouseService=class extends v.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(w))this.addProtocol(R,w[R]);for(const R of Object.keys(S))this.addEncoding(R,S[R]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,R){if(R){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),w=c(2585),C=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends v.Disposable{constructor(x,y,E){super(),this._bufferService=x,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}reset(){this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}triggerDataEvent(x,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=S=f([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],S)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),_=c(6106);let v=0,w=0;class C extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new b(x);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,E){let R=0,N=0;for(const D of this._decorations.getKeyIterator(y))R=D.options.x??0,N=R+(D.options.width??1),x>=R&&x<N&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(x,y,E,R){this._decorations.forEachByKey(y,(N=>{v=N.options.x??0,w=v+(N.options.width??1),x>=v&&x<w&&(!E||(N.options.layer??"bottom")===E)&&R(N)}))}}o.DecorationService=C;class b extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(x){super(),this.options=x,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=x.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(...v){this._entries=new Map;for(const[w,C]of v)this.set(w,C)}set(v,w){const C=this._entries.get(v);return this._entries.set(v,w),C}forEach(v){for(const[w,C]of this._entries.entries())v(w,C)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const w=(0,p.getServiceDependencies)(_).sort(((S,x)=>S.index-x.index)),C=[];for(const S of w){const x=this._services.get(S.id);if(!x)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${S.id}.`);C.push(x)}const b=w.length>0?w[0].index:v.length;if(v.length!==b)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${b+1} conflicts with ${v.length} static arguments`);return new _(...v,...C)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,C=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let S=0;S<b.length;S++)typeof b[S]=="function"&&(b[S]=b[S]())}_log(b,S,x){this._evalLazyOptionalParams(x),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...x)}trace(b,...S){var x;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.trace.bind(this._optionsService.options.logger))??console.log,b,S)}debug(b,...S){var x;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.debug.bind(this._optionsService.options.logger))??console.log,b,S)}info(b,...S){var x;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.info.bind(this._optionsService.options.logger))??console.info,b,S)}warn(b,...S){var x;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.warn.bind(this._optionsService.options.logger))??console.warn,b,S)}error(b,...S){var x;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.error.bind(this._optionsService.options.logger))??console.error,b,S)}};o.LogService=C=f([p(0,_.IOptionsService)],C),o.setTraceLogger=function(b){w=b},o.traceCall=function(b,S,x){if(typeof x.value!="function")throw new Error("not supported");const y=x.value;x.value=function(...E){if(w.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);w.trace(`GlyphRenderer#${y.name}(${E.map((N=>JSON.stringify(N))).join(", ")})`);const R=y.apply(this,E);return w.trace(`GlyphRenderer#${y.name} return`,R),R}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends p.Disposable{constructor(C){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const S in C)if(S in b)try{const x=C[S];b[S]=this._sanitizeAndValidateOption(S,x)}catch(x){console.error(x)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,b){return this.onOptionChange((S=>{S===C&&b(this.rawOptions[C])}))}onMultipleOptionChange(C,b){return this.onOptionChange((S=>{C.indexOf(S)!==-1&&b()}))}_setupOptions(){const C=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},b=(S,x)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);x=this._sanitizeAndValidateOption(S,x),this.rawOptions[S]!==x&&(this.rawOptions[S]=x,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const x={get:C.bind(this,S),set:b.bind(this,S)};Object.defineProperty(this.options,S,x)}}_sanitizeAndValidateOption(C,b){switch(C){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[C]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${C}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=_.includes(b)?b:o.DEFAULT_OPTIONS[C];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${C} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${C} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=v},2660:function(u,o,c){var f=this&&this.__decorate||function(v,w,C,b){var S,x=arguments.length,y=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,w,C,b);else for(var E=v.length-1;E>=0;E--)(S=v[E])&&(y=(x<3?S(y):x>3?S(w,C,y):S(w,C))||y);return x>3&&y&&Object.defineProperty(w,C,y),y},p=this&&this.__param||function(v,w){return function(C,b){w(C,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let _=o.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const w=this._bufferService.buffer;if(v.id===void 0){const E=w.addMarker(w.ybase+w.y),R={data:v,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const C=v,b=this._getEntryIdKey(C),S=this._entriesWithId.get(b);if(S)return this.addLineToLink(S.id,w.ybase+w.y),S.id;const x=w.addMarker(w.ybase+w.y),y={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(v,w){const C=this._dataByLinkId.get(v);if(C&&C.lines.every((b=>b.line!==w))){const b=this._bufferService.buffer.addMarker(w);C.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(C,b)))}}getLinkData(v){var w;return(w=this._dataByLinkId.get(v))==null?void 0:w.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,w){const C=v.lines.indexOf(w);C!==-1&&(v.lines.splice(C,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};o.OscLinkService=_=f([p(0,d.IBufferService)],_)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(_,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,b,S){b[c]===b?b[f].push({id:C,index:S}):(b[f]=[{id:C,index:S}],b[c]=b)})(d,_,w)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,w,C=!1){return(16777215&v)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const v=new p.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let w=0,C=0;const b=v.length;for(let S=0;S<b;++S){let x=v.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=b)return w+this.wcwidth(x);const R=v.charCodeAt(S);56320<=R&&R<=57343?x=1024*(x-55296)+R-56320+65536:w+=this.wcwidth(R)}const y=this.charProperties(x,C);let E=d.extractWidth(y);d.extractShouldJoin(y)&&(E-=d.extractWidth(C)),w+=E,C=y}return w}charProperties(v,w){return this._activeProvider.charProperties(v,w)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),_=a(7975),v=a(7090),w=["cols","rows"];class C extends f.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],y=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:x.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(S){if(w.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const x in S)this._publicOptions[x]=S[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,x=!0){this._core.input(S,x)}resize(S,x){this._verifyIntegers(S,x),this._core.resize(S,x)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,x,y){this._verifyIntegers(S,x,y),this._core.select(S,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,x){this._verifyIntegers(S,x),this._core.selectLines(S,x)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,x){this._core.write(S,x)}writeln(S,x){this._core.write(S),this._core.write(`\r -`,x)}paste(S){this._core.paste(S)}refresh(S,x){this._verifyIntegers(S,x),this._core.refresh(S,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const x of S)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const x of S)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=C})(),l})()))})(dp)),dp.exports}var fB=hB();function kb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function dB({runId:e}){const t=q.useRef(null);return q.useEffect(()=>{const n=t.current;if(!n)return;const r=new fB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:'ui-monospace, "SF Mono", Menlo, Consolas, monospace',scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new uB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const _=await FN(e,o);if(u)return;if(_.dataBase64&&r.write(kb(_.dataBase64)),o=_.nextOffset,_.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=AT(e,_=>{if(u)return;const v=kb(_.dataBase64);!c&&_.offset===o?(r.write(v),o+=v.length):_.offset+v.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),m.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const ea="__uncommitted__";function pB({state:e}){return!e||e.loading?m.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?m.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?m.jsx(oB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):m.jsx(gC,{diff:e.payload.diff}):m.jsx("div",{className:"diff-empty",children:"No changes."})}function gB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?m.jsx(mB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):m.jsx(_B,{experiment:e,project:t})}function mB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=q.useState(null),[u,o]=q.useState(!1),c=q.useRef(null),f=n&&t.find(w=>w.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=w=>{const C=t.findIndex(b=>b.id===w);return C===-1?t.length:t.length-C},_=q.useRef(null);q.useEffect(()=>{if(_.current===null){_.current=new Set(t.map(C=>C.id));return}const w=t.find(C=>!_.current.has(C.id));for(const C of t)_.current.add(C.id);w&&r(w.id)},[t,r]),q.useEffect(()=>{if(!u)return;const w=C=>{var b;(b=c.current)!=null&&b.contains(C.target)||o(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[u]);async function v(){if(f){l(null);try{await ZS(f.id)}catch(w){l(w instanceof Error?w.message:String(w))}}}return m.jsxs("div",{className:"term-view",children:[m.jsxs("div",{className:"term-bar",children:[m.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),m.jsx("span",{style:{flex:1}}),a&&m.jsx("span",{className:"error",children:a}),p&&m.jsxs("button",{className:"btn sm ghost",onClick:()=>void v(),children:[m.jsx(BA,{size:13}),"Stop"]}),t.length>0&&f&&m.jsxs("div",{className:"run-history",ref:c,children:[m.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(w=>!w),children:[m.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),m.jsx(Vo,{status:f.status}),m.jsx(cs,{size:14,className:"run-picker-chev"})]}),u&&m.jsx("div",{className:"history-menu",children:t.map(w=>m.jsxs("button",{className:`history-item ${w.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(w.id),o(!1)},children:[m.jsxs("span",{className:"run-label",children:["Run ",d(w.id)]}),m.jsx(Vo,{status:w.status}),m.jsx("span",{className:"when",children:Sa(w.createdAt)})]},w.id))})]})]}),m.jsx("div",{className:"term-fill",children:f?m.jsx(dB,{runId:f.id},f.id):m.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function _B({experiment:e,project:t}){const[n,r]=q.useState(null),[a,l]=q.useState(null),[u,o]=q.useState(null),[c,f]=q.useState(null),[p,d]=q.useState({}),_=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function v(){l(null);try{const[C,b]=await Promise.all([PN(e.id),By(e.projectId)]);r(C),o(b),f(S=>{var y;return S!==null?S:b.diff.trim()!==""&&b.experimentId===e.id?ea:((y=C[0])==null?void 0:y.sha)??null})}catch(C){l(C instanceof Error?C.message:String(C))}}q.useEffect(()=>{n===null&&!a&&v()},[n,a,e.id]),q.useEffect(()=>{const C=setInterval(()=>{By(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(C)},[e.projectId]),q.useEffect(()=>{var C;c===ea&&u&&!_&&f(((C=n==null?void 0:n[0])==null?void 0:C.sha)??null)},[c,u,_,n]),q.useEffect(()=>{if(!c||c===ea||p[c])return;const C=c;d(b=>({...b,[C]:{loading:!0}})),UN(e.id,C).then(b=>d(S=>({...S,[C]:{loading:!1,payload:b}}))).catch(b=>d(S=>({...S,[C]:{loading:!1,error:b instanceof Error?b.message:String(b)}})))},[c,p,e.id]);const w=!_&&((n==null?void 0:n.length)??0)===0;return m.jsx("div",{className:"drawer",children:m.jsx("div",{className:"drawer-body",children:m.jsxs("div",{className:"drawer-section",children:[m.jsxs("div",{className:"changes-branch",children:[m.jsx("span",{className:"ctl-label",children:"Branch"}),m.jsx(qL,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?m.jsx("div",{className:"error",children:a}):n===null?m.jsx("div",{className:"changes-note",children:"Loading changes…"}):w?m.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"commit-picker",children:[m.jsx("span",{className:"ctl-label",children:"Commit"}),c===ea&&m.jsx("span",{className:"uncommitted-dot"}),m.jsxs("select",{className:"input sm",value:c??"",onChange:C=>f(C.target.value),children:[_&&m.jsx("option",{value:ea,children:"● Uncommitted changes"}),n.map(C=>m.jsxs("option",{value:C.sha,children:[C.sha.slice(0,7)," — ",C.subject]},C.sha))]}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void v(),children:m.jsx(Sg,{size:14})})]}),m.jsx("div",{style:{marginTop:10},children:c===ea&&u?u.truncated?m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):m.jsx(gC,{diff:u.diff}):c?m.jsx(pB,{state:p[c]}):m.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function vB(e,t){return Sw(e,pw(t))}function yB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=q.useState(null),[o,c]=q.useState(null),[f,p]=q.useState(!0),[d,_]=q.useState(0),v=/\.(md|mdx|markdown)$/i.test(t),[w,C]=q.useState(!1);q.useEffect(()=>{let y=!1;return p(!0),$N(e,t,{sessionId:n,ref:r}).then(E=>{y||(u(E),c(null))}).catch(E=>{y||c(E.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const b=q.useMemo(()=>l&&!l.notFound?vB(l.content,t):null,[l,t]),S=l&&!l.notFound&&l.content?l.content.split(` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(B&&z&&j)&&this._areCoordsInSelection(j,B,z)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!B||!z)&&this._areCoordsInSelection([T,j],B,z)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]<B[1]||j[1]===B[1]&&T[1]===j[1]&&T[0]>=j[0]&&T[0]<B[0]||j[1]<B[1]&&T[1]===B[1]&&T[0]<B[0]||j[1]<B[1]&&T[1]===j[1]&&T[0]>=j[0]}_selectWordAtCursor(T,j){var G,U;const B=(U=(G=this._linkifier.currentLink)==null?void 0:G.link)==null?void 0:U.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(T);return!!z&&(this._selectWordAt(z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return S.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const z=B.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const z=(0,_.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let z=0;j>=z;z++){const G=T.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:G>1&&j!==z&&(B+=G-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,z=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,U=G.lines.get(T[1]);if(!U)return;const H=G.translateBufferLineToString(T[1],!1);let Y=this._convertViewportColToCharacterIndex(U,T[0]),q=Y;const X=T[0]-Y;let K=0,L=0,M=0,O=0;if(H.charAt(Y)===" "){for(;Y>0&&H.charAt(Y-1)===" ";)Y--;for(;q<H.length&&H.charAt(q+1)===" ";)q++}else{let Q=T[0],re=T[0];U.getWidth(Q)===0&&(K++,Q--),U.getWidth(re)===2&&(L++,re++);const ae=U.getString(re).length;for(ae>1&&(O+=ae-1,q+=ae-1);Q>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(Q-1,this._workCell));){U.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,Y-=Z-1),Y--,Q--}for(;re<U.length&&q+1<H.length&&!this._isCharWordSeparator(U.loadCell(re+1,this._workCell));){U.loadCell(re+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,re++):Z>1&&(O+=Z-1,q+=Z-1),q++,re++}}q++;let $=Y+X-K+M,F=Math.min(this._bufferService.cols,q-Y+K+L-M-O);if(j||H.slice(Y,q).trim()!==""){if(B&&$===0&&U.getCodePoint(0)!==32){const Q=G.lines.get(T[1]-1);if(Q&&U.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const ae=this._bufferService.cols-re.start;$-=ae,F+=ae}}}if(z&&$+F===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const Q=G.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&(F+=re.length)}}return{start:$,length:F}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,w.IMouseService),p(6,E.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],D)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(D,T,j,B){var z,G=arguments.length,U=G<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,T,j,B);else for(var H=D.length-1;H>=0;H--)(z=D[H])&&(U=(G<3?z(U):G>3?z(T,j,U):z(T,j))||U);return G>3&&U&&Object.defineProperty(T,j,U),U},p=this&&this.__param||function(D,T){return function(j,B){T(j,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),w=c(844),C=c(2585),b=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),x=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],z=T[j/6%6|0],G=T[j%6];D.push({css:_.channels.toCss(B,z,G),rgba:_.channels.toRgba(B,z,G)})}for(let j=0;j<24;j++){const B=8+10*j;D.push({css:_.channels.toCss(B,B,B),rgba:_.channels.toRgba(B,B,B)})}return D})());let R=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:S,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(S,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=N(D.foreground,b),T.background=N(D.background,S),T.cursor=N(D.cursor,x),T.cursorAccent=N(D.cursorAccent,y),T.selectionBackgroundTransparent=N(D.selectionBackground,E),T.selectionBackgroundOpaque=_.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=_.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?N(D.selectionForeground,_.NULL_COLOR):void 0,T.selectionForeground===_.NULL_COLOR&&(T.selectionForeground=void 0),_.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=_.color.opacity(T.selectionBackgroundTransparent,.3)),_.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=_.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(D.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(D.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(D.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(D.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(D.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(D.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(D.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(D.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<j;B++)T.ansi[B+16]=N(D.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,T){if(D!==void 0)try{return _.css.toColor(D)}catch{}return T}o.ThemeService=R=f([p(0,C.IOptionsService)],R)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const w=new Array(v);for(let C=0;C<Math.min(v,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let w=this._length;w<v;w++)this._array[w]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,w){this._array[this._getCyclicIndex(v)]=w}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,w,...C){if(w){for(let b=v;b<this._length-w;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+w)];this._length-=w,this.onDeleteEmitter.fire({index:v,amount:w})}for(let b=this._length-1;b>=v;b--)this._array[this._getCyclicIndex(b+C.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<C.length;b++)this._array[this._getCyclicIndex(v+b)]=C[b];if(C.length&&this.onInsertEmitter.fire({index:v,amount:C.length}),this._length+C.length>this._maxLength){const b=this._length+C.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=C.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,w,C){if(!(w<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let S=w-1;S>=0;S--)this.set(v+S+C,this.get(v+S));const b=v+w+C-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<w;b++)this.set(v+b+C,this.get(v+b))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}o.CircularList=d},1439:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=p<=1?f[_]:f[_]&&c(f[_],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var _,v,w,C,b;function S(y){const E=y.toString(16);return E.length<2?"0"+E:E}function x(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,R,N,D){return D!==void 0?`#${S(E)}${S(R)}${S(N)}${S(D)}`:`#${S(E)}${S(R)}${S(N)}`},y.toRgba=function(E,R,N,D=255){return(E<<24|R<<16|N<<8|D)>>>0},y.toColor=function(E,R,N,D){return{css:y.toCss(E,R,N,D),rgba:y.toRgba(E,R,N,D)}}})(_||(o.channels=_={})),(function(y){function E(R,N){return d=Math.round(255*N),[c,f,p]=b.toChannels(R.rgba),{css:_.toCss(c,f,p,d),rgba:_.toRgba(c,f,p,d)}}y.blend=function(R,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=R.rgba>>24&255,z=R.rgba>>16&255,G=R.rgba>>8&255;return c=B+Math.round((D-B)*d),f=z+Math.round((T-z)*d),p=G+Math.round((j-G)*d),{css:_.toCss(c,f,p),rgba:_.toRgba(c,f,p)}},y.isOpaque=function(R){return(255&R.rgba)==255},y.ensureContrastRatio=function(R,N,D){const T=b.ensureContrastRatio(R.rgba,N.rgba,D);if(T)return _.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(R){const N=(255|R.rgba)>>>0;return[c,f,p]=b.toChannels(N),{css:_.toCss(c,f,p),rgba:N}},y.opacity=E,y.multiplyOpacity=function(R,N){return d=255&R.rgba,E(R,d*N/255)},y.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(v||(o.color=v={})),(function(y){let E,R;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),_.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),_.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(c,f,p,d);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,p,d),css:N}}})(w||(o.css=w={})),(function(y){function E(R,N,D){const T=R/255,j=N/255,B=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},y.relativeLuminance2=E})(C||(o.rgb=C={})),(function(y){function E(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let G=D>>24&255,U=D>>16&255,H=D>>8&255,Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));for(;Y<T&&(G>0||U>0||H>0);)G-=Math.max(0,Math.ceil(.1*G)),U-=Math.max(0,Math.ceil(.1*U)),H-=Math.max(0,Math.ceil(.1*H)),Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));return(G<<24|U<<16|H<<8|255)>>>0}function R(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let G=D>>24&255,U=D>>16&255,H=D>>8&255,Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));for(;Y<T&&(G<255||U<255||H<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),U=Math.min(255,U+Math.ceil(.1*(255-U))),H=Math.min(255,H+Math.ceil(.1*(255-H))),Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));return(G<<24|U<<16|H<<8|255)>>>0}y.blend=function(N,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,j=D>>16&255,B=D>>8&255,z=N>>24&255,G=N>>16&255,U=N>>8&255;return c=z+Math.round((T-z)*d),f=G+Math.round((j-G)*d),p=U+Math.round((B-U)*d),_.toRgba(c,f,p)},y.ensureContrastRatio=function(N,D,T){const j=C.relativeLuminance(N>>8),B=C.relativeLuminance(D>>8);if(x(j,B)<T){if(B<j){const U=E(N,D,T),H=x(j,C.relativeLuminance(U>>8));if(H<T){const Y=R(N,D,T);return H>x(j,C.relativeLuminance(Y>>8))?U:Y}return U}const z=R(N,D,T),G=x(j,C.relativeLuminance(z>>8));if(G<T){const U=E(N,D,T);return G>x(j,C.relativeLuminance(U>>8))?z:U}return z}},y.reduceLuminance=E,y.increaseLuminance=R,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(b||(o.rgba=b={})),o.toPaddedHex=S,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),_=c(7866),v=c(744),w=c(7302),C=c(6975),b=c(8460),S=c(1753),x=c(1480),y=c(7994),E=c(9282),R=c(5435),N=c(5981),D=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((z=>{var G;(G=this._onScrollApi)==null||G.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const G in z)this.optionsService.options[G]=z[G]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((G,U)=>this._inputHandler.parse(G,U)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,G){this._writeBuffer.write(z,G)}writeSync(z,G){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(z,G)}input(z,G=!0){this.coreService.triggerDataEvent(z,G)}resize(z,G){isNaN(z)||isNaN(G)||(z=Math.max(z,v.MINIMUM_COLS),G=Math.max(G,v.MINIMUM_ROWS),this._bufferService.resize(z,G))}scroll(z,G=!1){this._bufferService.scroll(z,G)}scrollLines(z,G,U){this._bufferService.scrollLines(z,G,U)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const G=z-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(z,G){return this._inputHandler.registerEscHandler(z,G)}registerDcsHandler(z,G){return this._inputHandler.registerDcsHandler(z,G)}registerCsiHandler(z,G){return this._inputHandler.registerCsiHandler(z,G)}registerOscHandler(z,G){return this._inputHandler.registerOscHandler(z,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?z=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const G of z)G.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const p=[];for(let d=0;d<this._listeners.length;d++)p.push(this._listeners[d]);for(let d=0;d<p.length;d++)p[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c((p=>f.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var $,F=arguments.length,Q=F<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)($=K[re])&&(Q=(F<3?$(Q):F>3?$(L,M,Q):$(L,M))||Q);return F>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),w=c(844),C=c(482),b=c(8437),S=c(8460),x=c(643),y=c(511),E=c(3734),R=c(2585),N=c(1480),D=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function G(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var U;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(o.WindowsOptionsReportType=U={}));let H=0;class Y extends w.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,$,F,Q,re,ae,Z=new v.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=$,this._optionsService=F,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=ae,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ee.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((P,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ee,payload:ne})})),this._parser.setPrintHandler(((P,ee,ne)=>this.print(P,ee,ne))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new D.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new D.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new D.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new D.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new D.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new D.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new D.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new D.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new D.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new D.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((P,ee)=>this.requestStatusString(P,ee))))}_preserveStack(L,M,O,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=$}_logSlowResolvingAsync(L){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,$=this._activeBuffer.x,F=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;$=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(P=>String.fromCharCode(P))).join("")}"`),typeof L=="string"?L.split("").map((P=>P.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(L.length,z))),re||this._dirtyRowTracker.clearRange(),L.length>z)for(let P=Q;P<L.length;P+=z){const ee=P+z<L.length?P+z:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(P,ee),this._parseBuffer):this._utf8Decoder.decode(L.subarray(P,ee),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ne))return this._preserveStack($,F,ne,P),this._logSlowResolvingAsync(O),O}else if(!re){const P=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack($,F,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===$&&this._activeBuffer.y===F||this._onCursorMove.fire();const ae=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(ae,this._bufferService.rows-1))}print(L,M,O){let $,F;const Q=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ee=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let ge=this._parser.precedingJoinState;for(let he=M;he<O;++he){if($=L[he],$<127&&Q){const Ee=Q[String.fromCharCode($)];Ee&&($=Ee.charCodeAt(0))}const ye=this._unicodeService.charProperties($,ge);F=N.UnicodeService.extractWidth(ye);const be=N.UnicodeService.extractShouldJoin(ye),ke=be?N.UnicodeService.extractWidth(ge):0;if(ge=ye,re&&this._onA11yChar.fire((0,C.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-ke>ae){if(Z){const Ee=ne;let Ce=this._activeBuffer.x-ke;for(this._activeBuffer.x=ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ke>0&&ne instanceof b.BufferLine&&ne.copyCellsFrom(Ee,Ce,0,ke,!1);Ce<ae;)Ee.setCellFromCodepoint(Ce++,0,1,ee)}else if(this._activeBuffer.x=ae-1,F===2)continue}if(be&&this._activeBuffer.x){const Ee=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-Ee,$,F);for(let Ce=F-ke;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(P&&(ne.insertCells(this._activeBuffer.x,F-ke,this._activeBuffer.getNullCell(ee)),ne.getWidth(ae-1)===2&&ne.setCellFromCodepoint(ae-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,$,F,ee),F>0)for(;--F;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=ge,this._activeBuffer.x<ae&&O-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!G(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,$=!1,F=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),F),$&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O<this._bufferService.rows;O++)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;M--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;M--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const O=L.params[0]||1,$=N.UnicodeService.extractWidth(M),F=this._activeBuffer.x-$,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),re=new Uint32Array(Q.length*O);let ae=0;for(let P=0;P<Q.length;){const ee=Q.codePointAt(P)||0;re[ae++]=ee,P+=ee>65535?2:1}let Z=ae;for(let P=1;P<O;++P)re.copyWithin(Z,0,ae),Z+=ae;return this.print(re,0,Z),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const O=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:F}=this._coreMouseService,Q=this._coreService,{buffers:re,cols:ae}=this._bufferService,{active:Z,alt:P}=re,ee=this._optionsService.rawOptions,ne=be=>be?1:2,ge=L.params[0];return he=ge,ye=M?ge===2?4:ge===4?ne(Q.modes.insertMode):ge===12?3:ge===20?ne(ee.convertEol):0:ge===1?ne(O.applicationCursorKeys):ge===3?ee.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ge===6?ne(O.origin):ge===7?ne(O.wraparound):ge===8?3:ge===9?ne($==="X10"):ge===12?ne(ee.cursorBlink):ge===25?ne(!Q.isCursorHidden):ge===45?ne(O.reverseWraparound):ge===66?ne(O.applicationKeypad):ge===67?4:ge===1e3?ne($==="VT200"):ge===1002?ne($==="DRAG"):ge===1003?ne($==="ANY"):ge===1004?ne(O.sendFocus):ge===1005?4:ge===1006?ne(F==="SGR"):ge===1015?4:ge===1016?ne(F==="SGR_PIXELS"):ge===1048?1:ge===47||ge===1047||ge===1049?ne(Z===P):ge===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${he};${ye}$y`),!0;var he,ye}_updateAttrColor(L,M,O,$,F){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,$,F])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const $=[0,0,-1,0,0,0];let F=0,Q=0;do{if($[Q+F]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let ae=0;do $[1]===5&&(F=1),$[Q+ae+1+F]=re[ae];while(++ae<re.length&&ae+Q+1+F<$.length);break}if($[1]===5&&Q+F>=2||$[1]===2&&Q+F>=5)break;$[1]&&(F=1)}while(++Q+M<L.length&&Q+F<$.length);for(let re=2;re<$.length;++re)$[re]===-1&&($[re]=0);switch($[0]){case 38:O.fg=this._updateAttrColor(O.fg,$[1],$[3],$[4],$[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,$[1],$[3],$[4],$[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,$[1],$[3],$[4],$[5])}return Q}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=b.DEFAULT_ATTR_DATA.fg,L.bg=b.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const $=this._curAttrData;for(let F=0;F<M;F++)O=L.params[F],O>=30&&O<=37?($.fg&=-50331904,$.fg|=16777216|O-30):O>=40&&O<=47?($.bg&=-50331904,$.bg|=16777216|O-40):O>=90&&O<=97?($.fg&=-50331904,$.fg|=16777224|O-90):O>=100&&O<=107?($.bg&=-50331904,$.bg|=16777224|O-100):O===0?this._processSGR0($):O===1?$.fg|=134217728:O===3?$.bg|=67108864:O===4?($.fg|=268435456,this._processUnderline(L.hasSubParams(F)?L.getSubParams(F)[0]:1,$)):O===5?$.fg|=536870912:O===7?$.fg|=67108864:O===8?$.fg|=1073741824:O===9?$.fg|=2147483648:O===2?$.bg|=134217728:O===21?this._processUnderline(2,$):O===22?($.fg&=-134217729,$.bg&=-134217729):O===23?$.bg&=-67108865:O===24?($.fg&=-268435457,this._processUnderline(0,$)):O===25?$.fg&=-536870913:O===27?$.fg&=-67108865:O===28?$.fg&=-1073741825:O===29?$.fg&=2147483647:O===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):O===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?F+=this._extractColor(L,F,$):O===53?$.bg|=1073741824:O===55?$.bg&=-1073741825:O===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):O===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!G(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const $=O.shift(),F=O.shift();if(/^\d+$/.exec($)){const Q=parseInt($);if(X(Q))if(F==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)(F);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let $;const F=O.findIndex((Q=>Q.startsWith("id=")));return F!==-1&&($=O[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let $=0;$<O.length&&!(M>=this._specialColors.length);++$,++M)if(O[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const F=(0,j.parseColor)(O[$]);F&&this._onColor.fire([{type:1,index:this._specialColors[M],color:F}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let $=0;$<O.length;++$)if(/^\d+$/.exec(O[$])){const F=parseInt(O[$]);X(F)&&M.push({type:2,index:F})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(B[L[0]],_.CHARSETS[L[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const O=this._activeBuffer.ybase+this._activeBuffer.y+M,$=this._activeBuffer.lines.get(O);$&&($.fill(L),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const O=this._bufferService.buffer,$=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${F}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=Y;let q=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(H=K,K=L,L=H),K<this.start&&(this.start=K),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}q=f([p(0,R.IBufferService)],q)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,_){this._data[p]||(this._data[p]={}),this._data[p][d]=_}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,_,v){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,_,v)}get(f,p,d,_){var v;return(v=this._data.get(f,p))==null?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,p){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let p=0,d=this._array.length-1;for(;d>=p;){let _=p+d>>1;const v=this._getKey(this._array[_]);if(v>f)d=_-1;else{if(!(v<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}p=_+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let w=0,C=0,b=v.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),S=v.timeRemaining(),1.5*C>S)return b-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-w))}ms`),void this._start();b=S}this.clear()}}class d extends p{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=d==null?void 0:d.get(p.cols-1),v=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);v&&_&&(v.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),_=c(8437),v=c(4634),w=c(511),C=c(643),b=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,E){this._hasScrollback=x,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&x<this._rows}_getCorrectBufferLength(x){if(!this._hasScrollback)return x;const y=x+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<x)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(x,E);let D=0;if(this._rows<y)for(let T=this._rows;T<y;T++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(x,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(x,E)));else for(let T=this._rows;T>y;T--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const T=this.lines.length-N;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(x,E);this._cols=x,this._rows=y,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const E=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,v.reflowLargerCreateNewLayout)(this.lines,E);(0,v.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(x,y,R.countRemoved)}}_reflowLargerAdjustViewport(x,y,E){const R=this.getNullCell(_.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(x,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),R=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),j.unshift(T);const B=this.ybase+this.y;if(B>=D&&B<D+j.length)continue;const z=j[j.length-1].getTrimmedLength(),G=(0,v.reflowSmallerGetNewLineLengths)(j,this._cols,x),U=G.length-j.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const Y=[];for(let O=0;O<U;O++){const $=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);Y.push($)}Y.length>0&&(R.push({start:D+j.length+N,newLines:Y}),N+=Y.length),j.push(...Y);let q=G.length-1,X=G[q];X===0&&(q--,X=G[q]);let K=j.length-U-1,L=z;for(;K>=0;){const O=Math.min(L,X);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(q--,X=G[q]),L-=O,L===0){K--;const $=Math.max(K,0);L=(0,v.getWrappedLineTrimmedLength)(j,$,this._cols)}}for(let O=0;O<j.length;O++)G[O]<x&&j[O].setCell(G[O],E);let M=U-H;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+N)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+y-1)}if(R.length>0){const D=[],T=[];for(let q=0;q<this.lines.length;q++)T.push(this.lines.get(q));const j=this.lines.length;let B=j-1,z=0,G=R[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let U=0;for(let q=Math.min(this.lines.maxLength-1,j+N-1);q>=0;q--)if(G&&G.start>B+U){for(let X=G.newLines.length-1;X>=0;X--)this.lines.set(q--,G.newLines[X]);q++,D.push({index:B+1,amount:G.newLines.length}),U+=G.newLines.length,G=R[++z]}else this.lines.set(q,T[B--]);let H=0;for(let q=D.length-1;q>=0;q--)D[q].index+=H,this.lines.onInsertEmitter.fire(D[q]),H+=D[q].amount;const Y=Math.max(0,j+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(x,y,E=0,R){const N=this.lines.get(x);return N?N.translateToString(y,E,R):""}getWrappedRangeForLine(x){let y=x,E=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(x){for(x!=null?this.tabs[x]||(x=this.prevStop(x)):(this.tabs={},x=0);x<this._cols;x+=this._optionsService.rawOptions.tabStopWidth)this.tabs[x]=!0}prevStop(x){for(x==null&&(x=this.x);!this.tabs[--x]&&x>0;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x<this._cols;);return x>=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===x&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].dispose(),this.markers.splice(x--,1);this._isClearing=!1}addMarker(x){const y=new b.Marker(x);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let v=0;class w{constructor(b,S,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=S||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){const S=this._data[3*b+0],x=2097151&S;return[this._data[3*b+1],2097152&S?this._combined[b]:x?(0,_.stringFromCodePoint)(x):"",S>>22,2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):x]}set(b,S){this._data[3*b+1]=S[d.CHAR_DATA_ATTR_INDEX],S[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=S[1],this._data[3*b+0]=2097152|b|S[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&S}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b]:2097151&S?(0,_.stringFromCodePoint)(2097151&S):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,S){return v=3*b,S.content=this._data[v+0],S.fg=this._data[v+1],S.bg=this._data[v+2],2097152&S.content&&(S.combinedData=this._combined[b]),268435456&S.bg&&(S.extended=this._extendedAttrs[b]),S}setCell(b,S){2097152&S.content&&(this._combined[b]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=S.content,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}setCellFromCodepoint(b,S,x,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=S|x<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,S,x){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,_.stringFromCodePoint)(S):2097151&y?(this._combined[b]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(S),y&=-2097152,y|=2097152):y=S|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*b+0]=y}insertCells(b,S,x){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length-b){const y=new p.CellData;for(let E=this.length-b-S-1;E>=0;--E)this.setCell(b+S+E,this.loadCell(b+E,y));for(let E=0;E<S;++E)this.setCell(b+E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,x)}deleteCells(b,S,x){if(b%=this.length,S<this.length-b){const y=new p.CellData;for(let E=0;E<this.length-b-S;++E)this.setCell(b+E,this.loadCell(b+S+E,y));for(let E=this.length-S;E<this.length;++E)this.setCell(E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,x)}replaceCells(b,S,x,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.isProtected(b)||this.setCell(b,x),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.setCell(b++,x)}resize(b,S){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const x=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,S)}else{this._data=this._data.subarray(0,x);const y=Object.keys(this._combined);for(let R=0;R<y.length;R++){const N=parseInt(y[R],10);N>=b&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let R=0;R<E.length;R++){const N=parseInt(E[R],10);N>=b&&delete this._extendedAttrs[N]}}return this.length=b,4*x*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,S=!1){if(S)for(let x=0;x<this.length;++x)this.isProtected(x)||this.setCell(x,b);else{this._combined={},this._extendedAttrs={};for(let x=0;x<this.length;++x)this.setCell(x,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const S in b._combined)this._combined[S]=b._combined[S];this._extendedAttrs={};for(const S in b._extendedAttrs)this._extendedAttrs[S]=b._extendedAttrs[S];this.isWrapped=b.isWrapped}clone(){const b=new w(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const S in this._combined)b._combined[S]=this._combined[S];for(const S in this._extendedAttrs)b._extendedAttrs[S]=this._extendedAttrs[S];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,S,x,y,E){const R=b._data;if(E)for(let D=y-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}else for(let D=0;D<y;D++){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}const N=Object.keys(b._combined);for(let D=0;D<N.length;D++){const T=parseInt(N[D],10);T>=S&&(this._combined[T-S+x]=b._combined[T])}}translateToString(b,S,x,y){S=S??0,x=x??this.length,b&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;S<x;){const R=this._data[3*S+0],N=2097151&R,D=2097152&R?this._combined[S]:N?(0,_.stringFromCodePoint)(N):d.WHITESPACE_CELL_CHAR;if(E+=D,y)for(let T=0;T<D.length;++T)y.push(S);S+=R>>22||1}return y&&y.push(S),E}}o.BufferLine=w},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const _=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,v=f[p+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,_,v){const w=[];for(let C=0;C<f.length-1;C++){let b=C,S=f.get(++b);if(!S.isWrapped)continue;const x=[f.get(C)];for(;b<f.length&&S.isWrapped;)x.push(S),S=f.get(++b);if(_>=C&&_<b){C+=x.length-1;continue}let y=0,E=c(x,y,p),R=1,N=0;for(;R<x.length;){const T=c(x,R,p),j=T-N,B=d-E,z=Math.min(j,B);x[y].copyCellsFrom(x[R],N,E,z,!1),E+=z,E===d&&(y++,E=0),N+=z,N===T&&(R++,N=0),E===0&&y!==0&&x[y-1].getWidth(d-1)===2&&(x[y].copyCellsFrom(x[y-1],d-1,E++,1,!1),x[y-1].setCell(d-1,v))}x[y].replaceCells(E,d,v);let D=0;for(let T=x.length-1;T>0&&(T>y||x[T].getTrimmedLength()===0);T--)D++;D>0&&(w.push(C+x.length-D),w.push(D)),C+=x.length-1}return w},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let _=0,v=p[_],w=0;for(let C=0;C<f.length;C++)if(v===C){const b=p[++_];f.onDeleteEmitter.fire({index:C-w,amount:b}),C+=b-1,w+=b,v=p[++_]}else d.push(C);return{layout:d,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,p){const d=[];for(let _=0;_<p.length;_++)d.push(f.get(p[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=p.length},o.reflowSmallerGetNewLineLengths=function(f,p,d){const _=[],v=f.map(((S,x)=>c(f,x,p))).reduce(((S,x)=>S+x));let w=0,C=0,b=0;for(;b<v;){if(v-b<d){_.push(v-b);break}w+=d;const S=c(f,C,p);w>S&&(w-=S,C++);const x=f[C].getWidth(w-1)===2;x&&w--;const y=x?d-1:d;_.push(y),b+=y}return _},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class _ extends p.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=_},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const C=new _;return C.setFromCharData(w),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const b=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const S=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(b-55296)+S-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,_,v,w){const C={type:0,cancel:!1,key:void 0},b=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:C.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(C.key=f.C0.ESC+C.key);break;case 9:if(d.shiftKey){C.key=f.C0.ESC+"[Z";break}C.key=f.C0.HT,C.cancel=!0;break;case 13:C.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,C.cancel=!0;break;case 27:C.key=f.C0.ESC,d.altKey&&(C.key=f.C0.ESC+f.C0.ESC),C.cancel=!0;break;case 37:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"D",C.key===f.C0.ESC+"[1;3D"&&(C.key=f.C0.ESC+(v?"b":"[1;5D"))):C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"C",C.key===f.C0.ESC+"[1;3C"&&(C.key=f.C0.ESC+(v?"f":"[1;5C"))):C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"A",v||C.key!==f.C0.ESC+"[1;3A"||(C.key=f.C0.ESC+"[1;5A")):C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"B",v||C.key!==f.C0.ESC+"[1;3B"||(C.key=f.C0.ESC+"[1;5B")):C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(C.key=f.C0.ESC+"[2~");break;case 46:C.key=b?f.C0.ESC+"[3;"+(b+1)+"~":f.C0.ESC+"[3~";break;case 36:C.key=b?f.C0.ESC+"[1;"+(b+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:C.key=b?f.C0.ESC+"[1;"+(b+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?C.type=2:d.ctrlKey?C.key=f.C0.ESC+"[5;"+(b+1)+"~":C.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?C.type=3:d.ctrlKey?C.key=f.C0.ESC+"[6;"+(b+1)+"~":C.key=f.C0.ESC+"[6~";break;case 112:C.key=b?f.C0.ESC+"[1;"+(b+1)+"P":f.C0.ESC+"OP";break;case 113:C.key=b?f.C0.ESC+"[1;"+(b+1)+"Q":f.C0.ESC+"OQ";break;case 114:C.key=b?f.C0.ESC+"[1;"+(b+1)+"R":f.C0.ESC+"OR";break;case 115:C.key=b?f.C0.ESC+"[1;"+(b+1)+"S":f.C0.ESC+"OS";break;case 116:C.key=b?f.C0.ESC+"[15;"+(b+1)+"~":f.C0.ESC+"[15~";break;case 117:C.key=b?f.C0.ESC+"[17;"+(b+1)+"~":f.C0.ESC+"[17~";break;case 118:C.key=b?f.C0.ESC+"[18;"+(b+1)+"~":f.C0.ESC+"[18~";break;case 119:C.key=b?f.C0.ESC+"[19;"+(b+1)+"~":f.C0.ESC+"[19~";break;case 120:C.key=b?f.C0.ESC+"[20;"+(b+1)+"~":f.C0.ESC+"[20~";break;case 121:C.key=b?f.C0.ESC+"[21;"+(b+1)+"~":f.C0.ESC+"[21~";break;case 122:C.key=b?f.C0.ESC+"[23;"+(b+1)+"~":f.C0.ESC+"[23~";break;case 123:C.key=b?f.C0.ESC+"[24;"+(b+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!w||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?C.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(C.key=f.C0.US),d.key==="@"&&(C.key=f.C0.NUL)):d.keyCode===65&&(C.type=1);else{const S=p[d.keyCode],x=S==null?void 0:S[d.shiftKey?1:0];if(x)C.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(y);d.shiftKey&&(E=E.toUpperCase()),C.key=f.C0.ESC+E}else if(d.keyCode===32)C.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),C.key=f.C0.ESC+y,C.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?C.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?C.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?C.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?C.key=f.C0.DEL:d.keyCode===219?C.key=f.C0.ESC:d.keyCode===220?C.key=f.C0.FS:d.keyCode===221&&(C.key=f.C0.GS)}return C}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let _=f;_<p;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?f[d++]=1024*(this._interim-55296)+v-56320+65536:(f[d++]=this._interim,f[d++]=v),this._interim=0}for(let v=_;v<p;++v){const w=c.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=p)return this._interim=w,d;const C=c.charCodeAt(v);56320<=C&&C<=57343?f[d++]=1024*(w-55296)+C-56320+65536:(f[d++]=w,f[d++]=C)}else w!==65279&&(f[d++]=w)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,_,v,w,C=0,b=0,S=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)R<<=6,R|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-D;for(;S<j;){if(S>=p)return 0;if(N=c[S++],(192&N)!=128){S--,E=!0;break}this.interim[D++]=N,R<<=6,R|=63&N}E||(T===2?R<128?S--:f[C++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(f[C++]=R):R<65536||R>1114111||(f[C++]=R)),this.interim.fill(0)}const x=p-4;let y=S;for(;y<p;){for(;!(!(y<x)||128&(d=c[y])||128&(_=c[y+1])||128&(v=c[y+2])||128&(w=c[y+3]));)f[C++]=d,f[C++]=_,f[C++]=v,f[C++]=w,y+=4;if(d=c[y++],d<128)f[C++]=d;else if((224&d)==192){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(b=(31&d)<<6|63&_,b<128){y--;continue}f[C++]=b}else if((240&d)==224){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(b=(15&d)<<12|(63&_)<<6|63&v,b<2048||b>=55296&&b<=57343||b===65279)continue;f[C++]=b}else if((248&d)==240){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,C;if(w=c[y++],(192&w)!=128){y--;continue}if(b=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&w,b<65536||b>1114111)continue;f[C++]=b}}return C}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let v=0;v<p.length;++v)_.fill(0,p[v][0],p[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?_[v]:(function(w,C){let b,S=0,x=C.length-1;if(w<C[0][0]||w>C[x][1])return!1;for(;x>=S;)if(b=S+x>>1,w>C[b][1])S=b+1;else{if(!(w<C[b][0]))return!0;x=b-1}return!1})(v,d)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,w){let C=this.wcwidth(v),b=C===0&&w!==0;if(b){const S=f.UnicodeService.extractWidth(w);S===0?b=!1:S>C&&(C=S)}return f.UnicodeService.createPropertyValue(0,C,b)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w)}_innerWrite(v=0,w=!0){const C=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],S=this._action(b,w);if(S){const y=E=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(C,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,_){const v=d.toString(16),w=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const w=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/w*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/w*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,w=[0,0,0];for(let C=0;C<3;++C){const b=parseInt(_.slice(v*C,v*C+v),16);w[C]=v===1?b<<4:v===2?b:v===3?b>>4:b>>8}return w}},o.toRgbString=function(d,_=16){const[v,w,C]=d;return`rgb:${p(v,_)}/${p(w,_)}/${p(C,_)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const b=this._handlers[w];return b.push(C),{dispose:()=>{const S=b.indexOf(C);S!==-1&&b.splice(S,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,b){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(w,C,b);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,C,b))}unhook(w,C=!0){if(this._active.length){let b=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,b=C,x=this._stack.fallThrough,this._stack.paused=!1),!x&&b===!1){for(;S>=0&&(b=this._active[S].unhook(w),b!==!0);S--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,b;S--}for(;S>=0;S--)if(b=this._active[S].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const v=new p.Params;v.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=v,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():v,this._data="",this._hitLimit=!1}put(w,C,b){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,C,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((b=>(this._params=v,this._data="",this._hitLimit=!1,b)));return this._params=v,this._data="",this._hitLimit=!1,C}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),_=c(6351);class v{constructor(S){this.table=new Uint8Array(S)}setDefault(S,x){this.table.fill(S<<4|x)}add(S,x,y,E){this.table[x<<8|S]=y<<4|E}addMany(S,x,y,E){for(let R=0;R<S.length;R++)this.table[x<<8|S[R]]=y<<4|E}}o.TransitionTable=v;const w=160;o.VT500_TRANSITION_TABLE=(function(){const b=new v(4095),S=Array.apply(null,Array(256)).map(((D,T)=>T)),x=(D,T)=>S.slice(D,T),y=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const R=x(0,14);let N;for(N in b.setDefault(1,0),b.addMany(y,0,2,0),R)b.addMany([24,26,153,154],N,3,0),b.addMany(x(128,144),N,3,0),b.addMany(x(144,152),N,3,0),b.add(156,N,0,0),b.add(27,N,11,1),b.add(157,N,4,8),b.addMany([152,158,159],N,0,7),b.add(155,N,11,3),b.add(144,N,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(x(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(x(64,127),3,7,0),b.addMany(x(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(x(48,60),4,8,4),b.addMany(x(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(x(32,64),6,0,6),b.add(127,6,0,6),b.addMany(x(64,127),6,0,0),b.addMany(x(32,48),3,9,5),b.addMany(x(32,48),5,9,5),b.addMany(x(48,64),5,0,6),b.addMany(x(64,127),5,7,0),b.addMany(x(32,48),4,9,5),b.addMany(x(32,48),1,9,2),b.addMany(x(32,48),2,9,2),b.addMany(x(48,127),2,10,0),b.addMany(x(48,80),1,10,0),b.addMany(x(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(x(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(x(28,32),9,0,9),b.addMany(x(32,48),9,9,12),b.addMany(x(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(x(32,128),11,0,11),b.addMany(x(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(x(28,32),10,0,10),b.addMany(x(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(x(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(x(28,32),12,0,12),b.addMany(x(32,48),12,9,12),b.addMany(x(48,64),12,0,11),b.addMany(x(64,127),12,12,13),b.addMany(x(64,127),10,12,13),b.addMany(x(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(w,0,2,0),b.add(w,8,5,8),b.add(w,6,0,6),b.add(w,11,0,11),b.add(w,13,13,13),b})();class C extends f.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,x=[64,126]){let y=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=S.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<S.intermediates.length;++R){const N=S.intermediates.charCodeAt(R);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=E,y}identToString(S){const x=[];for(;S;)x.push(String.fromCharCode(255&S)),S>>=8;return x.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,x){const y=this._identifier(S,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,x){this._executeHandlers[S.charCodeAt(0)]=x}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,x){const y=this._identifier(S);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,x){return this._dcsParser.registerHandler(this._identifier(S),x)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,x){return this._oscParser.registerHandler(S,x)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,x,y,E,R){this._parseStack.state=S,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(S,x,y){let E,R=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(R=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=S[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<x;++T){switch(R=S[T],N=this._transitions.table[this.currentState<<8|(R<160?R:w)],N>>4){case 2:for(let U=T+1;;++U){if(U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|R];let B=j?j.length-1:-1;for(;B>=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<x&&(R=S[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const z=this._escHandlers[this._collect<<8|R];let G=z?z.length-1:-1;for(;G>=0&&(E=z[G](),E!==!0);G--)if(E instanceof Promise)return this._preserveStack(4,z,G,N,T),E;G<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let U=T+1;;++U)if(U>=x||(R=S[U])===24||R===26||R===27||R>127&&R<w){this._dcsParser.put(S,T,U),T=U-1;break}break;case 14:if(E=this._dcsParser.unhook(R!==24&&R!==26),E)return this._preserveStack(6,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let U=T+1;;U++)if(U>=x||(R=S[U])<32||R>127&&R<w){this._oscParser.put(S,T,U),T=U-1;break}break;case 6:if(E=this._oscParser.end(R!==24&&R!==26),E)return this._preserveStack(5,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}o.EscapeSequenceParser=C},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(v),{dispose:()=>{const C=w.indexOf(v);C!==-1&&w.splice(C,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(_,v,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,v,w))}start(){this.reset(),this._state=1}put(_,v,w){if(this._state!==3){if(this._state===1)for(;v<w;){const C=_[v++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-v>0&&this._put(_,v,w)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,b=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=v,b=this._stack.fallThrough,this._stack.paused=!1),!b&&w===!1){for(;C>=0&&(w=this._active[C].end(_),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,v,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,v}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const w=d[v];if(Array.isArray(w))for(let C=0;C<w.length;++C)_.addSubParam(w[C]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&(d[_]=this._subParams.slice(v,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,w=v[_-1];v[_-1]=~w?Math.min(10*w+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){f=p;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,_){return this._line.translateToString(p,d,_)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=_},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let C=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(b,this))}resize(b,S){this.cols=b,this.rows=S,this.buffers.resize(b,S),this._onResize.fire({cols:b,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,S=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=x.getBlankLine(b,S),this._cachedBlankLine=y),y.isWrapped=S;const E=x.ybase+x.scrollTop,R=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;R===x.lines.length-1?N?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(R+1,0,y.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=R-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(R,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(b,S,x){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(S||this._onScroll.fire(y.ydisp))}};o.BufferService=C=f([p(0,w.IOptionsService)],C)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function C(y,E){let R=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(R|=64,R|=y.action):(R|=3&y.button,4&y.button&&(R|=64),8&y.button&&(R|=128),y.action===32?R|=32:y.action!==0||E||(R|=3)),R}const b=String.fromCharCode,S={DEFAULT:y=>{const E=[C(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.x};${y.y}${E}`}};let x=o.CoreMouseService=class extends v.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(w))this.addProtocol(R,w[R]);for(const R of Object.keys(S))this.addEncoding(R,S[R]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,R){if(R){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),w=c(2585),C=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends v.Disposable{constructor(x,y,E){super(),this._bufferService=x,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}reset(){this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}triggerDataEvent(x,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=S=f([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],S)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),_=c(6106);let v=0,w=0;class C extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new b(x);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,E){let R=0,N=0;for(const D of this._decorations.getKeyIterator(y))R=D.options.x??0,N=R+(D.options.width??1),x>=R&&x<N&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(x,y,E,R){this._decorations.forEachByKey(y,(N=>{v=N.options.x??0,w=v+(N.options.width??1),x>=v&&x<w&&(!E||(N.options.layer??"bottom")===E)&&R(N)}))}}o.DecorationService=C;class b extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(x){super(),this.options=x,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=x.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(...v){this._entries=new Map;for(const[w,C]of v)this.set(w,C)}set(v,w){const C=this._entries.get(v);return this._entries.set(v,w),C}forEach(v){for(const[w,C]of this._entries.entries())v(w,C)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const w=(0,p.getServiceDependencies)(_).sort(((S,x)=>S.index-x.index)),C=[];for(const S of w){const x=this._services.get(S.id);if(!x)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${S.id}.`);C.push(x)}const b=w.length>0?w[0].index:v.length;if(v.length!==b)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${b+1} conflicts with ${v.length} static arguments`);return new _(...v,...C)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,C=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let S=0;S<b.length;S++)typeof b[S]=="function"&&(b[S]=b[S]())}_log(b,S,x){this._evalLazyOptionalParams(x),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...x)}trace(b,...S){var x;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.trace.bind(this._optionsService.options.logger))??console.log,b,S)}debug(b,...S){var x;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.debug.bind(this._optionsService.options.logger))??console.log,b,S)}info(b,...S){var x;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.info.bind(this._optionsService.options.logger))??console.info,b,S)}warn(b,...S){var x;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.warn.bind(this._optionsService.options.logger))??console.warn,b,S)}error(b,...S){var x;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.error.bind(this._optionsService.options.logger))??console.error,b,S)}};o.LogService=C=f([p(0,_.IOptionsService)],C),o.setTraceLogger=function(b){w=b},o.traceCall=function(b,S,x){if(typeof x.value!="function")throw new Error("not supported");const y=x.value;x.value=function(...E){if(w.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);w.trace(`GlyphRenderer#${y.name}(${E.map((N=>JSON.stringify(N))).join(", ")})`);const R=y.apply(this,E);return w.trace(`GlyphRenderer#${y.name} return`,R),R}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends p.Disposable{constructor(C){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const S in C)if(S in b)try{const x=C[S];b[S]=this._sanitizeAndValidateOption(S,x)}catch(x){console.error(x)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,b){return this.onOptionChange((S=>{S===C&&b(this.rawOptions[C])}))}onMultipleOptionChange(C,b){return this.onOptionChange((S=>{C.indexOf(S)!==-1&&b()}))}_setupOptions(){const C=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},b=(S,x)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);x=this._sanitizeAndValidateOption(S,x),this.rawOptions[S]!==x&&(this.rawOptions[S]=x,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const x={get:C.bind(this,S),set:b.bind(this,S)};Object.defineProperty(this.options,S,x)}}_sanitizeAndValidateOption(C,b){switch(C){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[C]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${C}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=_.includes(b)?b:o.DEFAULT_OPTIONS[C];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${C} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${C} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=v},2660:function(u,o,c){var f=this&&this.__decorate||function(v,w,C,b){var S,x=arguments.length,y=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,w,C,b);else for(var E=v.length-1;E>=0;E--)(S=v[E])&&(y=(x<3?S(y):x>3?S(w,C,y):S(w,C))||y);return x>3&&y&&Object.defineProperty(w,C,y),y},p=this&&this.__param||function(v,w){return function(C,b){w(C,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let _=o.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const w=this._bufferService.buffer;if(v.id===void 0){const E=w.addMarker(w.ybase+w.y),R={data:v,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const C=v,b=this._getEntryIdKey(C),S=this._entriesWithId.get(b);if(S)return this.addLineToLink(S.id,w.ybase+w.y),S.id;const x=w.addMarker(w.ybase+w.y),y={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(v,w){const C=this._dataByLinkId.get(v);if(C&&C.lines.every((b=>b.line!==w))){const b=this._bufferService.buffer.addMarker(w);C.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(C,b)))}}getLinkData(v){var w;return(w=this._dataByLinkId.get(v))==null?void 0:w.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,w){const C=v.lines.indexOf(w);C!==-1&&(v.lines.splice(C,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};o.OscLinkService=_=f([p(0,d.IBufferService)],_)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(_,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,b,S){b[c]===b?b[f].push({id:C,index:S}):(b[f]=[{id:C,index:S}],b[c]=b)})(d,_,w)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,w,C=!1){return(16777215&v)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const v=new p.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let w=0,C=0;const b=v.length;for(let S=0;S<b;++S){let x=v.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=b)return w+this.wcwidth(x);const R=v.charCodeAt(S);56320<=R&&R<=57343?x=1024*(x-55296)+R-56320+65536:w+=this.wcwidth(R)}const y=this.charProperties(x,C);let E=d.extractWidth(y);d.extractShouldJoin(y)&&(E-=d.extractWidth(C)),w+=E,C=y}return w}charProperties(v,w){return this._activeProvider.charProperties(v,w)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),_=a(7975),v=a(7090),w=["cols","rows"];class C extends f.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],y=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:x.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(S){if(w.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const x in S)this._publicOptions[x]=S[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,x=!0){this._core.input(S,x)}resize(S,x){this._verifyIntegers(S,x),this._core.resize(S,x)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,x,y){this._verifyIntegers(S,x,y),this._core.select(S,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,x){this._verifyIntegers(S,x),this._core.selectLines(S,x)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,x){this._core.write(S,x)}writeln(S,x){this._core.write(S),this._core.write(`\r +`,x)}paste(S){this._core.paste(S)}refresh(S,x){this._verifyIntegers(S,x),this._core.refresh(S,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const x of S)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const x of S)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=C})(),l})()))})(dp)),dp.exports}var cB=lB();function kb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function uB({runId:e}){const t=V.useRef(null);return V.useEffect(()=>{const n=t.current;if(!n)return;const r=new cB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:'ui-monospace, "SF Mono", Menlo, Consolas, monospace',scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new oB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const _=await BN(e,o);if(u)return;if(_.dataBase64&&r.write(kb(_.dataBase64)),o=_.nextOffset,_.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=wT(e,_=>{if(u)return;const v=kb(_.dataBase64);!c&&_.offset===o?(r.write(v),o+=v.length):_.offset+v.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),m.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const ea="__uncommitted__";function hB({state:e}){return!e||e.loading?m.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?m.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?m.jsx(rB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):m.jsx(fC,{diff:e.payload.diff}):m.jsx("div",{className:"diff-empty",children:"No changes."})}function fB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?m.jsx(dB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):m.jsx(pB,{experiment:e,project:t})}function dB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=V.useState(null),[u,o]=V.useState(!1),c=V.useRef(null),f=n&&t.find(w=>w.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=w=>{const C=t.findIndex(b=>b.id===w);return C===-1?t.length:t.length-C},_=V.useRef(null);V.useEffect(()=>{if(_.current===null){_.current=new Set(t.map(C=>C.id));return}const w=t.find(C=>!_.current.has(C.id));for(const C of t)_.current.add(C.id);w&&r(w.id)},[t,r]),V.useEffect(()=>{if(!u)return;const w=C=>{var b;(b=c.current)!=null&&b.contains(C.target)||o(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[u]);async function v(){if(f){l(null);try{await XS(f.id)}catch(w){l(w instanceof Error?w.message:String(w))}}}return m.jsxs("div",{className:"term-view",children:[m.jsxs("div",{className:"term-bar",children:[m.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),m.jsx("span",{style:{flex:1}}),a&&m.jsx("span",{className:"error",children:a}),p&&m.jsxs("button",{className:"btn sm ghost",onClick:()=>void v(),children:[m.jsx(MA,{size:13}),"Stop"]}),t.length>0&&f&&m.jsxs("div",{className:"run-history",ref:c,children:[m.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(w=>!w),children:[m.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),m.jsx(Vo,{status:f.status}),m.jsx(cs,{size:14,className:"run-picker-chev"})]}),u&&m.jsx("div",{className:"history-menu",children:t.map(w=>m.jsxs("button",{className:`history-item ${w.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(w.id),o(!1)},children:[m.jsxs("span",{className:"run-label",children:["Run ",d(w.id)]}),m.jsx(Vo,{status:w.status}),m.jsx("span",{className:"when",children:Sa(w.createdAt)})]},w.id))})]})]}),m.jsx("div",{className:"term-fill",children:f?m.jsx(uB,{runId:f.id},f.id):m.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function pB({experiment:e,project:t}){const[n,r]=V.useState(null),[a,l]=V.useState(null),[u,o]=V.useState(null),[c,f]=V.useState(null),[p,d]=V.useState({}),_=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function v(){l(null);try{const[C,b]=await Promise.all([IN(e.id),By(e.projectId)]);r(C),o(b),f(S=>{var y;return S!==null?S:b.diff.trim()!==""&&b.experimentId===e.id?ea:((y=C[0])==null?void 0:y.sha)??null})}catch(C){l(C instanceof Error?C.message:String(C))}}V.useEffect(()=>{n===null&&!a&&v()},[n,a,e.id]),V.useEffect(()=>{const C=setInterval(()=>{By(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(C)},[e.projectId]),V.useEffect(()=>{var C;c===ea&&u&&!_&&f(((C=n==null?void 0:n[0])==null?void 0:C.sha)??null)},[c,u,_,n]),V.useEffect(()=>{if(!c||c===ea||p[c])return;const C=c;d(b=>({...b,[C]:{loading:!0}})),zN(e.id,C).then(b=>d(S=>({...S,[C]:{loading:!1,payload:b}}))).catch(b=>d(S=>({...S,[C]:{loading:!1,error:b instanceof Error?b.message:String(b)}})))},[c,p,e.id]);const w=!_&&((n==null?void 0:n.length)??0)===0;return m.jsx("div",{className:"drawer",children:m.jsx("div",{className:"drawer-body",children:m.jsxs("div",{className:"drawer-section",children:[m.jsxs("div",{className:"changes-branch",children:[m.jsx("span",{className:"ctl-label",children:"Branch"}),m.jsx(UL,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?m.jsx("div",{className:"error",children:a}):n===null?m.jsx("div",{className:"changes-note",children:"Loading changes…"}):w?m.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"commit-picker",children:[m.jsx("span",{className:"ctl-label",children:"Commit"}),c===ea&&m.jsx("span",{className:"uncommitted-dot"}),m.jsxs("select",{className:"input sm",value:c??"",onChange:C=>f(C.target.value),children:[_&&m.jsx("option",{value:ea,children:"● Uncommitted changes"}),n.map(C=>m.jsxs("option",{value:C.sha,children:[C.sha.slice(0,7)," — ",C.subject]},C.sha))]}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void v(),children:m.jsx(Sg,{size:14})})]}),m.jsx("div",{style:{marginTop:10},children:c===ea&&u?u.truncated?m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):m.jsx(fC,{diff:u.diff}):c?m.jsx(hB,{state:p[c]}):m.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function gB(e,t){return vw(e,hw(t))}function mB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=V.useState(null),[o,c]=V.useState(null),[f,p]=V.useState(!0),[d,_]=V.useState(0),v=/\.(md|mdx|markdown)$/i.test(t),[w,C]=V.useState(!1);V.useEffect(()=>{let y=!1;return p(!0),HN(e,t,{sessionId:n,ref:r}).then(E=>{y||(u(E),c(null))}).catch(E=>{y||c(E.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const b=V.useMemo(()=>l&&!l.notFound?gB(l.content,t):null,[l,t]),S=l&&!l.notFound&&l.content?l.content.split(` `).length-(l.content.endsWith(` -`)?1:0):0,x=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return m.jsxs("div",{className:"file-view",children:[m.jsxs("div",{className:"file-view-header",children:[m.jsx(KA,{size:13,style:{flexShrink:0}}),m.jsx("code",{className:"file-view-path",title:t,children:t}),r&&m.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),v&&m.jsx("button",{className:`icon-btn ${w?"active":""}`,title:w?"Rendered view":"Source view","aria-label":w?"Rendered view":"Source view",onClick:()=>C(y=>!y),children:m.jsx(FA,{size:13})}),m.jsx("button",{className:"icon-btn",title:"Reload file","aria-label":"Reload file",onClick:()=>_(y=>y+1),children:f?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),m.jsx("div",{className:"file-view-body",children:o?m.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?m.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?m.jsx("div",{className:"file-view-note",children:x(l)}):m.jsxs(m.Fragment,{children:[!r&&n&&l.root==="clone"&&m.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),v&&!w?m.jsx("div",{className:"file-view-md",children:m.jsx(qo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):m.jsxs("div",{className:"file-view-codewrap",children:[S>0&&m.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:S},(y,E)=>E+1).join(` -`)}),m.jsx("pre",{className:"file-view-code",children:m.jsx("code",{children:b})})]}),l.truncated&&m.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function bB({projectName:e,onHome:t,onCollapse:n}){return m.jsxs("div",{className:"rail-brand",children:[m.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[m.jsx(jo,{size:15}),m.jsx("span",{className:"brand-project",children:e})]}),n&&m.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:m.jsx(YS,{size:15})})]})}function SB({onDone:e}){const[t,n]=q.useState(0),[r,a]=q.useState(null),[l,u]=q.useState(null),[o,c]=q.useState(null),[f,p]=q.useState(null),[d,_]=q.useState(!1),v=C=>{_(!0),Promise.allSettled([wg(C).then(a),nx().then(u),ex().then(c),gT().then(p)]).finally(()=>_(!1))};q.useEffect(()=>v(!1),[]);const w=()=>{_T((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return m.jsx("div",{className:"home onboarding",children:m.jsx("div",{className:"home-inner",children:t===0?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 1 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Your coding agents"}),m.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),m.jsx("div",{className:"onb-cards",children:r===null?m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(C=>m.jsx(wB,{h:C},C.id))}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===1?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 2 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),m.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),m.jsx("div",{className:"onb-cards",children:m.jsx(CB,{git:l,onUpdate:u})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[m.jsx(jo,{size:12})," Back"]}),m.jsxs("button",{className:"btn ghost",onClick:()=>v(!1),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===2?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 3 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),m.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),m.jsx("div",{className:"onb-cards",children:m.jsx(EB,{dataDir:o,onUpdate:c})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 4 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Usage analytics"}),m.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),m.jsx("div",{className:"onb-cards",children:m.jsx(kB,{telemetry:f,onUpdate:p})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:w,children:["Create your first project ",m.jsx(Ic,{size:13})]})]})]})})})}function xB(e){return e.agentReady?{cls:"st-done",label:"connected"}:e.installed?{cls:"st-starting",label:"not signed in"}:{cls:"st-idle",label:"not detected"}}function wB({h:e}){var r,a;const t=xB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:e.name}),m.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),m.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>xu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):m.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function CB({git:e,onUpdate:t}){const[n,r]=q.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"status-badge st-failed",children:[m.jsx("span",{className:"dot"})," not found"]})]}),m.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),m.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"GitHub"}),m.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"signed in via gh CLI":"not connected"}),m.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&m.jsxs("div",{className:"onb-card-meta",children:["Set ",m.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&m.jsxs("div",{className:"onb-gh-options",children:[m.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),m.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?m.jsxs(m.Fragment,{children:[m.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),m.jsxs("button",{className:"btn ghost",onClick:a,children:[n?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx(yg,{size:12}),n?"Copied":"Copy"]}),m.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):m.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",m.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),m.jsx("div",{className:"onb-gh-or",children:"or"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),m.jsx(Cw,{onSaved:t})]})]})]})}function EB({dataDir:e,onUpdate:t}){const[n,r]=q.useState(""),[a,l]=q.useState(!1),[u,o]=q.useState(!1),[c,f]=q.useState(null);if(q.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:"status-badge st-done",children:[m.jsx(_n,{size:12,strokeWidth:3})," pinned"]})]}),m.jsxs("div",{className:"onb-card-meta",children:["Set by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function _(){if(!(u||!d)){o(!0),f(null);try{t(await eT(p)),l(!1)}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?m.jsx("span",{className:"dot"}):m.jsx(_n,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?m.jsxs(m.Fragment,{children:[m.jsx("input",{className:"mono",type:"text",value:n,onChange:v=>r(v.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&m.jsx("div",{className:"error",style:{marginTop:8},children:c}),m.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[m.jsx("button",{className:"btn primary",onClick:_,disabled:u||!d,children:u?"Saving…":"Use this folder"}),m.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):m.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",m.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function kB({telemetry:e,onUpdate:t}){const[n,r]=q.useState(!1);if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),mT(o).then(t).finally(()=>r(!1)))};return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsxs("div",{children:[m.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),m.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),m.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[m.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?m.jsx(_n,{size:12,strokeWidth:3}):null," On"]}),m.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:m.jsx(_n,{size:12,strokeWidth:3})," Off"]})]})]}),m.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",m.jsx("code",{children:"orx telemetry off"}),"."]}),l&&m.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function Kc(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function Ab(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function AB(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function NB(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function TB({onCreated:e,onCancel:t}){var U;const[n,r]=q.useState("paper"),[a,l]=q.useState("use"),[u,o]=q.useState(""),[c,f]=q.useState(""),[p,d]=q.useState(!1),[_,v]=q.useState("main"),[w,C]=q.useState(!1),[b,S]=q.useState(null),[x,y]=q.useState(""),[E,R]=q.useState([]),[N,D]=q.useState(!1),[T,j]=q.useState(null),[B,F]=q.useState(!1),[Y,H]=q.useState(null),z=q.useRef(0),V=Kc(u),G=!!(c.trim()&&(n==="new"||n==="existing"&&V!==null||n==="paper"&&T!==null&&(u.trim()===""||V!==null))),X=Q=>{var re;o(Q),p||f(((re=Kc(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++z.current;R([]),D(!1),F(!0),H(null);try{const ae=await LN(Q);if(re!==z.current)return;j(ae);const Z=ae.repoUrl?Kc(ae.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(ae.title??"").trim().slice(0,60))}catch(ae){if(re!==z.current)return;H(ae instanceof Error?ae.message:String(ae))}finally{re===z.current&&F(!1)}}function L(){z.current++,j(null),y(""),R([]),H(null),o(""),p||f("")}q.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=AB(Q);if(!re&&Q.length<3){R([]),D(!1);return}const ae=++z.current;re||D(!0);const Z=setTimeout(()=>{if(re){K(re);return}jN(Q).then(P=>{ae===z.current&&R(P)}).catch(P=>{ae===z.current&&(R([]),H(P instanceof Error?P.message:String(P)))}).finally(()=>{ae===z.current&&D(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!G||w)){C(!0),S(null);try{const re=await MN(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!V?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:V.owner,githubRepo:V.repo,baselineBranch:_.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){S(re instanceof Error?re.message:String(re))}finally{C(!1)}}}const O=n==="new"||n==="paper"&&!V,$=m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),m.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),m.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${V?`${V.owner}/${V.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),m.jsxs("label",{children:["Branch",m.jsx("input",{value:_,onChange:Q=>v(Q.target.value),placeholder:"main"})]})]})]});return m.jsxs("form",{className:"form",onSubmit:M,children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),m.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),m.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["GitHub repository",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${V?"ok":""}`,children:V?`${V.owner} / ${V.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),$]}),n==="paper"&&(T===null?m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["Paper",m.jsx("input",{value:x,onChange:Q=>y(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint ${Y?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":Y??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&m.jsx("div",{className:"paper-results",children:E.map(Q=>m.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[m.jsx("span",{className:"title",children:NB(Q.title)}),m.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"paper-pick",children:[m.jsxs("div",{className:"meta",children:[m.jsx("div",{className:"title",children:T.title||T.paperId}),m.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),m.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),m.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${V?"ok":""}`,children:V?`${V.owner} / ${V.repo}`+(T.repoUrl&&((U=Kc(T.repoUrl))==null?void 0:U.repo)===V.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),V?$:m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]}),b&&m.jsx("div",{className:"error",children:b}),m.jsxs("div",{className:"actions",children:[t&&m.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!G||w,children:w?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Nb({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=q.useState(!1),[u,o]=q.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? +`)?1:0):0,x=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return m.jsxs("div",{className:"file-view",children:[m.jsxs("div",{className:"file-view-header",children:[m.jsx(VA,{size:13,style:{flexShrink:0}}),m.jsx("code",{className:"file-view-path",title:t,children:t}),r&&m.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),v&&m.jsx("button",{className:`icon-btn ${w?"active":""}`,title:w?"Rendered view":"Source view","aria-label":w?"Rendered view":"Source view",onClick:()=>C(y=>!y),children:m.jsx(BA,{size:13})}),m.jsx("button",{className:"icon-btn",title:"Reload file","aria-label":"Reload file",onClick:()=>_(y=>y+1),children:f?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),m.jsx("div",{className:"file-view-body",children:o?m.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?m.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?m.jsx("div",{className:"file-view-note",children:x(l)}):m.jsxs(m.Fragment,{children:[!r&&n&&l.root==="clone"&&m.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),v&&!w?m.jsx("div",{className:"file-view-md",children:m.jsx(qo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):m.jsxs("div",{className:"file-view-codewrap",children:[S>0&&m.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:S},(y,E)=>E+1).join(` +`)}),m.jsx("pre",{className:"file-view-code",children:m.jsx("code",{children:b})})]}),l.truncated&&m.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function _B({projectName:e,onHome:t,onCollapse:n}){return m.jsxs("div",{className:"rail-brand",children:[m.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[m.jsx(jo,{size:15}),m.jsx("span",{className:"brand-project",children:e})]}),n&&m.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:m.jsx(qS,{size:15})})]})}function vB({onDone:e}){const[t,n]=V.useState(0),[r,a]=V.useState(null),[l,u]=V.useState(null),[o,c]=V.useState(null),[f,p]=V.useState(null),[d,_]=V.useState(!1),v=C=>{_(!0),Promise.allSettled([wg(C).then(a),ex().then(u),QS().then(c),hT().then(p)]).finally(()=>_(!1))};V.useEffect(()=>v(!1),[]);const w=()=>{dT((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return m.jsx("div",{className:"home onboarding",children:m.jsx("div",{className:"home-inner",children:t===0?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 1 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Your coding agents"}),m.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),m.jsx("div",{className:"onb-cards",children:r===null?m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(C=>m.jsx(bB,{h:C},C.id))}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===1?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 2 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),m.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),m.jsx("div",{className:"onb-cards",children:m.jsx(SB,{git:l,onUpdate:u})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[m.jsx(jo,{size:12})," Back"]}),m.jsxs("button",{className:"btn ghost",onClick:()=>v(!1),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===2?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 3 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),m.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),m.jsx("div",{className:"onb-cards",children:m.jsx(xB,{dataDir:o,onUpdate:c})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 4 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Usage analytics"}),m.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),m.jsx("div",{className:"onb-cards",children:m.jsx(wB,{telemetry:f,onUpdate:p})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:w,children:["Create your first project ",m.jsx(Ic,{size:13})]})]})]})})})}function yB(e){return e.agentReady?{cls:"st-done",label:"connected"}:e.installed?{cls:"st-starting",label:"not signed in"}:{cls:"st-idle",label:"not detected"}}function bB({h:e}){var r,a;const t=yB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:e.name}),m.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),m.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>xu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):m.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function SB({git:e,onUpdate:t}){const[n,r]=V.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"status-badge st-failed",children:[m.jsx("span",{className:"dot"})," not found"]})]}),m.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),m.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"GitHub"}),m.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"signed in via gh CLI":"not connected"}),m.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&m.jsxs("div",{className:"onb-card-meta",children:["Set ",m.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&m.jsxs("div",{className:"onb-gh-options",children:[m.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),m.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?m.jsxs(m.Fragment,{children:[m.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),m.jsxs("button",{className:"btn ghost",onClick:a,children:[n?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx(yg,{size:12}),n?"Copied":"Copy"]}),m.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):m.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",m.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),m.jsx("div",{className:"onb-gh-or",children:"or"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),m.jsx(Sw,{onSaved:t})]})]})]})}function xB({dataDir:e,onUpdate:t}){const[n,r]=V.useState(""),[a,l]=V.useState(!1),[u,o]=V.useState(!1),[c,f]=V.useState(null);if(V.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:"status-badge st-done",children:[m.jsx(_n,{size:12,strokeWidth:3})," pinned"]})]}),m.jsxs("div",{className:"onb-card-meta",children:["Set by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function _(){if(!(u||!d)){o(!0),f(null);try{t(await KN(p)),l(!1)}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?m.jsx("span",{className:"dot"}):m.jsx(_n,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?m.jsxs(m.Fragment,{children:[m.jsx("input",{className:"mono",type:"text",value:n,onChange:v=>r(v.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&m.jsx("div",{className:"error",style:{marginTop:8},children:c}),m.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[m.jsx("button",{className:"btn primary",onClick:_,disabled:u||!d,children:u?"Saving…":"Use this folder"}),m.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):m.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",m.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function wB({telemetry:e,onUpdate:t}){const[n,r]=V.useState(!1);if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),fT(o).then(t).finally(()=>r(!1)))};return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsxs("div",{children:[m.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),m.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),m.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[m.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?m.jsx(_n,{size:12,strokeWidth:3}):null," On"]}),m.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:m.jsx(_n,{size:12,strokeWidth:3})," Off"]})]})]}),m.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",m.jsx("code",{children:"orx telemetry off"}),"."]}),l&&m.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function Kc(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function Ab(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function CB(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function EB(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function kB({onCreated:e,onCancel:t}){var F;const[n,r]=V.useState("paper"),[a,l]=V.useState("use"),[u,o]=V.useState(""),[c,f]=V.useState(""),[p,d]=V.useState(!1),[_,v]=V.useState("main"),[w,C]=V.useState(!1),[b,S]=V.useState(null),[x,y]=V.useState(""),[E,R]=V.useState([]),[N,D]=V.useState(!1),[T,j]=V.useState(null),[B,z]=V.useState(!1),[G,U]=V.useState(null),H=V.useRef(0),Y=Kc(u),q=!!(c.trim()&&(n==="new"||n==="existing"&&Y!==null||n==="paper"&&T!==null&&(u.trim()===""||Y!==null))),X=Q=>{var re;o(Q),p||f(((re=Kc(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++H.current;R([]),D(!1),z(!0),U(null);try{const ae=await RN(Q);if(re!==H.current)return;j(ae);const Z=ae.repoUrl?Kc(ae.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(ae.title??"").trim().slice(0,60))}catch(ae){if(re!==H.current)return;U(ae instanceof Error?ae.message:String(ae))}finally{re===H.current&&z(!1)}}function L(){H.current++,j(null),y(""),R([]),U(null),o(""),p||f("")}V.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=CB(Q);if(!re&&Q.length<3){R([]),D(!1);return}const ae=++H.current;re||D(!0);const Z=setTimeout(()=>{if(re){K(re);return}TN(Q).then(P=>{ae===H.current&&R(P)}).catch(P=>{ae===H.current&&(R([]),U(P instanceof Error?P.message:String(P)))}).finally(()=>{ae===H.current&&D(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!q||w)){C(!0),S(null);try{const re=await NN(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!Y?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:Y.owner,githubRepo:Y.repo,baselineBranch:_.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){S(re instanceof Error?re.message:String(re))}finally{C(!1)}}}const O=n==="new"||n==="paper"&&!Y,$=m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),m.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),m.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${Y?`${Y.owner}/${Y.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),m.jsxs("label",{children:["Branch",m.jsx("input",{value:_,onChange:Q=>v(Q.target.value),placeholder:"main"})]})]})]});return m.jsxs("form",{className:"form",onSubmit:M,children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),m.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),m.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["GitHub repository",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),$]}),n==="paper"&&(T===null?m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["Paper",m.jsx("input",{value:x,onChange:Q=>y(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint ${G?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":G??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&m.jsx("div",{className:"paper-results",children:E.map(Q=>m.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[m.jsx("span",{className:"title",children:EB(Q.title)}),m.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"paper-pick",children:[m.jsxs("div",{className:"meta",children:[m.jsx("div",{className:"title",children:T.title||T.paperId}),m.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),m.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),m.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`+(T.repoUrl&&((F=Kc(T.repoUrl))==null?void 0:F.repo)===Y.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),Y?$:m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]}),b&&m.jsx("div",{className:"error",children:b}),m.jsxs("div",{className:"actions",children:[t&&m.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!q||w,children:w?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Nb({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=V.useState(!1),[u,o]=V.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? -Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await BN(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return m.jsxs("div",{className:"home",children:[m.jsxs("div",{className:"home-inner",children:[m.jsxs("div",{className:"home-brand",children:["Open",m.jsx("span",{children:"Research"})]}),m.jsxs("div",{className:"home-head",children:[m.jsx("h2",{children:"Projects"}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[m.jsx(bg,{size:13})," New project"]})]}),m.jsx("div",{className:"home-list",children:e.length===0?m.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>m.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[m.jsx("span",{className:"name",children:f.name}),m.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&m.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),m.jsxs("span",{className:"time",children:["created ",Sa(f.createdAt)]}),m.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:m.jsx(Gu,{size:14})})]},f.id))})]}),a&&m.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:m.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[m.jsx("h2",{children:"New project"}),m.jsx(TB,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function RB(e){const t=ix(e.backend);return t?[t,rx(e.backend)].filter(Boolean).join(" · "):"—"}function DB({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?m.jsx("div",{className:"empty-state",children:m.jsx("p",{children:"No runs yet."})}):m.jsx("div",{className:"runs-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Run"}),m.jsx("th",{children:"Experiment"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Commit"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Exit"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return m.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[m.jsx("td",{className:"mono",children:Tp(o.id)}),m.jsx("td",{className:"mono",children:l.get(o.experimentId)??Tp(o.experimentId)}),m.jsx("td",{children:m.jsx(Vo,{status:o.status})}),m.jsx("td",{className:"mono",children:RB(o)}),m.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),m.jsx("td",{children:Sa(o.createdAt)}),m.jsx("td",{className:"mono",children:o.exitCode??"—"}),m.jsx("td",{children:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:m.jsx($u,{size:14})}),c&&m.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ft(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var MB={value:()=>{}};function mh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new pu(n)}function pu(e){this._=e}function jB(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}pu.prototype=mh.prototype={constructor:pu,on:function(e,t){var n=this._,r=jB(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=LB(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Tb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Tb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pu(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function LB(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Tb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=MB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ig="http://www.w3.org/1999/xhtml";const Rb={svg:"http://www.w3.org/2000/svg",xhtml:ig,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _h(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rb.hasOwnProperty(t)?{space:Rb[t],local:e}:e}function OB(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ig&&t.documentElement.namespaceURI===ig?t.createElement(e):t.createElementNS(n,e)}}function BB(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _C(e){var t=_h(e);return(t.local?BB:OB)(t)}function IB(){}function Em(e){return e==null?IB:function(){return this.querySelector(e)}}function zB(e){typeof e!="function"&&(e=Em(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=new Array(u),c,f,p=0;p<u;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),o[p]=f);return new jn(r,this._parents)}function HB(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FB(){return[]}function vC(e){return e==null?FB:function(){return this.querySelectorAll(e)}}function PB(e){return function(){return HB(e.apply(this,arguments))}}function UB(e){typeof e=="function"?e=PB(e):e=vC(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&(r.push(e.call(c,c.__data__,f,u)),a.push(c));return new jn(r,a)}function yC(e){return function(){return this.matches(e)}}function bC(e){return function(t){return t.matches(e)}}var $B=Array.prototype.find;function GB(e){return function(){return $B.call(this.children,e)}}function qB(){return this.firstElementChild}function VB(e){return this.select(e==null?qB:GB(typeof e=="function"?e:bC(e)))}var YB=Array.prototype.filter;function WB(){return Array.from(this.children)}function XB(e){return function(){return YB.call(this.children,e)}}function KB(e){return this.selectAll(e==null?WB:XB(typeof e=="function"?e:bC(e)))}function ZB(e){typeof e!="function"&&(e=yC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new jn(r,this._parents)}function SC(e){return new Array(e.length)}function QB(){return new jn(this._enter||this._groups.map(SC),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JB(e){return function(){return e}}function eI(e,t,n,r,a,l){for(var u=0,o,c=t.length,f=l.length;u<f;++u)(o=t[u])?(o.__data__=l[u],r[u]=o):n[u]=new Tu(e,l[u]);for(;u<c;++u)(o=t[u])&&(a[u]=o)}function tI(e,t,n,r,a,l,u){var o,c,f=new Map,p=t.length,d=l.length,_=new Array(p),v;for(o=0;o<p;++o)(c=t[o])&&(_[o]=v=u.call(c,c.__data__,o,t)+"",f.has(v)?a[o]=c:f.set(v,c));for(o=0;o<d;++o)v=u.call(e,l[o],o,l)+"",(c=f.get(v))?(r[o]=c,c.__data__=l[o],f.delete(v)):n[o]=new Tu(e,l[o]);for(o=0;o<p;++o)(c=t[o])&&f.get(_[o])===c&&(a[o]=c)}function nI(e){return e.__data__}function iI(e,t){if(!arguments.length)return Array.from(this,nI);var n=t?tI:eI,r=this._parents,a=this._groups;typeof e!="function"&&(e=JB(e));for(var l=a.length,u=new Array(l),o=new Array(l),c=new Array(l),f=0;f<l;++f){var p=r[f],d=a[f],_=d.length,v=rI(e.call(p,p&&p.__data__,f,r)),w=v.length,C=o[f]=new Array(w),b=u[f]=new Array(w),S=c[f]=new Array(_);n(p,d,C,b,S,v,t);for(var x=0,y=0,E,R;x<w;++x)if(E=C[x]){for(x>=y&&(y=x+1);!(R=b[y])&&++y<w;);E._next=R||null}}return u=new jn(u,r),u._enter=o,u._exit=c,u}function rI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sI(){return new jn(this._exit||this._groups.map(SC),this._parents)}function aI(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function oI(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),o=new Array(a),c=0;c<u;++c)for(var f=n[c],p=r[c],d=f.length,_=o[c]=new Array(d),v,w=0;w<d;++w)(v=f[w]||p[w])&&(_[w]=v);for(;c<a;++c)o[c]=n[c];return new jn(o,this._parents)}function lI(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function cI(e){e||(e=uI);function t(d,_){return d&&_?e(d.__data__,_.__data__):!d-!_}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],o=u.length,c=a[l]=new Array(o),f,p=0;p<o;++p)(f=u[p])&&(c[p]=f);c.sort(t)}return new jn(a,this._parents).order()}function uI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function hI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fI(){return Array.from(this)}function dI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function pI(){let e=0;for(const t of this)++e;return e}function gI(){return!this.node()}function mI(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,o;l<u;++l)(o=a[l])&&e.call(o,o.__data__,l,a);return this}function _I(e){return function(){this.removeAttribute(e)}}function vI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yI(e,t){return function(){this.setAttribute(e,t)}}function bI(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function SI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function wI(e,t){var n=_h(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?vI:_I:typeof t=="function"?n.local?xI:SI:n.local?bI:yI)(n,t))}function xC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CI(e){return function(){this.style.removeProperty(e)}}function EI(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kI(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function AI(e,t,n){return arguments.length>1?this.each((t==null?CI:typeof t=="function"?kI:EI)(e,t,n??"")):pa(this.node(),e)}function pa(e,t){return e.style.getPropertyValue(t)||xC(e).getComputedStyle(e,null).getPropertyValue(t)}function NI(e){return function(){delete this[e]}}function TI(e,t){return function(){this[e]=t}}function RI(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function DI(e,t){return arguments.length>1?this.each((t==null?NI:typeof t=="function"?RI:TI)(e,t)):this.node()[e]}function wC(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new CC(e)}function CC(e){this._node=e,this._names=wC(e.getAttribute("class")||"")}CC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function EC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function kC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function MI(e){return function(){EC(this,e)}}function jI(e){return function(){kC(this,e)}}function LI(e,t){return function(){(t.apply(this,arguments)?EC:kC)(this,e)}}function OI(e,t){var n=wC(e+"");if(arguments.length<2){for(var r=km(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?LI:t?MI:jI)(n,t))}function BI(){this.textContent=""}function II(e){return function(){this.textContent=e}}function zI(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function HI(e){return arguments.length?this.each(e==null?BI:(typeof e=="function"?zI:II)(e)):this.node().textContent}function FI(){this.innerHTML=""}function PI(e){return function(){this.innerHTML=e}}function UI(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $I(e){return arguments.length?this.each(e==null?FI:(typeof e=="function"?UI:PI)(e)):this.node().innerHTML}function GI(){this.nextSibling&&this.parentNode.appendChild(this)}function qI(){return this.each(GI)}function VI(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function YI(){return this.each(VI)}function WI(e){var t=typeof e=="function"?e:_C(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XI(){return null}function KI(e,t){var n=typeof e=="function"?e:_C(e),r=t==null?XI:typeof t=="function"?t:Em(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ZI(){var e=this.parentNode;e&&e.removeChild(this)}function QI(){return this.each(ZI)}function JI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function e7(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t7(e){return this.select(e?e7:JI)}function n7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function i7(e){return function(t){e.call(this,t,this.__data__)}}function r7(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function s7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function a7(e,t,n){return function(){var r=this.__on,a,l=i7(t);if(r){for(var u=0,o=r.length;u<o;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function o7(e,t,n){var r=r7(e+""),a,l=r.length,u;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,f=o.length,p;c<f;++c)for(a=0,p=o[c];a<l;++a)if((u=r[a]).type===p.type&&u.name===p.name)return p.value}return}for(o=t?a7:s7,a=0;a<l;++a)this.each(o(r[a],t,n));return this}function AC(e,t,n){var r=xC(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function l7(e,t){return function(){return AC(this,e,t)}}function c7(e,t){return function(){return AC(this,e,t.apply(this,arguments))}}function u7(e,t){return this.each((typeof t=="function"?c7:l7)(e,t))}function*h7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var NC=[null];function jn(e,t){this._groups=e,this._parents=t}function dl(){return new jn([[document.documentElement]],NC)}function f7(){return this}jn.prototype=dl.prototype={constructor:jn,select:zB,selectAll:UB,selectChild:VB,selectChildren:KB,filter:ZB,data:iI,enter:QB,exit:sI,join:aI,merge:oI,selection:f7,order:lI,sort:cI,call:hI,nodes:fI,node:dI,size:pI,empty:gI,each:mI,attr:wI,style:AI,property:DI,classed:OI,text:HI,html:$I,raise:qI,lower:YI,append:WI,insert:KI,remove:QI,clone:t7,datum:n7,on:o7,dispatch:u7,[Symbol.iterator]:h7};function An(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],NC)}function d7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xn(e,t){if(e=d7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const p7={passive:!1},Zo={capture:!0,passive:!1};function pp(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function TC(e){var t=e.document.documentElement,n=An(e).on("dragstart.drag",ua,Zo);"onselectstart"in t?n.on("selectstart.drag",ua,Zo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RC(e,t){var n=e.document.documentElement,r=An(e).on("dragstart.drag",null);t&&(r.on("click.drag",ua,Zo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zc=e=>()=>e;function rg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}rg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function g7(e){return!e.ctrlKey&&!e.button}function m7(){return this.parentNode}function _7(e,t){return t??{x:e.x,y:e.y}}function v7(){return navigator.maxTouchPoints||"ontouchstart"in this}function DC(){var e=g7,t=m7,n=_7,r=v7,a={},l=mh("start","drag","end"),u=0,o,c,f,p,d=0;function _(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",b).on("touchmove.drag",S,p7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,R){if(!(p||!e.call(this,E,R))){var N=y(this,t.call(this,E,R),E,R,"mouse");N&&(An(E.view).on("mousemove.drag",w,Zo).on("mouseup.drag",C,Zo),TC(E.view),pp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function w(E){if(ua(E),!f){var R=E.clientX-o,N=E.clientY-c;f=R*R+N*N>d}a.mouse("drag",E)}function C(E){An(E.view).on("mousemove.drag mouseup.drag",null),RC(E.view,f),ua(E),a.mouse("end",E)}function b(E,R){if(e.call(this,E,R)){var N=E.changedTouches,D=t.call(this,E,R),T=N.length,j,B;for(j=0;j<T;++j)(B=y(this,D,E,R,N[j].identifier,N[j]))&&(pp(E),B("start",E,N[j]))}}function S(E){var R=E.changedTouches,N=R.length,D,T;for(D=0;D<N;++D)(T=a[R[D].identifier])&&(ua(E),T("drag",E,R[D]))}function x(E){var R=E.changedTouches,N=R.length,D,T;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),D=0;D<N;++D)(T=a[R[D].identifier])&&(pp(E),T("end",E,R[D]))}function y(E,R,N,D,T,j){var B=l.copy(),F=Xn(j||N,R),Y,H,z;if((z=n.call(E,new rg("beforestart",{sourceEvent:N,target:_,identifier:T,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:B}),D))!=null)return Y=z.x-F[0]||0,H=z.y-F[1]||0,function V(G,X,K){var L=F,M;switch(G){case"start":a[T]=V,M=u++;break;case"end":delete a[T],--u;case"drag":F=Xn(K||X,R),M=u;break}B.call(G,E,new rg(G,{sourceEvent:X,subject:z,target:_,identifier:T,active:M,x:F[0]+Y,y:F[1]+H,dx:F[0]-L[0],dy:F[1]-L[1],dispatch:B}),D)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Zc(!!E),_):e},_.container=function(E){return arguments.length?(t=typeof E=="function"?E:Zc(E),_):t},_.subject=function(E){return arguments.length?(n=typeof E=="function"?E:Zc(E),_):n},_.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Zc(!!E),_):r},_.on=function(){var E=l.on.apply(l,arguments);return E===l?_:E},_.clickDistance=function(E){return arguments.length?(d=(E=+E)*E,_):Math.sqrt(d)},_}function Am(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function MC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pl(){}var Qo=.7,Ru=1/Qo,ha="\\s*([+-]?\\d+)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",y7=/^#([0-9a-f]{3,8})$/,b7=new RegExp(`^rgb\\(${ha},${ha},${ha}\\)$`),S7=new RegExp(`^rgb\\(${ui},${ui},${ui}\\)$`),x7=new RegExp(`^rgba\\(${ha},${ha},${ha},${Jo}\\)$`),w7=new RegExp(`^rgba\\(${ui},${ui},${ui},${Jo}\\)$`),C7=new RegExp(`^hsl\\(${Jo},${ui},${ui}\\)$`),E7=new RegExp(`^hsla\\(${Jo},${ui},${ui},${Jo}\\)$`),Db={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Am(pl,rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mb,formatHex:Mb,formatHex8:k7,formatHsl:A7,formatRgb:jb,toString:jb});function Mb(){return this.rgb().formatHex()}function k7(){return this.rgb().formatHex8()}function A7(){return jC(this).formatHsl()}function jb(){return this.rgb().formatRgb()}function rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=y7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Lb(t):n===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=b7.exec(e))?new mn(t[1],t[2],t[3],1):(t=S7.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x7.exec(e))?Qc(t[1],t[2],t[3],t[4]):(t=w7.exec(e))?Qc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=C7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,1):(t=E7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,t[4]):Db.hasOwnProperty(e)?Lb(Db[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Lb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Qc(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function N7(e){return e instanceof pl||(e=rs(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function sg(e,t,n,r){return arguments.length===1?N7(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Am(mn,sg,MC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(es(this.r),es(this.g),es(this.b),Du(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ob,formatHex:Ob,formatHex8:T7,formatRgb:Bb,toString:Bb}));function Ob(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function T7(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bb(){const e=Du(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Du(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function Ib(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function jC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof pl||(e=rs(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n<r)*6:n===l?u=(r-t)/o+2:u=(t-n)/o+4,o/=c<.5?l+a:2-l-a,u*=60):o=c>0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function R7(e,t,n,r){return arguments.length===1?jC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Am(Kn,R7,MC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(gp(e>=240?e-240:e+120,a,r),gp(e,a,r),gp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(zb(this.h),Jc(this.s),Jc(this.l),Du(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Du(this.opacity);return`${e===1?"hsl(":"hsla("}${zb(this.h)}, ${Jc(this.s)*100}%, ${Jc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zb(e){return e=(e||0)%360,e<0?e+360:e}function Jc(e){return Math.max(0,Math.min(1,e||0))}function gp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Nm=e=>()=>e;function D7(e,t){return function(n){return e+n*t}}function M7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function j7(e){return(e=+e)==1?LC:function(t,n){return n-t?M7(t,n,e):Nm(isNaN(t)?n:t)}}function LC(e,t){var n=t-e;return n?D7(e,n):Nm(isNaN(e)?t:e)}const Mu=(function e(t){var n=j7(t);function r(a,l){var u=n((a=sg(a)).r,(l=sg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=LC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function L7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function O7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function B7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=zo(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(o){for(u=0;u<r;++u)l[u]=a[u](o);return l}}function I7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ci(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function z7(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=zo(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var ag=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mp=new RegExp(ag.source,"g");function H7(e){return function(){return e}}function F7(e){return function(t){return e(t)+""}}function OC(e,t){var n=ag.lastIndex=mp.lastIndex=0,r,a,l,u=-1,o=[],c=[];for(e=e+"",t=t+"";(r=ag.exec(e))&&(a=mp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ci(r,a)})),n=mp.lastIndex;return n<t.length&&(l=t.slice(n),o[u]?o[u]+=l:o[++u]=l),o.length<2?c[0]?F7(c[0].x):H7(t):(t=c.length,function(f){for(var p=0,d;p<t;++p)o[(d=c[p]).i]=d.x(f);return o.join("")})}function zo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Nm(t):(n==="number"?ci:n==="string"?(r=rs(t))?(t=r,Mu):OC:t instanceof rs?Mu:t instanceof Date?I7:O7(t)?L7:Array.isArray(t)?B7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?z7:ci)(e,t)}var Hb=180/Math.PI,og={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function BC(e,t,n,r,a,l){var u,o,c;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Hb,skewX:Math.atan(c)*Hb,scaleX:u,scaleY:o}}var eu;function P7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?og:BC(t.a,t.b,t.c,t.d,t.e,t.f)}function U7(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?og:(e=e.matrix,BC(e.a,e.b,e.c,e.d,e.e,e.f))}function IC(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function l(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push("translate(",null,t,null,n);w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d||_)&&v.push("translate("+d+t+_+n)}function u(f,p,d,_){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),_.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ci(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,_){f!==p?_.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ci(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push(a(v)+"scale(",null,",",null,")");w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d!==1||_!==1)&&v.push(a(v)+"scale("+d+","+_+")")}return function(f,p){var d=[],_=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,_),u(f.rotate,p.rotate,d,_),o(f.skewX,p.skewX,d,_),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,_),f=p=null,function(v){for(var w=-1,C=_.length,b;++w<C;)d[(b=_[w]).i]=b.x(v);return d.join("")}}}var $7=IC(P7,"px, ","px)","deg)"),G7=IC(U7,", ",")",")"),q7=1e-12;function Fb(e){return((e=Math.exp(e))+1/e)/2}function V7(e){return((e=Math.exp(e))-1/e)/2}function Y7(e){return((e=Math.exp(2*e))-1)/(e+1)}const gu=(function e(t,n,r){function a(l,u){var o=l[0],c=l[1],f=l[2],p=u[0],d=u[1],_=u[2],v=p-o,w=d-c,C=v*v+w*w,b,S;if(C<q7)S=Math.log(_/f)/t,b=function(D){return[o+D*v,c+D*w,f*Math.exp(t*D*S)]};else{var x=Math.sqrt(C),y=(_*_-f*f+r*C)/(2*f*n*x),E=(_*_-f*f-r*C)/(2*_*n*x),R=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(E*E+1)-E);S=(N-R)/t,b=function(D){var T=D*S,j=Fb(R),B=f/(n*x)*(j*Y7(t*T+R)-V7(R));return[o+B*v,c+B*w,f*j/Fb(t*T+R)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return a.rho=function(l){var u=Math.max(.001,+l),o=u*u,c=o*o;return e(u,o,c)},a})(Math.SQRT2,2,4);var ga=0,Do=0,To=0,zC=1e3,ju,Mo,Lu=0,ss=0,vh=0,el=typeof performance=="object"&&performance.now?performance:Date,HC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return ss||(HC(W7),ss=el.now()+vh)}function W7(){ss=0}function Ou(){this._call=this._time=this._next=null}Ou.prototype=FC.prototype={constructor:Ou,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Tm():+n)+(t==null?0:+t),!this._next&&Mo!==this&&(Mo?Mo._next=this:ju=this,Mo=this),this._call=e,this._time=n,lg()},stop:function(){this._call&&(this._call=null,this._time=1/0,lg())}};function FC(e,t,n){var r=new Ou;return r.restart(e,t,n),r}function X7(){Tm(),++ga;for(var e=ju,t;e;)(t=ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ga}function Pb(){ss=(Lu=el.now())+vh,ga=Do=0;try{X7()}finally{ga=0,Z7(),ss=0}}function K7(){var e=el.now(),t=e-Lu;t>zC&&(vh-=t,Lu=e)}function Z7(){for(var e,t=ju,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ju=n);Mo=e,lg(r)}function lg(e){if(!ga){Do&&(Do=clearTimeout(Do));var t=e-ss;t>24?(e<1/0&&(Do=setTimeout(Pb,e-el.now()-vh)),To&&(To=clearInterval(To))):(To||(Lu=el.now(),To=setInterval(K7,zC)),ga=1,HC(Pb))}}function Ub(e,t,n){var r=new Ou;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Q7=mh("start","end","cancel","interrupt"),J7=[],PC=0,$b=1,cg=2,mu=3,Gb=4,ug=5,_u=6;function yh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;e9(e,n,{name:t,index:r,group:a,on:Q7,tween:J7,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:PC})}function Rm(e,t){var n=ti(e,t);if(n.state>PC)throw new Error("too late; already scheduled");return n}function pi(e,t){var n=ti(e,t);if(n.state>mu)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=FC(l,0,n.time);function l(f){n.state=$b,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,_,v;if(n.state!==$b)return c();for(p in r)if(v=r[p],v.name===n.name){if(v.state===mu)return Ub(u);v.state===Gb?(v.state=_u,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[p]):+p<t&&(v.state=_u,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[p])}if(Ub(function(){n.state===mu&&(n.state=Gb,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=cg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===cg){for(n.state=mu,a=new Array(_=n.tween.length),p=0,d=-1;p<_;++p)(v=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=v);a.length=d+1}}function o(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=ug,1),d=-1,_=a.length;++d<_;)a[d].call(e,p);n.state===ug&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=_u,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function vu(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>cg&&r.state<ug,r.state=_u,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function t9(e){return this.each(function(){vu(this,e)})}function n9(e,t){var n,r;return function(){var a=pi(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,o=r.length;u<o;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function i9(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=pi(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var o={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=o;break}c===f&&a.push(o)}l.tween=a}}function r9(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ti(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?n9:i9)(n,e,t))}function Dm(e,t,n){var r=e._id;return e.each(function(){var a=pi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ti(a,r).value[t]}}function UC(e,t){var n;return(typeof t=="number"?ci:t instanceof rs?Mu:(n=rs(t))?(t=n,Mu):OC)(e,t)}function s9(e){return function(){this.removeAttribute(e)}}function a9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function l9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function c9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttribute(e):(u=this.getAttribute(e),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function u9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function h9(e,t){var n=_h(e),r=n==="transform"?G7:UC;return this.attrTween(e,typeof t=="function"?(n.local?u9:c9)(n,r,Dm(this,"attr."+e,t)):t==null?(n.local?a9:s9)(n):(n.local?l9:o9)(n,r,t))}function f9(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function d9(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function p9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&d9(e,l)),n}return a._value=t,a}function g9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&f9(e,l)),n}return a._value=t,a}function m9(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_h(e);return this.tween(n,(r.local?p9:g9)(r,t))}function _9(e,t){return function(){Rm(this,e).delay=+t.apply(this,arguments)}}function v9(e,t){return t=+t,function(){Rm(this,e).delay=t}}function y9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_9:v9)(t,e)):ti(this.node(),t).delay}function b9(e,t){return function(){pi(this,e).duration=+t.apply(this,arguments)}}function S9(e,t){return t=+t,function(){pi(this,e).duration=t}}function x9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?b9:S9)(t,e)):ti(this.node(),t).duration}function w9(e,t){if(typeof t!="function")throw new Error;return function(){pi(this,e).ease=t}}function C9(e){var t=this._id;return arguments.length?this.each(w9(t,e)):ti(this.node(),t).ease}function E9(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pi(this,e).ease=n}}function k9(e){if(typeof e!="function")throw new Error;return this.each(E9(this._id,e))}function A9(e){typeof e!="function"&&(e=yC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new Gi(r,this._parents,this._name,this._id)}function N9(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),o=0;o<l;++o)for(var c=t[o],f=n[o],p=c.length,d=u[o]=new Array(p),_,v=0;v<p;++v)(_=c[v]||f[v])&&(d[v]=_);for(;o<r;++o)u[o]=t[o];return new Gi(u,this._parents,this._name,this._id)}function T9(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function R9(e,t,n){var r,a,l=T9(t)?Rm:pi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function D9(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(R9(n,e,t))}function M9(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function j9(){return this.on("end.remove",M9(this._id))}function L9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Em(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var o=r[u],c=o.length,f=l[u]=new Array(c),p,d,_=0;_<c;++_)(p=o[_])&&(d=e.call(p,p.__data__,_,o))&&("__data__"in p&&(d.__data__=p.__data__),f[_]=d,yh(f[_],t,n,_,f,ti(p,n)));return new Gi(l,this._parents,t,n)}function O9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,a=r.length,l=[],u=[],o=0;o<a;++o)for(var c=r[o],f=c.length,p,d=0;d<f;++d)if(p=c[d]){for(var _=e.call(p,p.__data__,d,c),v,w=ti(p,n),C=0,b=_.length;C<b;++C)(v=_[C])&&yh(v,t,n,C,_,w);l.push(_),u.push(p)}return new Gi(l,u,t,n)}var B9=dl.prototype.constructor;function I9(){return new B9(this._groups,this._parents)}function z9(e,t){var n,r,a;return function(){var l=pa(this,e),u=(this.style.removeProperty(e),pa(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function $C(e){return function(){this.style.removeProperty(e)}}function H9(e,t,n){var r,a=n+"",l;return function(){var u=pa(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function F9(e,t,n){var r,a,l;return function(){var u=pa(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),pa(this,e))),u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o))}}function P9(e,t){var n,r,a,l="style."+t,u="end."+l,o;return function(){var c=pi(this,e),f=c.on,p=c.value[l]==null?o||(o=$C(t)):void 0;(f!==n||a!==p)&&(r=(n=f).copy()).on(u,a=p),c.on=r}}function U9(e,t,n){var r=(e+="")=="transform"?$7:UC;return t==null?this.styleTween(e,z9(e,r)).on("end.style."+e,$C(e)):typeof t=="function"?this.styleTween(e,F9(e,r,Dm(this,"style."+e,t))).each(P9(this._id,e)):this.styleTween(e,H9(e,r,t),n).on("end.style."+e,null)}function $9(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function G9(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&$9(e,u,n)),r}return l._value=t,l}function q9(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,G9(e,t,n??""))}function V9(e){return function(){this.textContent=e}}function Y9(e){return function(){var t=e(this);this.textContent=t??""}}function W9(e){return this.tween("text",typeof e=="function"?Y9(Dm(this,"text",e)):V9(e==null?"":e+""))}function X9(e){return function(t){this.textContent=e.call(this,t)}}function K9(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&X9(a)),t}return r._value=e,r}function Z9(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,K9(e))}function Q9(){for(var e=this._name,t=this._id,n=GC(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)if(c=u[f]){var p=ti(c,t);yh(c,e,n,f,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Gi(r,this._parents,e,n)}function J9(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var o={value:u},c={value:function(){--a===0&&l()}};n.each(function(){var f=pi(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),f.on=t}),a===0&&l()})}var ez=0;function Gi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function GC(){return++ez}var Fi=dl.prototype;Gi.prototype={constructor:Gi,select:L9,selectAll:O9,selectChild:Fi.selectChild,selectChildren:Fi.selectChildren,filter:A9,merge:N9,selection:I9,transition:Q9,call:Fi.call,nodes:Fi.nodes,node:Fi.node,size:Fi.size,empty:Fi.empty,each:Fi.each,on:D9,attr:h9,attrTween:m9,style:U9,styleTween:q9,text:W9,textTween:Z9,remove:j9,tween:r9,delay:y9,duration:x9,ease:C9,easeVarying:k9,end:J9,[Symbol.iterator]:Fi[Symbol.iterator]};function tz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nz={time:null,delay:0,duration:250,ease:tz};function iz(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rz(e){var t,n;e instanceof Gi?(t=e._id,e=e._name):(t=GC(),(n=nz).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&yh(c,e,t,f,u,n||iz(c,t));return new Gi(r,this._parents,e,t)}dl.prototype.interrupt=t9;dl.prototype.transition=rz;const tu=e=>()=>e;function sz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Pi(e,t,n){this.k=e,this.x=t,this.y=n}Pi.prototype={constructor:Pi,scale:function(e){return e===1?this:new Pi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bh=new Pi(1,0,0);qC.prototype=Pi.prototype;function qC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bh;return e.__zoom}function _p(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function az(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qb(){return this.__zoom||bh}function lz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cz(){return navigator.maxTouchPoints||"ontouchstart"in this}function uz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function VC(){var e=az,t=oz,n=uz,r=lz,a=cz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=gu,f=mh("start","zoom","end"),p,d,_,v=500,w=150,C=0,b=10;function S(z){z.property("__zoom",qb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",F).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(z,V,G,X){var K=z.selection?z.selection():z;K.property("__zoom",qb),z!==K?R(z,V,G,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(z,V,G,X){S.scaleTo(z,function(){var K=this.__zoom.k,L=typeof V=="function"?V.apply(this,arguments):V;return K*L},G,X)},S.scaleTo=function(z,V,G,X){S.transform(z,function(){var K=t.apply(this,arguments),L=this.__zoom,M=G==null?E(K):typeof G=="function"?G.apply(this,arguments):G,O=L.invert(M),$=typeof V=="function"?V.apply(this,arguments):V;return n(y(x(L,$),M,O),K,u)},G,X)},S.translateBy=function(z,V,G,X){S.transform(z,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof G=="function"?G.apply(this,arguments):G),t.apply(this,arguments),u)},null,X)},S.translateTo=function(z,V,G,X,K){S.transform(z,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(bh.translate(O[0],O[1]).scale(M.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof G=="function"?-G.apply(this,arguments):-G),L,u)},X,K)};function x(z,V){return V=Math.max(l[0],Math.min(l[1],V)),V===z.k?z:new Pi(V,z.x,z.y)}function y(z,V,G){var X=V[0]-G[0]*z.k,K=V[1]-G[1]*z.k;return X===z.x&&K===z.y?z:new Pi(z.k,X,K)}function E(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function R(z,V,G,X){z.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),$=G==null?E(O):typeof G=="function"?G.apply(K,L):G,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof V=="function"?V.apply(K,L):V,ae=c(Q.invert($).concat(U/Q.k),re.invert($).concat(U/re.k));return function(Z){if(Z===1)Z=re;else{var P=ae(Z),ee=U/P[2];Z=new Pi(ee,$[0]-P[0]*ee,$[1]-P[1]*ee)}M.zoom(null,Z)}})}function N(z,V,G){return!G&&z.__zooming||new D(z,V)}function D(z,V){this.that=z,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,V),this.taps=0}D.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,V){return this.mouse&&z!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var V=An(this.that).datum();f.call(z,this.that,new sz(z,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),V)}};function T(z,...V){if(!e.apply(this,arguments))return;var G=N(this,V).event(z),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(z);if(G.wheel)(G.mouse[0][0]!==L[0]||G.mouse[0][1]!==L[1])&&(G.mouse[1]=X.invert(G.mouse[0]=L)),clearTimeout(G.wheel);else{if(X.k===K)return;G.mouse=[L,X.invert(L)],vu(this),G.start()}Ro(z),G.wheel=setTimeout(M,w),G.zoom("mouse",n(y(x(X,K),G.mouse[0],G.mouse[1]),G.extent,u));function M(){G.wheel=null,G.end()}}function j(z,...V){if(_||!e.apply(this,arguments))return;var G=z.currentTarget,X=N(this,V,!0).event(z),K=An(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),L=Xn(z,G),M=z.clientX,O=z.clientY;TC(z.view),_p(z),X.mouse=[L,this.__zoom.invert(L)],vu(this),X.start();function $(Q){if(Ro(Q),!X.moved){var re=Q.clientX-M,ae=Q.clientY-O;X.moved=re*re+ae*ae>C}X.event(Q).zoom("mouse",n(y(X.that.__zoom,X.mouse[0]=Xn(Q,G),X.mouse[1]),X.extent,u))}function U(Q){K.on("mousemove.zoom mouseup.zoom",null),RC(Q.view,X.moved),Ro(Q),X.event(Q).end()}}function B(z,...V){if(e.apply(this,arguments)){var G=this.__zoom,X=Xn(z.changedTouches?z.changedTouches[0]:z,this),K=G.invert(X),L=G.k*(z.shiftKey?.5:2),M=n(y(x(G,L),X,K),t.apply(this,V),u);Ro(z),o>0?An(this).transition().duration(o).call(R,M,X,z):An(this).call(S.transform,M,X,z)}}function F(z,...V){if(e.apply(this,arguments)){var G=z.touches,X=G.length,K=N(this,V,z.changedTouches.length===X).event(z),L,M,O,$;for(_p(z),M=0;M<X;++M)O=G[M],$=Xn(O,this),$=[$,this.__zoom.invert($),O.identifier],K.touch0?!K.touch1&&K.touch0[2]!==$[2]&&(K.touch1=$,K.taps=0):(K.touch0=$,L=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),L&&(K.taps<2&&(d=$[0],p=setTimeout(function(){p=null},v)),vu(this),K.start())}}function Y(z,...V){if(this.__zooming){var G=N(this,V).event(z),X=z.changedTouches,K=X.length,L,M,O,$;for(Ro(z),L=0;L<K;++L)M=X[L],O=Xn(M,this),G.touch0&&G.touch0[2]===M.identifier?G.touch0[0]=O:G.touch1&&G.touch1[2]===M.identifier&&(G.touch1[0]=O);if(M=G.that.__zoom,G.touch1){var U=G.touch0[0],Q=G.touch0[1],re=G.touch1[0],ae=G.touch1[1],Z=(Z=re[0]-U[0])*Z+(Z=re[1]-U[1])*Z,P=(P=ae[0]-Q[0])*P+(P=ae[1]-Q[1])*P;M=x(M,Math.sqrt(Z/P)),O=[(U[0]+re[0])/2,(U[1]+re[1])/2],$=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2]}else if(G.touch0)O=G.touch0[0],$=G.touch0[1];else return;G.zoom("touch",n(y(M,O,$),G.extent,u))}}function H(z,...V){if(this.__zooming){var G=N(this,V).event(z),X=z.changedTouches,K=X.length,L,M;for(_p(z),_&&clearTimeout(_),_=setTimeout(function(){_=null},v),L=0;L<K;++L)M=X[L],G.touch0&&G.touch0[2]===M.identifier?delete G.touch0:G.touch1&&G.touch1[2]===M.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(M=Xn(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<b)){var O=An(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return S.wheelDelta=function(z){return arguments.length?(r=typeof z=="function"?z:tu(+z),S):r},S.filter=function(z){return arguments.length?(e=typeof z=="function"?z:tu(!!z),S):e},S.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:tu(!!z),S):a},S.extent=function(z){return arguments.length?(t=typeof z=="function"?z:tu([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),S):t},S.scaleExtent=function(z){return arguments.length?(l[0]=+z[0],l[1]=+z[1],S):[l[0],l[1]]},S.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(z){return arguments.length?(n=z,S):n},S.duration=function(z){return arguments.length?(o=+z,S):o},S.interpolate=function(z){return arguments.length?(c=z,S):c},S.on=function(){var z=f.on.apply(f,arguments);return z===f?S:z},S.clickDistance=function(z){return arguments.length?(C=(z=+z)*z,S):Math.sqrt(C)},S.tapDistance=function(z){return arguments.length?(b=+z,S):b},S}const ei={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],YC=["Enter"," ","Escape"],WC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ma;(function(e){e.Strict="strict",e.Loose="loose"})(ma||(ma={}));var ts;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ts||(ts={}));var nl;(function(e){e.Partial="partial",e.Full="full"})(nl||(nl={}));const XC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Er;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Er||(Er={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var Me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Me||(Me={}));const Vb={[Me.Left]:Me.Right,[Me.Right]:Me.Left,[Me.Top]:Me.Bottom,[Me.Bottom]:Me.Top};function KC(e){return e===null?null:e?"valid":"invalid"}const ZC=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,hz=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mm=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gl=(e,t=[0,0])=>{const{width:n,height:r}=gi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},fz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Mm(a)?a:t.nodeLookup.get(a.id));const o=u?Iu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Sh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xh(n)},ml=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Sh(n,Iu(a)),r=!0)}),r?xh(n):{x:0,y:0,width:0,height:0}},jm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const _ of e.values()){const{measured:v,selectable:w=!0,hidden:C=!1}=_;if(u&&!w||C)continue;const b=v.width??_.width??_.initialWidth??0,S=v.height??_.height??_.initialHeight??0,{x,y}=_.internals.positionAbsolute,E=t2(o,c,f,p,x,y,b,S),R=b*S,N=l&&E>0;(!_.internals.handleBounds||N||E>=R||_.dragging)&&d.push(_)}return d},dz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function pz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{let l;if(t!=null&&t.includeHiddenNodes){const{width:u,height:o}=gi(a);l=u>0&&o>0}else l=!!(a.measured.width&&a.measured.height&&!a.hidden);l&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function gz({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=pz(e,u),c=ml(o),f=Om(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function QC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const v=o.measured.width,w=o.measured.height;v&&w&&(d=[[c,f],[c+v,f+w]])}else o&&os(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const _=os(d)?as(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:_.x-c+(u.measured.width??0)*p[0],y:_.y-f+(u.measured.height??0)*p[1]},positionAbsolute:_}}async function mz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(_=>_.id)),u=[];for(const _ of n){if(_.deletable===!1)continue;const v=l.has(_.id),w=!v&&_.parentId&&u.find(C=>C.id===_.parentId);(v||w)&&u.push(_)}const o=new Set(t.map(_=>_.id)),c=r.filter(_=>_.deletable!==!1),p=dz(u,c);for(const _ of c)o.has(_.id)&&!p.find(w=>w.id===_.id)&&p.push(_);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const _a=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),as=(e={x:0,y:0},t,n)=>({x:_a(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:_a(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function JC(e,t,n){const{width:r,height:a}=gi(n),{x:l,y:u}=n.internals.positionAbsolute;return as(e,[[l,u],[l+r,u+a]],t)}const Yb=(e,t,n)=>e<t?_a(Math.abs(e-t),1,t)/t:e>n?-_a(Math.abs(e-n),1,t)/t:0,Lm=(e,t,n=15,r=40)=>{const a=Yb(e.x,r,t.width-r)*n,l=Yb(e.y,r,t.height-r)*n;return[a,l]},Sh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),hg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),xh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),il=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Iu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},e2=(e,t)=>xh(Sh(hg(e),hg(t))),t2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},zu=(e,t)=>t2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Wb=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),n2=(e,t)=>(n,r)=>{},_l=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?_l(o,u):o},va=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ta(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function _z(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ta(e,n),a=ta(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ta(e.top??e.y??0,n),a=ta(e.bottom??e.y??0,n),l=ta(e.left??e.x??0,t),u=ta(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vz(e,t,n,r,a,l){const{x:u,y:o}=va(e,[t,n,r]),{x:c,y:f}=va({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Om=(e,t,n,r,a,l)=>{const u=_z(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=_a(f,r,a),d=e.x+e.width/2,_=e.y+e.height/2,v=t/2-d*p,w=n/2-_*p,C=vz(e,v,w,p,t,n),b={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-b.left+b.right,y:w-b.top+b.bottom,zoom:p}},rl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function os(e){return e!=null&&e!=="parent"}function gi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function i2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function r2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function Xb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yz(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function bz(e){return{...WC,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=vl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?_l(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Bm=e=>({width:e.offsetWidth,height:e.offsetHeight}),s2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Sz=["INPUT","SELECT","TEXTAREA"];function a2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Sz.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const o2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=o2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},Kb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Bm(u)}})};function l2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function nu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Zb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case Me.Left:return[t-nu(t-r,l),n];case Me.Right:return[t+nu(r-t,l),n];case Me.Top:return[t,n-nu(n-a,l)];case Me.Bottom:return[t,n+nu(a-n,l)]}}function c2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,curvature:u=.25}){const[o,c]=Zb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=Zb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,_,v,w]=l2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,_,v,w]}function u2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,o=r<t?r+u:r-u;return[l,o,a,u]}function xz({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+o}function wz({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=Sh(Iu(e),Iu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return zu(u,xh(l))>0}const Cz=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Ez=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),kz=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||Cz;let a;return ZC(e)?a={...e}:a={...e,id:r(e)},Ez(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function h2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=u2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const Qb={[Me.Left]:{x:-1,y:0},[Me.Right]:{x:1,y:0},[Me.Top]:{x:0,y:-1},[Me.Bottom]:{x:0,y:1}},Az=({source:e,sourcePosition:t=Me.Bottom,target:n})=>t===Me.Left||t===Me.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Jb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Nz({source:e,sourcePosition:t=Me.Bottom,target:n,targetPosition:r=Me.Top,center:a,offset:l,stepPosition:u}){const o=Qb[t],c=Qb[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=Az({source:f,sourcePosition:t,target:p}),_=d.x!==0?"x":"y",v=d[_];let w=[],C,b;const S={x:0,y:0},x={x:0,y:0},[,,y,E]=u2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[_]*c[_]===-1){_==="x"?(C=a.x??f.x+(p.x-f.x)*u,b=a.y??(f.y+p.y)/2):(C=a.x??(f.x+p.x)/2,b=a.y??f.y+(p.y-f.y)*u);const T=[{x:C,y:f.y},{x:C,y:p.y}],j=[{x:f.x,y:b},{x:p.x,y:b}];o[_]===v?w=_==="x"?T:j:w=_==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(_==="x"?w=o.x===v?j:T:w=o.y===v?T:j,t===r){const z=Math.abs(e[_]-n[_]);if(z<=l){const V=Math.min(l-1,l-z);o[_]===v?S[_]=(f[_]>e[_]?-1:1)*V:x[_]=(p[_]>n[_]?-1:1)*V}}if(t!==r){const z=_==="x"?"y":"x",V=o[_]===c[z],G=f[z]>p[z],X=f[z]<p[z];(o[_]===1&&(!V&&G||V&&X)||o[_]!==1&&(!V&&X||V&&G))&&(w=_==="x"?T:j)}const B={x:f.x+S.x,y:f.y+S.y},F={x:p.x+x.x,y:p.y+x.y},Y=Math.max(Math.abs(B.x-w[0].x),Math.abs(F.x-w[0].x)),H=Math.max(Math.abs(B.y-w[0].y),Math.abs(F.y-w[0].y));Y>=H?(C=(B.x+F.x)/2,b=w[0].y):(C=w[0].x,b=(B.y+F.y)/2)}const R={x:f.x+S.x,y:f.y+S.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...R.x!==w[0].x||R.y!==w[0].y?[R]:[],...w,...N.x!==w[w.length-1].x||N.y!==w[w.length-1].y?[N]:[],n],C,b,y,E]}function Tz(e,t,n,r){const a=Math.min(Jb(e,t)/2,Jb(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+a*f},${u}Q ${l},${u} ${l},${u+a*p}`}const o=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${l},${u+a*c}Q ${l},${u} ${l+a*o},${u}`}function fg({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,borderRadius:u=5,centerX:o,centerY:c,offset:f=20,stepPosition:p=.5}){const[d,_,v,w,C]=Nz({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:o,y:c},offset:f,stepPosition:p});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=Tz(d[S-1],d[S],d[S+1],u);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,_,v,w,C]}function eS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Rz(e){var d;const{sourceNode:t,targetNode:n}=e;if(!eS(t)||!eS(n))return null;const r=t.internals.handleBounds||tS(t.handles),a=n.internals.handleBounds||tS(n.handles),l=nS((r==null?void 0:r.source)??[],e.sourceHandle),u=nS(e.connectionMode===ma.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!u)return(d=e.onError)==null||d.call(e,"008",ei.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(l==null?void 0:l.position)||Me.Bottom,c=(u==null?void 0:u.position)||Me.Top,f=ls(t,l,o),p=ls(n,u,c);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:o,targetPosition:c}}function tS(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ls(e,t,n=Me.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:o}=t??gi(e);if(r)return{x:a+u/2,y:l+o/2};switch((t==null?void 0:t.position)??n){case Me.Top:return{x:a+u/2,y:l};case Me.Right:return{x:a+u,y:l+o/2};case Me.Bottom:return{x:a+u/2,y:l+o};case Me.Left:return{x:a,y:l+o/2}}}function nS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Dz(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=dg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const f2=1e3,Mz=10,Im={nodeOrigin:[0,0],nodeExtent:tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jz={...Im,checkEquality:!0};function zm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Lz(e,t,n){const r=zm(Im,n);for(const a of e.values())if(a.parentId)Fm(a,e,t,r);else{const l=gl(a,r.nodeOrigin),u=os(a.extent)?a.extent:r.nodeExtent,o=as(l,u,gi(a));a.internals.positionAbsolute=o}}function Oz(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Hm(e){return e==="manual"}function pg(e,t,n,r={}){var p,d;const a=zm(jz,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Hm(a.zIndexMode)?f2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const _ of e){let v=u.get(_.id);if(a.checkEquality&&_===(v==null?void 0:v.internals.userNode))t.set(_.id,v);else{const w=gl(_,a.nodeOrigin),C=os(_.extent)?_.extent:a.nodeExtent,b=as(w,C,gi(_));v={...a.defaults,..._,measured:{width:(p=_.measured)==null?void 0:p.width,height:(d=_.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:Oz(_,v),z:d2(_,o,a.zIndexMode),userNode:_}},t.set(_.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(c=!1),_.parentId&&Fm(v,t,n,r,l),f||(f=_.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function Bz(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Fm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=zm(Im,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Bz(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*Mz),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Hm(c)?f2:0,{x:_,y:v,z:w}=Iz(e,p,u,o,d,c),{positionAbsolute:C}=e.internals,b=_!==C.x||v!==C.y;(b||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:_,y:v}:C,z:w}})}function d2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Hm(n)?r:r+(e.selected?t:0)}function Iz(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=gi(e),f=gl(e,n),p=os(e.extent)?as(f,e.extent,c):f;let d=as({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=JC(d,c,t));const _=d2(e,a,l),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=_?v+1:_}}function Pm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??il(c),p=e2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var y;const p=c.internals.positionAbsolute,d=gi(c),_=c.origin??r,v=o.x<p.x?Math.round(Math.abs(p.x-o.x)):0,w=o.y<p.y?Math.round(Math.abs(p.y-o.y)):0,C=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),S=(C-d.width)*_[0],x=(b-d.height)*_[1];(v>0||w>0||S||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-v+S,y:c.position.y-w+x}}),(y=n.get(f))==null||y.forEach(E=>{e.some(R=>R.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+v,y:E.position.y+w}})})),(d.width<o.width||d.height<o.height||v||w)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:C+(v?_[0]*v-S:0),height:b+(w?_[1]*w-x:0)}})}),a}function zz(e,t,n,r,a,l,u){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],p=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(p.transform),_=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),c=!0;continue}const C=Bm(v.nodeElement),b=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(b||!w.internals.handleBounds||v.force))){const x=v.nodeElement.getBoundingClientRect(),y=os(w.extent)?w.extent:l;let{positionAbsolute:E}=w.internals;if(w.parentId&&w.extent==="parent"){const N=t.get(w.parentId);N&&(E=JC(E,C,N))}else y&&(E=as(E,y,C));const R={...w,measured:C,internals:{...w.internals,positionAbsolute:E,handleBounds:{source:Kb("source",v.nodeElement,x,d,w.id),target:Kb("target",v.nodeElement,x,d,w.id)}}};t.set(w.id,R),w.parentId&&Fm(R,t,n,{nodeOrigin:a,zIndexMode:u}),c=!0,b&&(f.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&_.push({id:w.id,parentId:w.parentId,rect:il(R,a)}))}}if(_.length>0){const v=Pm(_,t,n,a);f.push(...v)}return{changes:f,updatedInternals:c}}async function Hz({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function iS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function p2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;iS("source",c,p,e,a,u),iS("target",c,f,e,l,o),t.set(r.id,r)}}function g2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:g2(n,t):!1}function rS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Fz(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!g2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function vp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function Pz({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=_l(l,t);return{x:u.x-l.x,y:u.y-l.y}}function Uz({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,_=null,v=!1,w=!1,C=null;function b({noDragClassName:x,handleSelector:y,domNode:E,isSelectable:R,nodeId:N,nodeClickDistance:D=0}){_=An(E);function T({x:Y,y:H}){const{nodeLookup:z,nodeExtent:V,snapGrid:G,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:$}=t();l={x:Y,y:H};let U=!1;const Q=o.size>1,re=Q&&V?hg(ml(o)):null,ae=Q&&X?Pz({dragItems:o,snapGrid:G,x:Y,y:H}):null;for(const[Z,P]of o){if(!z.has(Z))continue;let ee={x:Y-P.distance.x,y:H-P.distance.y};X&&(ee=ae?{x:Math.round(ee.x+ae.x),y:Math.round(ee.y+ae.y)}:_l(ee,G));let ne=null;if(Q&&V&&!P.extent&&re){const{positionAbsolute:ye}=P.internals,be=ye.x-re.x+V[0][0],ke=ye.x+P.measured.width-re.x2+V[1][0],Ee=ye.y-re.y+V[0][1],Ce=ye.y+P.measured.height-re.y2+V[1][1];ne=[[be,Ee],[ke,Ce]]}const{position:ge,positionAbsolute:he}=QC({nodeId:Z,nextPosition:ee,nodeLookup:z,nodeExtent:ne||V,nodeOrigin:K,onError:O});U=U||P.position.x!==ge.x||P.position.y!==ge.y,P.position=ge,P.internals.positionAbsolute=he}if(w=w||U,!!U&&($(o,!0),C&&(r||L||!N&&M))){const[Z,P]=vp({nodeId:N,dragItems:o,nodeLookup:z});r==null||r(C,o,Z,P),L==null||L(C,Z,P),N||M==null||M(C,P)}}async function j(){if(!p)return;const{transform:Y,panBy:H,autoPanSpeed:z,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(u);return}const[G,X]=Lm(f,p,z);(G!==0||X!==0)&&(l.x=(l.x??0)-G/Y[2],l.y=(l.y??0)-X/Y[2],await H({x:G,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(Y){var Q;const{nodeLookup:H,multiSelectionActive:z,nodesDraggable:V,transform:G,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!L||!R)&&!z&&N&&((Q=H.get(N))!=null&&Q.selected||$()),R&&L&&N&&(e==null||e(N));const U=Ho(Y.sourceEvent,{transform:G,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=U,o=Fz(H,V,U,N),o.size>0&&(n||M||!N&&O)){const[re,ae]=vp({nodeId:N,dragItems:o,nodeLookup:H});n==null||n(Y.sourceEvent,o,re,ae),M==null||M(Y.sourceEvent,re,ae),N||O==null||O(Y.sourceEvent,ae)}}const F=DC().clickDistance(D).on("start",Y=>{const{domNode:H,nodeDragThreshold:z,transform:V,snapGrid:G,snapToGrid:X}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,v=!1,w=!1,C=Y.sourceEvent,z===0&&B(Y),l=Ho(Y.sourceEvent,{transform:V,snapGrid:G,snapToGrid:X,containerBounds:p}),f=Qn(Y.sourceEvent,p)}).on("drag",Y=>{const{autoPanOnNodeDrag:H,transform:z,snapGrid:V,snapToGrid:G,nodeDragThreshold:X,nodeLookup:K}=t(),L=Ho(Y.sourceEvent,{transform:z,snapGrid:V,snapToGrid:G,containerBounds:p});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||N&&!K.has(N))&&(v=!0),!v){if(!c&&H&&d&&(c=!0,j()),!d){const M=Qn(Y.sourceEvent,p),O=M.x-f.x,$=M.y-f.y;Math.sqrt(O*O+$*$)>X&&B(Y)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(Y.sourceEvent,p),T(L))}}).on("end",Y=>{if(!d||v){v&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:H,updateNodePositions:z,onNodeDragStop:V,onSelectionDragStop:G}=t();if(w&&(z(o,!1),w=!1),a||V||!N&&G){const[X,K]=vp({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});a==null||a(Y.sourceEvent,o,X,K),V==null||V(Y.sourceEvent,X,K),N||G==null||G(Y.sourceEvent,K)}}}).filter(Y=>{const H=Y.target;return!Y.button&&(!x||!rS(H,`.${x}`,E))&&(!y||rS(H,y,E))});_.call(F)}function S(){_==null||_.on(".drag",null)}return{update:b,destroy:S}}function $z(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())zu(a,il(l))>0&&r.push(l);return r}const Gz=250;function qz(e,t,n,r){var o,c;let a=[],l=1/0;const u=$z(e,n,t+Gz);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:_,y:v}=ls(f,d,d.position,!0),w=Math.sqrt(Math.pow(_-e.x,2)+Math.pow(v-e.y,2));w>t||(w<l?(a=[{...d,x:_,y:v}],l=w):w===l&&a.push({...d,x:_,y:v}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function m2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(_=>_.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ls(u,c,c.position,!0)}:c}function _2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Vz(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const v2=()=>!0;function Yz(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:_,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:b,isValidConnection:S=v2,onReconnectEnd:x,updateConnection:y,getTransform:E,getFromHandle:R,autoPanSpeed:N,dragThreshold:D=1,handleDomNode:T}){const j=s2(e.target);let B=0,F;const{x:Y,y:H}=Qn(e),z=_2(l,T),V=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!V||!z)return;const X=m2(a,z,r,c,t);if(!X)return;let K=Qn(e,V),L=!1,M=null,O=!1,$=null;function U(){if(!p||!V)return;const[ge,he]=Lm(K,V,N);_({x:ge,y:he}),B=requestAnimationFrame(U)}const Q={...X,nodeId:a,type:z,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ls(re,Q,Me.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:Vb[Q.position],toNode:null,pointer:K};function P(){G=!0,y(Z),w==null||w(e,{nodeId:a,handleId:r,handleType:z})}D===0&&P();function ee(ge){if(!G){const{x:Ce,y:rt}=Qn(ge),bt=Ce-Y,Ge=rt-H;if(!(bt*bt+Ge*Ge>D*D))return;P()}if(!R()||!Q){ne(ge);return}const he=E();K=Qn(ge,V),F=qz(vl(K,he,!1,[1,1]),n,c,Q),L||(U(),L=!0);const ye=y2(ge,{handle:F,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:S,doc:j,lib:f,flowId:d,nodeLookup:c});$=ye.handleDomNode,M=ye.connection,O=Vz(!!F,ye.isValid);const be=c.get(a),ke=be?ls(be,Q,Me.Left,!0):Z.from,Ee={...Z,from:ke,isValid:O,to:ye.toHandle&&O?va({x:ye.toHandle.x,y:ye.toHandle.y},he):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:Vb[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};y(Ee),Z=Ee}function ne(ge){if(!("touches"in ge&&ge.touches.length>0)){if(G){(F||$)&&M&&O&&(C==null||C(M));const{inProgress:he,...ye}=Z,be={...ye,toPosition:Z.toHandle?Z.toPosition:null};b==null||b(ge,be),l&&(x==null||x(ge,be))}v(),cancelAnimationFrame(B),L=!1,O=!1,M=null,$=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function y2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=v2,nodeLookup:p}){const d=l==="target",_=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:w}=Qn(e),C=u.elementFromPoint(v,w),b=C!=null&&C.classList.contains(`${o}-flow__handle`)?C:_,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const x=_2(void 0,b),y=b.getAttribute("data-nodeid"),E=b.getAttribute("data-handleid"),R=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!x)return S;const D={source:d?y:r,sourceHandle:d?E:a,target:d?r:y,targetHandle:d?a:E};S.connection=D;const j=R&&N&&(n===ma.Strict?d&&x==="source"||!d&&x==="target":y!==r||E!==a);S.isValid=j&&f(D),S.toHandle=m2(y,x,E,p,n,!0)}return S}const gg={onPointerDown:Yz,isValid:y2};function Wz({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:_=!0,inversePan:v=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=y.sourceEvent.ctrlKey&&rl()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,D=E[2]*Math.pow(2,N*R);t.scaleTo(D)};let C=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(C=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},S=y=>{const E=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const R=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[R[0]-C[0],R[1]-C[1]];C=R;const D=r()*Math.max(E[2],Math.log(E[2]))*(v?-1:1),T={x:E[0]-N[0]*D,y:E[1]-N[1]*D},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=VC().on("start",b).on("zoom",d?S:null).on("zoom.wheel",_?w:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const wh=e=>({x:e.x,y:e.y,zoom:e.k}),yp=({x:e,y:t,zoom:n})=>bh.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),b2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Xz=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bp=(e,t=0,n=Xz,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},S2=e=>{const t=e.ctrlKey&&rl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Kz({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(la(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const b=Xn(p),S=S2(p),x=d*Math.pow(2,S);r.scaleTo(n,x,b,p);return}const _=p.deltaMode===1?20:1;let v=a===ts.Vertical?0:p.deltaX*_,w=a===ts.Horizontal?0:p.deltaY*_;!rl()&&p.shiftKey&&a!==ts.Vertical&&(v=p.deltaY*_,w=0),r.translateBy(n,-(v/d)*l,-(w/d)*l,{internal:!0});const C=wh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c==null||c(p,C):(e.isPanScrolling=!0,o==null||o(p,C)),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,C),e.isPanScrolling=!1},150)}}function Zz({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=la(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function Qz({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=wh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function Jz({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&b2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,wh(l.transform)))}}function eH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&b2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=wh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function tH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var b;const _=e||t,v=n&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(la(d,`${f}-flow__node`)||la(d,`${f}-flow__edge`)))return!0;if(!r&&!_&&!a&&!l&&!n||u||p&&!w||la(d,o)&&w||la(d,c)&&(!w||a&&w&&!e)||!n&&d.ctrlKey&&w)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!_&&!a&&!v&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const C=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w)&&C}}function nH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect();let d=[[0,0],[p.width,p.height]];const _=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const z=H[0];z&&(d=[[0,0],[z.contentRect.width,z.contentRect.height]])}):null;_==null||_.observe(e);const v=VC().extent(()=>d).scaleExtent([t,n]).translateExtent(r),w=An(e).call(v);E({x:a.x,y:a.y,zoom:_a(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const C=w.on("wheel.zoom"),b=w.on("dblclick.zoom");v.wheelDelta(S2);async function S(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).transform(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}function x({noWheelClassName:H,noPanClassName:z,onPaneContextMenu:V,userSelectionActive:G,panOnScroll:X,panOnDrag:K,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:O,zoomOnPinch:$,zoomOnScroll:U,zoomOnDoubleClick:Q,zoomActivationKeyPressed:re,lib:ae,onTransformChange:Z,connectionInProgress:P,paneClickDistance:ee,selectionOnDrag:ne}){G&&!f.isZoomingOrPanning&&y();const ge=X&&!re&&!G;v.clickDistance(ne?1/0:!Zn(ee)||ee<0?0:ee);const he=ge?Kz({zoomPanValues:f,noWheelClassName:H,d3Selection:w,d3Zoom:v,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:$,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):Zz({noWheelClassName:H,preventScrolling:O,d3ZoomHandler:C});w.on("wheel.zoom",he,{passive:!1});const ye=Qz({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});v.on("start",ye);const be=Jz({zoomPanValues:f,panOnDrag:K,onPaneContextMenu:!!V,onPanZoom:l,onTransformChange:Z});v.on("zoom",be);const ke=eH({zoomPanValues:f,panOnDrag:K,panOnScroll:X,onPaneContextMenu:V,onPanZoomEnd:o,onDraggingChange:c});v.on("end",ke);const Ee=tH({zoomActivationKeyPressed:re,panOnDrag:K,zoomOnScroll:U,panOnScroll:X,zoomOnDoubleClick:Q,zoomOnPinch:$,userSelectionActive:G,noPanClassName:z,noWheelClassName:H,lib:ae,connectionInProgress:P});v.filter(Ee),Q?w.on("dblclick.zoom",b):w.on("dblclick.zoom",null)}function y(){v.on("zoom",null)}async function E(H,z,V){const G=yp(H),X=v==null?void 0:v.constrain()(G,z,V);return X&&await S(X),X}async function R(H,z){const V=yp(H);return await S(V,z),V}function N(H){if(w){const z=yp(H),V=w.property("__zoom");(V.k!==H.zoom||V.x!==H.x||V.y!==H.y)&&(v==null||v.transform(w,z,null,{sync:!0}))}}function D(){const H=w?qC(w.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function T(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).scaleTo(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}async function j(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).scaleBy(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}function B(H){v==null||v.scaleExtent(H)}function F(H){v==null||v.translateExtent(H)}function Y(H){const z=!Zn(H)||H<0?0:H;v==null||v.clickDistance(z)}return{update:x,destroy:y,setViewport:R,setViewportConstrained:E,getViewport:D,scaleTo:T,scaleBy:j,setScaleExtent:B,setTranslateExtent:F,syncViewport:N,setClickDistance:Y}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function iH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function sS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Cr(e,t){return Math.max(0,e-t)}function iu(e,t,n){return Math.max(0,t-e,e-n)}function aS(e,t){return e?!t:t}function rH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,_=p&&d,{xSnapped:v,ySnapped:w}=n,{minWidth:C,maxWidth:b,minHeight:S,maxHeight:x}=r,{x:y,y:E,width:R,height:N,aspectRatio:D}=e;let T=Math.floor(p?v-e.pointerX:0),j=Math.floor(d?w-e.pointerY:0);const B=R+(c?-T:T),F=N+(f?-j:j),Y=-l[0]*R,H=-l[1]*N;let z=iu(B,C,b),V=iu(F,S,x);if(u){let K=0,L=0;c&&T<0?K=wr(y+T+Y,u[0][0]):!c&&T>0&&(K=Cr(y+B+Y,u[1][0])),f&&j<0?L=wr(E+j+H,u[0][1]):!f&&j>0&&(L=Cr(E+F+H,u[1][1])),z=Math.max(z,K),V=Math.max(V,L)}if(o){let K=0,L=0;c&&T>0?K=Cr(y+T,o[0][0]):!c&&T<0&&(K=wr(y+B,o[1][0])),f&&j>0?L=Cr(E+j,o[0][1]):!f&&j<0&&(L=wr(E+F,o[1][1])),z=Math.max(z,K),V=Math.max(V,L)}if(a){if(p){const K=iu(B/D,S,x)*D;if(z=Math.max(z,K),u){let L=0;!c&&!f||c&&!f&&_?L=Cr(E+H+B/D,u[1][1])*D:L=wr(E+H+(c?T:-T)/D,u[0][1])*D,z=Math.max(z,L)}if(o){let L=0;!c&&!f||c&&!f&&_?L=wr(E+B/D,o[1][1])*D:L=Cr(E+(c?T:-T)/D,o[0][1])*D,z=Math.max(z,L)}}if(d){const K=iu(F*D,C,b)/D;if(V=Math.max(V,K),u){let L=0;!c&&!f||f&&!c&&_?L=Cr(y+F*D+Y,u[1][0])/D:L=wr(y+(f?j:-j)*D+Y,u[0][0])/D,V=Math.max(V,L)}if(o){let L=0;!c&&!f||f&&!c&&_?L=wr(y+F*D,o[1][0])/D:L=Cr(y+(f?j:-j)*D,o[0][0])/D,V=Math.max(V,L)}}}j=j+(j<0?V:-V),T=T+(T<0?z:-z),a&&(_?B>F*D?j=(aS(c,f)?-T:T)/D:T=(aS(c,f)?-j:j)*D:p?(j=T/D,f=c):(T=j*D,c=f));const G=c?y+T:y,X=f?E+j:E;return{width:R+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+G,y:l[1]*j*(f?-1:1)+X}}const x2={width:0,height:0,x:0,y:0},sH={...x2,pointerX:0,pointerY:0,aspectRatio:1};function aH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function oH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:sS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:_,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:b}){let S={...x2},x={...sH};u={boundaries:p,resizeDirection:_,keepAspectRatio:d,controlDirection:sS(f)};let y,E=null,R=[],N,D,T,j=!1;const B=DC().on("start",F=>{const{nodeLookup:Y,transform:H,snapGrid:z,snapToGrid:V,nodeOrigin:G,paneDomNode:X}=n();if(y=Y.get(t),!y)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Ho(F.sourceEvent,{transform:H,snapGrid:z,snapToGrid:V,containerBounds:E});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...S,pointerX:K,pointerY:L,aspectRatio:S.width/S.height},N=void 0,D=os(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=Y.get(y.parentId)),N&&y.extent==="parent"&&(D=[[0,0],[N.measured.width,N.measured.height]]),R=[],T=void 0;for(const[M,O]of Y)if(O.parentId===t&&(R.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=aH(O,y,O.origin??G);T?T=[[Math.min($[0][0],T[0][0]),Math.min($[0][1],T[0][1])],[Math.max($[1][0],T[1][0]),Math.max($[1][1],T[1][1])]]:T=$}v==null||v(F,{...S})}).on("drag",F=>{const{transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V}=n(),G=Ho(F.sourceEvent,{transform:Y,snapGrid:H,snapToGrid:z,containerBounds:E}),X=[];if(!y)return;const{x:K,y:L,width:M,height:O}=S,$={},U=y.origin??V,{width:Q,height:re,x:ae,y:Z}=rH(x,u.controlDirection,G,u.boundaries,u.keepAspectRatio,U,D,T),P=Q!==M,ee=re!==O,ne=ae!==K&&P,ge=Z!==L&ⅇif(!ne&&!ge&&!P&&!ee)return;if((ne||ge||U[0]===1||U[1]===1)&&($.x=ne?ae:S.x,$.y=ge?Z:S.y,S.x=$.x,S.y=$.y,R.length>0)){const ke=ae-K,Ee=Z-L;for(const Ce of R)Ce.position={x:Ce.position.x-ke+U[0]*(Q-M),y:Ce.position.y-Ee+U[1]*(re-O)},X.push(Ce)}if((P||ee)&&($.width=P&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:S.width,$.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:S.height,S.width=$.width,S.height=$.height),N&&y.expandParent){const ke=U[0]*($.width??0);$.x&&$.x<ke&&(S.x=ke,x.x=x.x-($.x-ke));const Ee=U[1]*($.height??0);$.y&&$.y<Ee&&(S.y=Ee,x.y=x.y-($.y-Ee))}const he=iH({width:S.width,prevWidth:M,height:S.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ye={...S,direction:he};(b==null?void 0:b(F,ye))!==!1&&(j=!0,w==null||w(F,ye),r($,X))}).on("end",F=>{j&&(C==null||C(F,{...S}),a==null||a({...S}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Sp={exports:{}},xp={},wp={exports:{}},Cp={};/** +Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await MN(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return m.jsxs("div",{className:"home",children:[m.jsxs("div",{className:"home-inner",children:[m.jsxs("div",{className:"home-brand",children:["Open",m.jsx("span",{children:"Research"})]}),m.jsxs("div",{className:"home-head",children:[m.jsx("h2",{children:"Projects"}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[m.jsx(bg,{size:13})," New project"]})]}),m.jsx("div",{className:"home-list",children:e.length===0?m.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>m.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[m.jsx("span",{className:"name",children:f.name}),m.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&m.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),m.jsxs("span",{className:"time",children:["created ",Sa(f.createdAt)]}),m.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:m.jsx(Gu,{size:14})})]},f.id))})]}),a&&m.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:m.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[m.jsx("h2",{children:"New project"}),m.jsx(kB,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function AB(e){const t=tx(e.backend);return t?[t,nx(e.backend)].filter(Boolean).join(" · "):"—"}function NB({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?m.jsx("div",{className:"empty-state",children:m.jsx("p",{children:"No runs yet."})}):m.jsx("div",{className:"runs-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Run"}),m.jsx("th",{children:"Experiment"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Commit"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Exit"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return m.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[m.jsx("td",{className:"mono",children:Tp(o.id)}),m.jsx("td",{className:"mono",children:l.get(o.experimentId)??Tp(o.experimentId)}),m.jsx("td",{children:m.jsx(Vo,{status:o.status})}),m.jsx("td",{className:"mono",children:AB(o)}),m.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),m.jsx("td",{children:Sa(o.createdAt)}),m.jsx("td",{className:"mono",children:o.exitCode??"—"}),m.jsx("td",{children:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:m.jsx($u,{size:14})}),c&&m.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ft(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var TB={value:()=>{}};function mh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new pu(n)}function pu(e){this._=e}function RB(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}pu.prototype=mh.prototype={constructor:pu,on:function(e,t){var n=this._,r=RB(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=DB(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Tb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Tb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pu(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function DB(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Tb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=TB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ig="http://www.w3.org/1999/xhtml";const Rb={svg:"http://www.w3.org/2000/svg",xhtml:ig,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _h(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rb.hasOwnProperty(t)?{space:Rb[t],local:e}:e}function MB(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ig&&t.documentElement.namespaceURI===ig?t.createElement(e):t.createElementNS(n,e)}}function jB(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pC(e){var t=_h(e);return(t.local?jB:MB)(t)}function LB(){}function Em(e){return e==null?LB:function(){return this.querySelector(e)}}function OB(e){typeof e!="function"&&(e=Em(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=new Array(u),c,f,p=0;p<u;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),o[p]=f);return new jn(r,this._parents)}function BB(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function IB(){return[]}function gC(e){return e==null?IB:function(){return this.querySelectorAll(e)}}function zB(e){return function(){return BB(e.apply(this,arguments))}}function HB(e){typeof e=="function"?e=zB(e):e=gC(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&(r.push(e.call(c,c.__data__,f,u)),a.push(c));return new jn(r,a)}function mC(e){return function(){return this.matches(e)}}function _C(e){return function(t){return t.matches(e)}}var FB=Array.prototype.find;function PB(e){return function(){return FB.call(this.children,e)}}function UB(){return this.firstElementChild}function $B(e){return this.select(e==null?UB:PB(typeof e=="function"?e:_C(e)))}var GB=Array.prototype.filter;function qB(){return Array.from(this.children)}function VB(e){return function(){return GB.call(this.children,e)}}function YB(e){return this.selectAll(e==null?qB:VB(typeof e=="function"?e:_C(e)))}function WB(e){typeof e!="function"&&(e=mC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new jn(r,this._parents)}function vC(e){return new Array(e.length)}function XB(){return new jn(this._enter||this._groups.map(vC),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function KB(e){return function(){return e}}function ZB(e,t,n,r,a,l){for(var u=0,o,c=t.length,f=l.length;u<f;++u)(o=t[u])?(o.__data__=l[u],r[u]=o):n[u]=new Tu(e,l[u]);for(;u<c;++u)(o=t[u])&&(a[u]=o)}function QB(e,t,n,r,a,l,u){var o,c,f=new Map,p=t.length,d=l.length,_=new Array(p),v;for(o=0;o<p;++o)(c=t[o])&&(_[o]=v=u.call(c,c.__data__,o,t)+"",f.has(v)?a[o]=c:f.set(v,c));for(o=0;o<d;++o)v=u.call(e,l[o],o,l)+"",(c=f.get(v))?(r[o]=c,c.__data__=l[o],f.delete(v)):n[o]=new Tu(e,l[o]);for(o=0;o<p;++o)(c=t[o])&&f.get(_[o])===c&&(a[o]=c)}function JB(e){return e.__data__}function eI(e,t){if(!arguments.length)return Array.from(this,JB);var n=t?QB:ZB,r=this._parents,a=this._groups;typeof e!="function"&&(e=KB(e));for(var l=a.length,u=new Array(l),o=new Array(l),c=new Array(l),f=0;f<l;++f){var p=r[f],d=a[f],_=d.length,v=tI(e.call(p,p&&p.__data__,f,r)),w=v.length,C=o[f]=new Array(w),b=u[f]=new Array(w),S=c[f]=new Array(_);n(p,d,C,b,S,v,t);for(var x=0,y=0,E,R;x<w;++x)if(E=C[x]){for(x>=y&&(y=x+1);!(R=b[y])&&++y<w;);E._next=R||null}}return u=new jn(u,r),u._enter=o,u._exit=c,u}function tI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nI(){return new jn(this._exit||this._groups.map(vC),this._parents)}function iI(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function rI(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),o=new Array(a),c=0;c<u;++c)for(var f=n[c],p=r[c],d=f.length,_=o[c]=new Array(d),v,w=0;w<d;++w)(v=f[w]||p[w])&&(_[w]=v);for(;c<a;++c)o[c]=n[c];return new jn(o,this._parents)}function sI(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function aI(e){e||(e=oI);function t(d,_){return d&&_?e(d.__data__,_.__data__):!d-!_}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],o=u.length,c=a[l]=new Array(o),f,p=0;p<o;++p)(f=u[p])&&(c[p]=f);c.sort(t)}return new jn(a,this._parents).order()}function oI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cI(){return Array.from(this)}function uI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function hI(){let e=0;for(const t of this)++e;return e}function fI(){return!this.node()}function dI(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,o;l<u;++l)(o=a[l])&&e.call(o,o.__data__,l,a);return this}function pI(e){return function(){this.removeAttribute(e)}}function gI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mI(e,t){return function(){this.setAttribute(e,t)}}function _I(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function vI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bI(e,t){var n=_h(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?gI:pI:typeof t=="function"?n.local?yI:vI:n.local?_I:mI)(n,t))}function yC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function SI(e){return function(){this.style.removeProperty(e)}}function xI(e,t,n){return function(){this.style.setProperty(e,t,n)}}function wI(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function CI(e,t,n){return arguments.length>1?this.each((t==null?SI:typeof t=="function"?wI:xI)(e,t,n??"")):pa(this.node(),e)}function pa(e,t){return e.style.getPropertyValue(t)||yC(e).getComputedStyle(e,null).getPropertyValue(t)}function EI(e){return function(){delete this[e]}}function kI(e,t){return function(){this[e]=t}}function AI(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NI(e,t){return arguments.length>1?this.each((t==null?EI:typeof t=="function"?AI:kI)(e,t)):this.node()[e]}function bC(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new SC(e)}function SC(e){this._node=e,this._names=bC(e.getAttribute("class")||"")}SC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function wC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function TI(e){return function(){xC(this,e)}}function RI(e){return function(){wC(this,e)}}function DI(e,t){return function(){(t.apply(this,arguments)?xC:wC)(this,e)}}function MI(e,t){var n=bC(e+"");if(arguments.length<2){for(var r=km(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?DI:t?TI:RI)(n,t))}function jI(){this.textContent=""}function LI(e){return function(){this.textContent=e}}function OI(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BI(e){return arguments.length?this.each(e==null?jI:(typeof e=="function"?OI:LI)(e)):this.node().textContent}function II(){this.innerHTML=""}function zI(e){return function(){this.innerHTML=e}}function HI(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FI(e){return arguments.length?this.each(e==null?II:(typeof e=="function"?HI:zI)(e)):this.node().innerHTML}function PI(){this.nextSibling&&this.parentNode.appendChild(this)}function UI(){return this.each(PI)}function $I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GI(){return this.each($I)}function qI(e){var t=typeof e=="function"?e:pC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VI(){return null}function YI(e,t){var n=typeof e=="function"?e:pC(e),r=t==null?VI:typeof t=="function"?t:Em(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function WI(){var e=this.parentNode;e&&e.removeChild(this)}function XI(){return this.each(WI)}function KI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QI(e){return this.select(e?ZI:KI)}function JI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function e7(e){return function(t){e.call(this,t,this.__data__)}}function t7(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function n7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function i7(e,t,n){return function(){var r=this.__on,a,l=e7(t);if(r){for(var u=0,o=r.length;u<o;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function r7(e,t,n){var r=t7(e+""),a,l=r.length,u;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,f=o.length,p;c<f;++c)for(a=0,p=o[c];a<l;++a)if((u=r[a]).type===p.type&&u.name===p.name)return p.value}return}for(o=t?i7:n7,a=0;a<l;++a)this.each(o(r[a],t,n));return this}function CC(e,t,n){var r=yC(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function s7(e,t){return function(){return CC(this,e,t)}}function a7(e,t){return function(){return CC(this,e,t.apply(this,arguments))}}function o7(e,t){return this.each((typeof t=="function"?a7:s7)(e,t))}function*l7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var EC=[null];function jn(e,t){this._groups=e,this._parents=t}function dl(){return new jn([[document.documentElement]],EC)}function c7(){return this}jn.prototype=dl.prototype={constructor:jn,select:OB,selectAll:HB,selectChild:$B,selectChildren:YB,filter:WB,data:eI,enter:XB,exit:nI,join:iI,merge:rI,selection:c7,order:sI,sort:aI,call:lI,nodes:cI,node:uI,size:hI,empty:fI,each:dI,attr:bI,style:CI,property:NI,classed:MI,text:BI,html:FI,raise:UI,lower:GI,append:qI,insert:YI,remove:XI,clone:QI,datum:JI,on:r7,dispatch:o7,[Symbol.iterator]:l7};function An(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],EC)}function u7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xn(e,t){if(e=u7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const h7={passive:!1},Zo={capture:!0,passive:!1};function pp(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function kC(e){var t=e.document.documentElement,n=An(e).on("dragstart.drag",ua,Zo);"onselectstart"in t?n.on("selectstart.drag",ua,Zo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function AC(e,t){var n=e.document.documentElement,r=An(e).on("dragstart.drag",null);t&&(r.on("click.drag",ua,Zo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zc=e=>()=>e;function rg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}rg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f7(e){return!e.ctrlKey&&!e.button}function d7(){return this.parentNode}function p7(e,t){return t??{x:e.x,y:e.y}}function g7(){return navigator.maxTouchPoints||"ontouchstart"in this}function NC(){var e=f7,t=d7,n=p7,r=g7,a={},l=mh("start","drag","end"),u=0,o,c,f,p,d=0;function _(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",b).on("touchmove.drag",S,h7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,R){if(!(p||!e.call(this,E,R))){var N=y(this,t.call(this,E,R),E,R,"mouse");N&&(An(E.view).on("mousemove.drag",w,Zo).on("mouseup.drag",C,Zo),kC(E.view),pp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function w(E){if(ua(E),!f){var R=E.clientX-o,N=E.clientY-c;f=R*R+N*N>d}a.mouse("drag",E)}function C(E){An(E.view).on("mousemove.drag mouseup.drag",null),AC(E.view,f),ua(E),a.mouse("end",E)}function b(E,R){if(e.call(this,E,R)){var N=E.changedTouches,D=t.call(this,E,R),T=N.length,j,B;for(j=0;j<T;++j)(B=y(this,D,E,R,N[j].identifier,N[j]))&&(pp(E),B("start",E,N[j]))}}function S(E){var R=E.changedTouches,N=R.length,D,T;for(D=0;D<N;++D)(T=a[R[D].identifier])&&(ua(E),T("drag",E,R[D]))}function x(E){var R=E.changedTouches,N=R.length,D,T;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),D=0;D<N;++D)(T=a[R[D].identifier])&&(pp(E),T("end",E,R[D]))}function y(E,R,N,D,T,j){var B=l.copy(),z=Xn(j||N,R),G,U,H;if((H=n.call(E,new rg("beforestart",{sourceEvent:N,target:_,identifier:T,active:u,x:z[0],y:z[1],dx:0,dy:0,dispatch:B}),D))!=null)return G=H.x-z[0]||0,U=H.y-z[1]||0,function Y(q,X,K){var L=z,M;switch(q){case"start":a[T]=Y,M=u++;break;case"end":delete a[T],--u;case"drag":z=Xn(K||X,R),M=u;break}B.call(q,E,new rg(q,{sourceEvent:X,subject:H,target:_,identifier:T,active:M,x:z[0]+G,y:z[1]+U,dx:z[0]-L[0],dy:z[1]-L[1],dispatch:B}),D)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Zc(!!E),_):e},_.container=function(E){return arguments.length?(t=typeof E=="function"?E:Zc(E),_):t},_.subject=function(E){return arguments.length?(n=typeof E=="function"?E:Zc(E),_):n},_.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Zc(!!E),_):r},_.on=function(){var E=l.on.apply(l,arguments);return E===l?_:E},_.clickDistance=function(E){return arguments.length?(d=(E=+E)*E,_):Math.sqrt(d)},_}function Am(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function TC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pl(){}var Qo=.7,Ru=1/Qo,ha="\\s*([+-]?\\d+)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",m7=/^#([0-9a-f]{3,8})$/,_7=new RegExp(`^rgb\\(${ha},${ha},${ha}\\)$`),v7=new RegExp(`^rgb\\(${ui},${ui},${ui}\\)$`),y7=new RegExp(`^rgba\\(${ha},${ha},${ha},${Jo}\\)$`),b7=new RegExp(`^rgba\\(${ui},${ui},${ui},${Jo}\\)$`),S7=new RegExp(`^hsl\\(${Jo},${ui},${ui}\\)$`),x7=new RegExp(`^hsla\\(${Jo},${ui},${ui},${Jo}\\)$`),Db={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Am(pl,rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mb,formatHex:Mb,formatHex8:w7,formatHsl:C7,formatRgb:jb,toString:jb});function Mb(){return this.rgb().formatHex()}function w7(){return this.rgb().formatHex8()}function C7(){return RC(this).formatHsl()}function jb(){return this.rgb().formatRgb()}function rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=m7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Lb(t):n===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_7.exec(e))?new mn(t[1],t[2],t[3],1):(t=v7.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=y7.exec(e))?Qc(t[1],t[2],t[3],t[4]):(t=b7.exec(e))?Qc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=S7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,1):(t=x7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,t[4]):Db.hasOwnProperty(e)?Lb(Db[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Lb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Qc(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function E7(e){return e instanceof pl||(e=rs(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function sg(e,t,n,r){return arguments.length===1?E7(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Am(mn,sg,TC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(es(this.r),es(this.g),es(this.b),Du(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ob,formatHex:Ob,formatHex8:k7,formatRgb:Bb,toString:Bb}));function Ob(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function k7(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bb(){const e=Du(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Du(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function Ib(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function RC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof pl||(e=rs(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n<r)*6:n===l?u=(r-t)/o+2:u=(t-n)/o+4,o/=c<.5?l+a:2-l-a,u*=60):o=c>0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function A7(e,t,n,r){return arguments.length===1?RC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Am(Kn,A7,TC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(gp(e>=240?e-240:e+120,a,r),gp(e,a,r),gp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(zb(this.h),Jc(this.s),Jc(this.l),Du(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Du(this.opacity);return`${e===1?"hsl(":"hsla("}${zb(this.h)}, ${Jc(this.s)*100}%, ${Jc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zb(e){return e=(e||0)%360,e<0?e+360:e}function Jc(e){return Math.max(0,Math.min(1,e||0))}function gp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Nm=e=>()=>e;function N7(e,t){return function(n){return e+n*t}}function T7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function R7(e){return(e=+e)==1?DC:function(t,n){return n-t?T7(t,n,e):Nm(isNaN(t)?n:t)}}function DC(e,t){var n=t-e;return n?N7(e,n):Nm(isNaN(e)?t:e)}const Mu=(function e(t){var n=R7(t);function r(a,l){var u=n((a=sg(a)).r,(l=sg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=DC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function D7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function M7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=zo(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(o){for(u=0;u<r;++u)l[u]=a[u](o);return l}}function L7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ci(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function O7(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=zo(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var ag=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mp=new RegExp(ag.source,"g");function B7(e){return function(){return e}}function I7(e){return function(t){return e(t)+""}}function MC(e,t){var n=ag.lastIndex=mp.lastIndex=0,r,a,l,u=-1,o=[],c=[];for(e=e+"",t=t+"";(r=ag.exec(e))&&(a=mp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ci(r,a)})),n=mp.lastIndex;return n<t.length&&(l=t.slice(n),o[u]?o[u]+=l:o[++u]=l),o.length<2?c[0]?I7(c[0].x):B7(t):(t=c.length,function(f){for(var p=0,d;p<t;++p)o[(d=c[p]).i]=d.x(f);return o.join("")})}function zo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Nm(t):(n==="number"?ci:n==="string"?(r=rs(t))?(t=r,Mu):MC:t instanceof rs?Mu:t instanceof Date?L7:M7(t)?D7:Array.isArray(t)?j7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?O7:ci)(e,t)}var Hb=180/Math.PI,og={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jC(e,t,n,r,a,l){var u,o,c;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Hb,skewX:Math.atan(c)*Hb,scaleX:u,scaleY:o}}var eu;function z7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?og:jC(t.a,t.b,t.c,t.d,t.e,t.f)}function H7(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?og:(e=e.matrix,jC(e.a,e.b,e.c,e.d,e.e,e.f))}function LC(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function l(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push("translate(",null,t,null,n);w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d||_)&&v.push("translate("+d+t+_+n)}function u(f,p,d,_){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),_.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ci(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,_){f!==p?_.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ci(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push(a(v)+"scale(",null,",",null,")");w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d!==1||_!==1)&&v.push(a(v)+"scale("+d+","+_+")")}return function(f,p){var d=[],_=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,_),u(f.rotate,p.rotate,d,_),o(f.skewX,p.skewX,d,_),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,_),f=p=null,function(v){for(var w=-1,C=_.length,b;++w<C;)d[(b=_[w]).i]=b.x(v);return d.join("")}}}var F7=LC(z7,"px, ","px)","deg)"),P7=LC(H7,", ",")",")"),U7=1e-12;function Fb(e){return((e=Math.exp(e))+1/e)/2}function $7(e){return((e=Math.exp(e))-1/e)/2}function G7(e){return((e=Math.exp(2*e))-1)/(e+1)}const gu=(function e(t,n,r){function a(l,u){var o=l[0],c=l[1],f=l[2],p=u[0],d=u[1],_=u[2],v=p-o,w=d-c,C=v*v+w*w,b,S;if(C<U7)S=Math.log(_/f)/t,b=function(D){return[o+D*v,c+D*w,f*Math.exp(t*D*S)]};else{var x=Math.sqrt(C),y=(_*_-f*f+r*C)/(2*f*n*x),E=(_*_-f*f-r*C)/(2*_*n*x),R=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(E*E+1)-E);S=(N-R)/t,b=function(D){var T=D*S,j=Fb(R),B=f/(n*x)*(j*G7(t*T+R)-$7(R));return[o+B*v,c+B*w,f*j/Fb(t*T+R)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return a.rho=function(l){var u=Math.max(.001,+l),o=u*u,c=o*o;return e(u,o,c)},a})(Math.SQRT2,2,4);var ga=0,Do=0,To=0,OC=1e3,ju,Mo,Lu=0,ss=0,vh=0,el=typeof performance=="object"&&performance.now?performance:Date,BC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return ss||(BC(q7),ss=el.now()+vh)}function q7(){ss=0}function Ou(){this._call=this._time=this._next=null}Ou.prototype=IC.prototype={constructor:Ou,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Tm():+n)+(t==null?0:+t),!this._next&&Mo!==this&&(Mo?Mo._next=this:ju=this,Mo=this),this._call=e,this._time=n,lg()},stop:function(){this._call&&(this._call=null,this._time=1/0,lg())}};function IC(e,t,n){var r=new Ou;return r.restart(e,t,n),r}function V7(){Tm(),++ga;for(var e=ju,t;e;)(t=ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ga}function Pb(){ss=(Lu=el.now())+vh,ga=Do=0;try{V7()}finally{ga=0,W7(),ss=0}}function Y7(){var e=el.now(),t=e-Lu;t>OC&&(vh-=t,Lu=e)}function W7(){for(var e,t=ju,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ju=n);Mo=e,lg(r)}function lg(e){if(!ga){Do&&(Do=clearTimeout(Do));var t=e-ss;t>24?(e<1/0&&(Do=setTimeout(Pb,e-el.now()-vh)),To&&(To=clearInterval(To))):(To||(Lu=el.now(),To=setInterval(Y7,OC)),ga=1,BC(Pb))}}function Ub(e,t,n){var r=new Ou;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var X7=mh("start","end","cancel","interrupt"),K7=[],zC=0,$b=1,cg=2,mu=3,Gb=4,ug=5,_u=6;function yh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;Z7(e,n,{name:t,index:r,group:a,on:X7,tween:K7,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:zC})}function Rm(e,t){var n=ti(e,t);if(n.state>zC)throw new Error("too late; already scheduled");return n}function pi(e,t){var n=ti(e,t);if(n.state>mu)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Z7(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=IC(l,0,n.time);function l(f){n.state=$b,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,_,v;if(n.state!==$b)return c();for(p in r)if(v=r[p],v.name===n.name){if(v.state===mu)return Ub(u);v.state===Gb?(v.state=_u,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[p]):+p<t&&(v.state=_u,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[p])}if(Ub(function(){n.state===mu&&(n.state=Gb,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=cg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===cg){for(n.state=mu,a=new Array(_=n.tween.length),p=0,d=-1;p<_;++p)(v=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=v);a.length=d+1}}function o(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=ug,1),d=-1,_=a.length;++d<_;)a[d].call(e,p);n.state===ug&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=_u,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function vu(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>cg&&r.state<ug,r.state=_u,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function Q7(e){return this.each(function(){vu(this,e)})}function J7(e,t){var n,r;return function(){var a=pi(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,o=r.length;u<o;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function e9(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=pi(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var o={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=o;break}c===f&&a.push(o)}l.tween=a}}function t9(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ti(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?J7:e9)(n,e,t))}function Dm(e,t,n){var r=e._id;return e.each(function(){var a=pi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ti(a,r).value[t]}}function HC(e,t){var n;return(typeof t=="number"?ci:t instanceof rs?Mu:(n=rs(t))?(t=n,Mu):MC)(e,t)}function n9(e){return function(){this.removeAttribute(e)}}function i9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function r9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function s9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function a9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttribute(e):(u=this.getAttribute(e),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function o9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function l9(e,t){var n=_h(e),r=n==="transform"?P7:HC;return this.attrTween(e,typeof t=="function"?(n.local?o9:a9)(n,r,Dm(this,"attr."+e,t)):t==null?(n.local?i9:n9)(n):(n.local?s9:r9)(n,r,t))}function c9(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function u9(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function h9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&u9(e,l)),n}return a._value=t,a}function f9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&c9(e,l)),n}return a._value=t,a}function d9(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_h(e);return this.tween(n,(r.local?h9:f9)(r,t))}function p9(e,t){return function(){Rm(this,e).delay=+t.apply(this,arguments)}}function g9(e,t){return t=+t,function(){Rm(this,e).delay=t}}function m9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p9:g9)(t,e)):ti(this.node(),t).delay}function _9(e,t){return function(){pi(this,e).duration=+t.apply(this,arguments)}}function v9(e,t){return t=+t,function(){pi(this,e).duration=t}}function y9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_9:v9)(t,e)):ti(this.node(),t).duration}function b9(e,t){if(typeof t!="function")throw new Error;return function(){pi(this,e).ease=t}}function S9(e){var t=this._id;return arguments.length?this.each(b9(t,e)):ti(this.node(),t).ease}function x9(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pi(this,e).ease=n}}function w9(e){if(typeof e!="function")throw new Error;return this.each(x9(this._id,e))}function C9(e){typeof e!="function"&&(e=mC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new $i(r,this._parents,this._name,this._id)}function E9(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),o=0;o<l;++o)for(var c=t[o],f=n[o],p=c.length,d=u[o]=new Array(p),_,v=0;v<p;++v)(_=c[v]||f[v])&&(d[v]=_);for(;o<r;++o)u[o]=t[o];return new $i(u,this._parents,this._name,this._id)}function k9(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function A9(e,t,n){var r,a,l=k9(t)?Rm:pi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function N9(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(A9(n,e,t))}function T9(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function R9(){return this.on("end.remove",T9(this._id))}function D9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Em(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var o=r[u],c=o.length,f=l[u]=new Array(c),p,d,_=0;_<c;++_)(p=o[_])&&(d=e.call(p,p.__data__,_,o))&&("__data__"in p&&(d.__data__=p.__data__),f[_]=d,yh(f[_],t,n,_,f,ti(p,n)));return new $i(l,this._parents,t,n)}function M9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gC(e));for(var r=this._groups,a=r.length,l=[],u=[],o=0;o<a;++o)for(var c=r[o],f=c.length,p,d=0;d<f;++d)if(p=c[d]){for(var _=e.call(p,p.__data__,d,c),v,w=ti(p,n),C=0,b=_.length;C<b;++C)(v=_[C])&&yh(v,t,n,C,_,w);l.push(_),u.push(p)}return new $i(l,u,t,n)}var j9=dl.prototype.constructor;function L9(){return new j9(this._groups,this._parents)}function O9(e,t){var n,r,a;return function(){var l=pa(this,e),u=(this.style.removeProperty(e),pa(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function FC(e){return function(){this.style.removeProperty(e)}}function B9(e,t,n){var r,a=n+"",l;return function(){var u=pa(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function I9(e,t,n){var r,a,l;return function(){var u=pa(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),pa(this,e))),u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o))}}function z9(e,t){var n,r,a,l="style."+t,u="end."+l,o;return function(){var c=pi(this,e),f=c.on,p=c.value[l]==null?o||(o=FC(t)):void 0;(f!==n||a!==p)&&(r=(n=f).copy()).on(u,a=p),c.on=r}}function H9(e,t,n){var r=(e+="")=="transform"?F7:HC;return t==null?this.styleTween(e,O9(e,r)).on("end.style."+e,FC(e)):typeof t=="function"?this.styleTween(e,I9(e,r,Dm(this,"style."+e,t))).each(z9(this._id,e)):this.styleTween(e,B9(e,r,t),n).on("end.style."+e,null)}function F9(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function P9(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&F9(e,u,n)),r}return l._value=t,l}function U9(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,P9(e,t,n??""))}function $9(e){return function(){this.textContent=e}}function G9(e){return function(){var t=e(this);this.textContent=t??""}}function q9(e){return this.tween("text",typeof e=="function"?G9(Dm(this,"text",e)):$9(e==null?"":e+""))}function V9(e){return function(t){this.textContent=e.call(this,t)}}function Y9(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&V9(a)),t}return r._value=e,r}function W9(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Y9(e))}function X9(){for(var e=this._name,t=this._id,n=PC(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)if(c=u[f]){var p=ti(c,t);yh(c,e,n,f,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new $i(r,this._parents,e,n)}function K9(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var o={value:u},c={value:function(){--a===0&&l()}};n.each(function(){var f=pi(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),f.on=t}),a===0&&l()})}var Z9=0;function $i(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function PC(){return++Z9}var Hi=dl.prototype;$i.prototype={constructor:$i,select:D9,selectAll:M9,selectChild:Hi.selectChild,selectChildren:Hi.selectChildren,filter:C9,merge:E9,selection:L9,transition:X9,call:Hi.call,nodes:Hi.nodes,node:Hi.node,size:Hi.size,empty:Hi.empty,each:Hi.each,on:N9,attr:l9,attrTween:d9,style:H9,styleTween:U9,text:q9,textTween:W9,remove:R9,tween:t9,delay:m9,duration:y9,ease:S9,easeVarying:w9,end:K9,[Symbol.iterator]:Hi[Symbol.iterator]};function Q9(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var J9={time:null,delay:0,duration:250,ease:Q9};function ez(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function tz(e){var t,n;e instanceof $i?(t=e._id,e=e._name):(t=PC(),(n=J9).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&yh(c,e,t,f,u,n||ez(c,t));return new $i(r,this._parents,e,t)}dl.prototype.interrupt=Q7;dl.prototype.transition=tz;const tu=e=>()=>e;function nz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Fi(e,t,n){this.k=e,this.x=t,this.y=n}Fi.prototype={constructor:Fi,scale:function(e){return e===1?this:new Fi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bh=new Fi(1,0,0);UC.prototype=Fi.prototype;function UC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bh;return e.__zoom}function _p(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function iz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qb(){return this.__zoom||bh}function sz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function az(){return navigator.maxTouchPoints||"ontouchstart"in this}function oz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $C(){var e=iz,t=rz,n=oz,r=sz,a=az,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=gu,f=mh("start","zoom","end"),p,d,_,v=500,w=150,C=0,b=10;function S(H){H.property("__zoom",qb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(H,Y,q,X){var K=H.selection?H.selection():H;K.property("__zoom",qb),H!==K?R(H,Y,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},S.scaleBy=function(H,Y,q,X){S.scaleTo(H,function(){var K=this.__zoom.k,L=typeof Y=="function"?Y.apply(this,arguments):Y;return K*L},q,X)},S.scaleTo=function(H,Y,q,X){S.transform(H,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),$=typeof Y=="function"?Y.apply(this,arguments):Y;return n(y(x(L,$),M,O),K,u)},q,X)},S.translateBy=function(H,Y,q,X){S.transform(H,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},S.translateTo=function(H,Y,q,X,K){S.transform(H,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(bh.translate(O[0],O[1]).scale(M.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(H,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===H.k?H:new Fi(Y,H.x,H.y)}function y(H,Y,q){var X=Y[0]-q[0]*H.k,K=Y[1]-q[1]*H.k;return X===H.x&&K===H.y?H:new Fi(H.k,X,K)}function E(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function R(H,Y,q,X){H.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),$=q==null?E(O):typeof q=="function"?q.apply(K,L):q,F=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof Y=="function"?Y.apply(K,L):Y,ae=c(Q.invert($).concat(F/Q.k),re.invert($).concat(F/re.k));return function(Z){if(Z===1)Z=re;else{var P=ae(Z),ee=F/P[2];Z=new Fi(ee,$[0]-P[0]*ee,$[1]-P[1]*ee)}M.zoom(null,Z)}})}function N(H,Y,q){return!q&&H.__zooming||new D(H,Y)}function D(H,Y){this.that=H,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(H,Y),this.taps=0}D.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Y){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Y=An(this.that).datum();f.call(H,this.that,new nz(H,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),Y)}};function T(H,...Y){if(!e.apply(this,arguments))return;var q=N(this,Y).event(H),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(H);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],vu(this),q.start()}Ro(H),q.wheel=setTimeout(M,w),q.zoom("mouse",n(y(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(H,...Y){if(_||!e.apply(this,arguments))return;var q=H.currentTarget,X=N(this,Y,!0).event(H),K=An(H.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",F,!0),L=Xn(H,q),M=H.clientX,O=H.clientY;kC(H.view),_p(H),X.mouse=[L,this.__zoom.invert(L)],vu(this),X.start();function $(Q){if(Ro(Q),!X.moved){var re=Q.clientX-M,ae=Q.clientY-O;X.moved=re*re+ae*ae>C}X.event(Q).zoom("mouse",n(y(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function F(Q){K.on("mousemove.zoom mouseup.zoom",null),AC(Q.view,X.moved),Ro(Q),X.event(Q).end()}}function B(H,...Y){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(H.changedTouches?H.changedTouches[0]:H,this),K=q.invert(X),L=q.k*(H.shiftKey?.5:2),M=n(y(x(q,L),X,K),t.apply(this,Y),u);Ro(H),o>0?An(this).transition().duration(o).call(R,M,X,H):An(this).call(S.transform,M,X,H)}}function z(H,...Y){if(e.apply(this,arguments)){var q=H.touches,X=q.length,K=N(this,Y,H.changedTouches.length===X).event(H),L,M,O,$;for(_p(H),M=0;M<X;++M)O=q[M],$=Xn(O,this),$=[$,this.__zoom.invert($),O.identifier],K.touch0?!K.touch1&&K.touch0[2]!==$[2]&&(K.touch1=$,K.taps=0):(K.touch0=$,L=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),L&&(K.taps<2&&(d=$[0],p=setTimeout(function(){p=null},v)),vu(this),K.start())}}function G(H,...Y){if(this.__zooming){var q=N(this,Y).event(H),X=H.changedTouches,K=X.length,L,M,O,$;for(Ro(H),L=0;L<K;++L)M=X[L],O=Xn(M,this),q.touch0&&q.touch0[2]===M.identifier?q.touch0[0]=O:q.touch1&&q.touch1[2]===M.identifier&&(q.touch1[0]=O);if(M=q.that.__zoom,q.touch1){var F=q.touch0[0],Q=q.touch0[1],re=q.touch1[0],ae=q.touch1[1],Z=(Z=re[0]-F[0])*Z+(Z=re[1]-F[1])*Z,P=(P=ae[0]-Q[0])*P+(P=ae[1]-Q[1])*P;M=x(M,Math.sqrt(Z/P)),O=[(F[0]+re[0])/2,(F[1]+re[1])/2],$=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2]}else if(q.touch0)O=q.touch0[0],$=q.touch0[1];else return;q.zoom("touch",n(y(M,O,$),q.extent,u))}}function U(H,...Y){if(this.__zooming){var q=N(this,Y).event(H),X=H.changedTouches,K=X.length,L,M;for(_p(H),_&&clearTimeout(_),_=setTimeout(function(){_=null},v),L=0;L<K;++L)M=X[L],q.touch0&&q.touch0[2]===M.identifier?delete q.touch0:q.touch1&&q.touch1[2]===M.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(M=Xn(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<b)){var O=An(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return S.wheelDelta=function(H){return arguments.length?(r=typeof H=="function"?H:tu(+H),S):r},S.filter=function(H){return arguments.length?(e=typeof H=="function"?H:tu(!!H),S):e},S.touchable=function(H){return arguments.length?(a=typeof H=="function"?H:tu(!!H),S):a},S.extent=function(H){return arguments.length?(t=typeof H=="function"?H:tu([[+H[0][0],+H[0][1]],[+H[1][0],+H[1][1]]]),S):t},S.scaleExtent=function(H){return arguments.length?(l[0]=+H[0],l[1]=+H[1],S):[l[0],l[1]]},S.translateExtent=function(H){return arguments.length?(u[0][0]=+H[0][0],u[1][0]=+H[1][0],u[0][1]=+H[0][1],u[1][1]=+H[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(H){return arguments.length?(n=H,S):n},S.duration=function(H){return arguments.length?(o=+H,S):o},S.interpolate=function(H){return arguments.length?(c=H,S):c},S.on=function(){var H=f.on.apply(f,arguments);return H===f?S:H},S.clickDistance=function(H){return arguments.length?(C=(H=+H)*H,S):Math.sqrt(C)},S.tapDistance=function(H){return arguments.length?(b=+H,S):b},S}const ei={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GC=["Enter"," ","Escape"],qC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ma;(function(e){e.Strict="strict",e.Loose="loose"})(ma||(ma={}));var ts;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ts||(ts={}));var nl;(function(e){e.Partial="partial",e.Full="full"})(nl||(nl={}));const VC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Er;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Er||(Er={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var Me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Me||(Me={}));const Vb={[Me.Left]:Me.Right,[Me.Right]:Me.Left,[Me.Top]:Me.Bottom,[Me.Bottom]:Me.Top};function YC(e){return e===null?null:e?"valid":"invalid"}const WC=e=>"id"in e&&"source"in e&&"target"in e,lz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gl=(e,t=[0,0])=>{const{width:n,height:r}=Vi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},cz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Mm(a)?a:t.nodeLookup.get(a.id));const o=u?Iu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Sh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xh(n)},ml=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Sh(n,Iu(a)),r=!0)}),r?xh(n):{x:0,y:0,width:0,height:0}},jm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const _ of e.values()){const{measured:v,selectable:w=!0,hidden:C=!1}=_;if(u&&!w||C)continue;const b=v.width??_.width??_.initialWidth??0,S=v.height??_.height??_.initialHeight??0,{x,y}=_.internals.positionAbsolute,E=QC(o,c,f,p,x,y,b,S),R=b*S,N=l&&E>0;(!_.internals.handleBounds||N||E>=R||_.dragging)&&d.push(_)}return d},uz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function hz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function fz({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=hz(e,u),c=ml(o),f=Om(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function XC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const v=o.measured.width,w=o.measured.height;v&&w&&(d=[[c,f],[c+v,f+w]])}else o&&os(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const _=os(d)?as(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:_.x-c+(u.measured.width??0)*p[0],y:_.y-f+(u.measured.height??0)*p[1]},positionAbsolute:_}}async function dz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(_=>_.id)),u=[];for(const _ of n){if(_.deletable===!1)continue;const v=l.has(_.id),w=!v&&_.parentId&&u.find(C=>C.id===_.parentId);(v||w)&&u.push(_)}const o=new Set(t.map(_=>_.id)),c=r.filter(_=>_.deletable!==!1),p=uz(u,c);for(const _ of c)o.has(_.id)&&!p.find(w=>w.id===_.id)&&p.push(_);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const _a=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),as=(e={x:0,y:0},t,n)=>({x:_a(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:_a(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function KC(e,t,n){const{width:r,height:a}=Vi(n),{x:l,y:u}=n.internals.positionAbsolute;return as(e,[[l,u],[l+r,u+a]],t)}const Yb=(e,t,n)=>e<t?_a(Math.abs(e-t),1,t)/t:e>n?-_a(Math.abs(e-n),1,t)/t:0,Lm=(e,t,n=15,r=40)=>{const a=Yb(e.x,r,t.width-r)*n,l=Yb(e.y,r,t.height-r)*n;return[a,l]},Sh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),hg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),xh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),il=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Iu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},ZC=(e,t)=>xh(Sh(hg(e),hg(t))),QC=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},zu=(e,t)=>QC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Wb=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),JC=(e,t)=>(n,r)=>{},_l=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?_l(o,u):o},va=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ta(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function pz(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ta(e,n),a=ta(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ta(e.top??e.y??0,n),a=ta(e.bottom??e.y??0,n),l=ta(e.left??e.x??0,t),u=ta(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gz(e,t,n,r,a,l){const{x:u,y:o}=va(e,[t,n,r]),{x:c,y:f}=va({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Om=(e,t,n,r,a,l)=>{const u=pz(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=_a(f,r,a),d=e.x+e.width/2,_=e.y+e.height/2,v=t/2-d*p,w=n/2-_*p,C=gz(e,v,w,p,t,n),b={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-b.left+b.right,y:w-b.top+b.bottom,zoom:p}},rl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function os(e){return e!=null&&e!=="parent"}function Vi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function e2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function t2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function Xb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mz(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function _z(e){return{...qC,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=vl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?_l(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Bm=e=>({width:e.offsetWidth,height:e.offsetHeight}),n2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},vz=["INPUT","SELECT","TEXTAREA"];function i2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:vz.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const r2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=r2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},Kb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Bm(u)}})};function s2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function nu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Zb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case Me.Left:return[t-nu(t-r,l),n];case Me.Right:return[t+nu(r-t,l),n];case Me.Top:return[t,n-nu(n-a,l)];case Me.Bottom:return[t,n+nu(a-n,l)]}}function a2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,curvature:u=.25}){const[o,c]=Zb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=Zb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,_,v,w]=s2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,_,v,w]}function o2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,o=r<t?r+u:r-u;return[l,o,a,u]}function yz({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+o}function bz({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=Sh(Iu(e),Iu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return zu(u,xh(l))>0}const Sz=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,xz=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),wz=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||Sz;let a;return WC(e)?a={...e}:a={...e,id:r(e)},xz(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function l2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=o2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const Qb={[Me.Left]:{x:-1,y:0},[Me.Right]:{x:1,y:0},[Me.Top]:{x:0,y:-1},[Me.Bottom]:{x:0,y:1}},Cz=({source:e,sourcePosition:t=Me.Bottom,target:n})=>t===Me.Left||t===Me.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Jb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ez({source:e,sourcePosition:t=Me.Bottom,target:n,targetPosition:r=Me.Top,center:a,offset:l,stepPosition:u}){const o=Qb[t],c=Qb[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=Cz({source:f,sourcePosition:t,target:p}),_=d.x!==0?"x":"y",v=d[_];let w=[],C,b;const S={x:0,y:0},x={x:0,y:0},[,,y,E]=o2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[_]*c[_]===-1){_==="x"?(C=a.x??f.x+(p.x-f.x)*u,b=a.y??(f.y+p.y)/2):(C=a.x??(f.x+p.x)/2,b=a.y??f.y+(p.y-f.y)*u);const T=[{x:C,y:f.y},{x:C,y:p.y}],j=[{x:f.x,y:b},{x:p.x,y:b}];o[_]===v?w=_==="x"?T:j:w=_==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(_==="x"?w=o.x===v?j:T:w=o.y===v?T:j,t===r){const H=Math.abs(e[_]-n[_]);if(H<=l){const Y=Math.min(l-1,l-H);o[_]===v?S[_]=(f[_]>e[_]?-1:1)*Y:x[_]=(p[_]>n[_]?-1:1)*Y}}if(t!==r){const H=_==="x"?"y":"x",Y=o[_]===c[H],q=f[H]>p[H],X=f[H]<p[H];(o[_]===1&&(!Y&&q||Y&&X)||o[_]!==1&&(!Y&&X||Y&&q))&&(w=_==="x"?T:j)}const B={x:f.x+S.x,y:f.y+S.y},z={x:p.x+x.x,y:p.y+x.y},G=Math.max(Math.abs(B.x-w[0].x),Math.abs(z.x-w[0].x)),U=Math.max(Math.abs(B.y-w[0].y),Math.abs(z.y-w[0].y));G>=U?(C=(B.x+z.x)/2,b=w[0].y):(C=w[0].x,b=(B.y+z.y)/2)}const R={x:f.x+S.x,y:f.y+S.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...R.x!==w[0].x||R.y!==w[0].y?[R]:[],...w,...N.x!==w[w.length-1].x||N.y!==w[w.length-1].y?[N]:[],n],C,b,y,E]}function kz(e,t,n,r){const a=Math.min(Jb(e,t)/2,Jb(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+a*f},${u}Q ${l},${u} ${l},${u+a*p}`}const o=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${l},${u+a*c}Q ${l},${u} ${l+a*o},${u}`}function fg({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,borderRadius:u=5,centerX:o,centerY:c,offset:f=20,stepPosition:p=.5}){const[d,_,v,w,C]=Ez({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:o,y:c},offset:f,stepPosition:p});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=kz(d[S-1],d[S],d[S+1],u);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,_,v,w,C]}function eS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Az(e){var d;const{sourceNode:t,targetNode:n}=e;if(!eS(t)||!eS(n))return null;const r=t.internals.handleBounds||tS(t.handles),a=n.internals.handleBounds||tS(n.handles),l=nS((r==null?void 0:r.source)??[],e.sourceHandle),u=nS(e.connectionMode===ma.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!u)return(d=e.onError)==null||d.call(e,"008",ei.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(l==null?void 0:l.position)||Me.Bottom,c=(u==null?void 0:u.position)||Me.Top,f=ls(t,l,o),p=ls(n,u,c);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:o,targetPosition:c}}function tS(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ls(e,t,n=Me.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:o}=t??Vi(e);if(r)return{x:a+u/2,y:l+o/2};switch((t==null?void 0:t.position)??n){case Me.Top:return{x:a+u/2,y:l};case Me.Right:return{x:a+u,y:l+o/2};case Me.Bottom:return{x:a+u/2,y:l+o};case Me.Left:return{x:a,y:l+o/2}}}function nS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nz(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=dg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const c2=1e3,Tz=10,Im={nodeOrigin:[0,0],nodeExtent:tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Rz={...Im,checkEquality:!0};function zm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Dz(e,t,n){const r=zm(Im,n);for(const a of e.values())if(a.parentId)Fm(a,e,t,r);else{const l=gl(a,r.nodeOrigin),u=os(a.extent)?a.extent:r.nodeExtent,o=as(l,u,Vi(a));a.internals.positionAbsolute=o}}function Mz(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Hm(e){return e==="manual"}function pg(e,t,n,r={}){var p,d;const a=zm(Rz,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Hm(a.zIndexMode)?c2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const _ of e){let v=u.get(_.id);if(a.checkEquality&&_===(v==null?void 0:v.internals.userNode))t.set(_.id,v);else{const w=gl(_,a.nodeOrigin),C=os(_.extent)?_.extent:a.nodeExtent,b=as(w,C,Vi(_));v={...a.defaults,..._,measured:{width:(p=_.measured)==null?void 0:p.width,height:(d=_.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:Mz(_,v),z:u2(_,o,a.zIndexMode),userNode:_}},t.set(_.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(c=!1),_.parentId&&Fm(v,t,n,r,l),f||(f=_.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function jz(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Fm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=zm(Im,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jz(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*Tz),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Hm(c)?c2:0,{x:_,y:v,z:w}=Lz(e,p,u,o,d,c),{positionAbsolute:C}=e.internals,b=_!==C.x||v!==C.y;(b||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:_,y:v}:C,z:w}})}function u2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Hm(n)?r:r+(e.selected?t:0)}function Lz(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Vi(e),f=gl(e,n),p=os(e.extent)?as(f,e.extent,c):f;let d=as({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=KC(d,c,t));const _=u2(e,a,l),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=_?v+1:_}}function Pm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??il(c),p=ZC(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var y;const p=c.internals.positionAbsolute,d=Vi(c),_=c.origin??r,v=o.x<p.x?Math.round(Math.abs(p.x-o.x)):0,w=o.y<p.y?Math.round(Math.abs(p.y-o.y)):0,C=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),S=(C-d.width)*_[0],x=(b-d.height)*_[1];(v>0||w>0||S||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-v+S,y:c.position.y-w+x}}),(y=n.get(f))==null||y.forEach(E=>{e.some(R=>R.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+v,y:E.position.y+w}})})),(d.width<o.width||d.height<o.height||v||w)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:C+(v?_[0]*v-S:0),height:b+(w?_[1]*w-x:0)}})}),a}function Oz(e,t,n,r,a,l,u){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],p=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(p.transform),_=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),c=!0;continue}const C=Bm(v.nodeElement),b=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(b||!w.internals.handleBounds||v.force))){const x=v.nodeElement.getBoundingClientRect(),y=os(w.extent)?w.extent:l;let{positionAbsolute:E}=w.internals;w.parentId&&w.extent==="parent"?E=KC(E,C,t.get(w.parentId)):y&&(E=as(E,y,C));const R={...w,measured:C,internals:{...w.internals,positionAbsolute:E,handleBounds:{source:Kb("source",v.nodeElement,x,d,w.id),target:Kb("target",v.nodeElement,x,d,w.id)}}};t.set(w.id,R),w.parentId&&Fm(R,t,n,{nodeOrigin:a,zIndexMode:u}),c=!0,b&&(f.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&_.push({id:w.id,parentId:w.parentId,rect:il(R,a)}))}}if(_.length>0){const v=Pm(_,t,n,a);f.push(...v)}return{changes:f,updatedInternals:c}}async function Bz({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function iS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function h2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;iS("source",c,p,e,a,u),iS("target",c,f,e,l,o),t.set(r.id,r)}}function f2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:f2(n,t):!1}function rS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Iz(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!f2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function vp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function zz({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=_l(l,t);return{x:u.x-l.x,y:u.y-l.y}}function Hz({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,_=null,v=!1,w=!1,C=null;function b({noDragClassName:x,handleSelector:y,domNode:E,isSelectable:R,nodeId:N,nodeClickDistance:D=0}){_=An(E);function T({x:G,y:U}){const{nodeLookup:H,nodeExtent:Y,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:$}=t();l={x:G,y:U};let F=!1;const Q=o.size>1,re=Q&&Y?hg(ml(o)):null,ae=Q&&X?zz({dragItems:o,snapGrid:q,x:G,y:U}):null;for(const[Z,P]of o){if(!H.has(Z))continue;let ee={x:G-P.distance.x,y:U-P.distance.y};X&&(ee=ae?{x:Math.round(ee.x+ae.x),y:Math.round(ee.y+ae.y)}:_l(ee,q));let ne=null;if(Q&&Y&&!P.extent&&re){const{positionAbsolute:ye}=P.internals,be=ye.x-re.x+Y[0][0],ke=ye.x+P.measured.width-re.x2+Y[1][0],Ee=ye.y-re.y+Y[0][1],Ce=ye.y+P.measured.height-re.y2+Y[1][1];ne=[[be,Ee],[ke,Ce]]}const{position:ge,positionAbsolute:he}=XC({nodeId:Z,nextPosition:ee,nodeLookup:H,nodeExtent:ne||Y,nodeOrigin:K,onError:O});F=F||P.position.x!==ge.x||P.position.y!==ge.y,P.position=ge,P.internals.positionAbsolute=he}if(w=w||F,!!F&&($(o,!0),C&&(r||L||!N&&M))){const[Z,P]=vp({nodeId:N,dragItems:o,nodeLookup:H});r==null||r(C,o,Z,P),L==null||L(C,Z,P),N||M==null||M(C,P)}}async function j(){if(!p)return;const{transform:G,panBy:U,autoPanSpeed:H,autoPanOnNodeDrag:Y}=t();if(!Y){c=!1,cancelAnimationFrame(u);return}const[q,X]=Lm(f,p,H);(q!==0||X!==0)&&(l.x=(l.x??0)-q/G[2],l.y=(l.y??0)-X/G[2],await U({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(G){var Q;const{nodeLookup:U,multiSelectionActive:H,nodesDraggable:Y,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!L||!R)&&!H&&N&&((Q=U.get(N))!=null&&Q.selected||$()),R&&L&&N&&(e==null||e(N));const F=Ho(G.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=F,o=Iz(U,Y,F,N),o.size>0&&(n||M||!N&&O)){const[re,ae]=vp({nodeId:N,dragItems:o,nodeLookup:U});n==null||n(G.sourceEvent,o,re,ae),M==null||M(G.sourceEvent,re,ae),N||O==null||O(G.sourceEvent,ae)}}const z=NC().clickDistance(D).on("start",G=>{const{domNode:U,nodeDragThreshold:H,transform:Y,snapGrid:q,snapToGrid:X}=t();p=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,w=!1,C=G.sourceEvent,H===0&&B(G),l=Ho(G.sourceEvent,{transform:Y,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(G.sourceEvent,p)}).on("drag",G=>{const{autoPanOnNodeDrag:U,transform:H,snapGrid:Y,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Ho(G.sourceEvent,{transform:H,snapGrid:Y,snapToGrid:q,containerBounds:p});if(C=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||N&&!K.has(N))&&(v=!0),!v){if(!c&&U&&d&&(c=!0,j()),!d){const M=Qn(G.sourceEvent,p),O=M.x-f.x,$=M.y-f.y;Math.sqrt(O*O+$*$)>X&&B(G)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(G.sourceEvent,p),T(L))}}).on("end",G=>{if(!d||v){v&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:U,updateNodePositions:H,onNodeDragStop:Y,onSelectionDragStop:q}=t();if(w&&(H(o,!1),w=!1),a||Y||!N&&q){const[X,K]=vp({nodeId:N,dragItems:o,nodeLookup:U,dragging:!1});a==null||a(G.sourceEvent,o,X,K),Y==null||Y(G.sourceEvent,X,K),N||q==null||q(G.sourceEvent,K)}}}).filter(G=>{const U=G.target;return!G.button&&(!x||!rS(U,`.${x}`,E))&&(!y||rS(U,y,E))});_.call(z)}function S(){_==null||_.on(".drag",null)}return{update:b,destroy:S}}function Fz(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())zu(a,il(l))>0&&r.push(l);return r}const Pz=250;function Uz(e,t,n,r){var o,c;let a=[],l=1/0;const u=Fz(e,n,t+Pz);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:_,y:v}=ls(f,d,d.position,!0),w=Math.sqrt(Math.pow(_-e.x,2)+Math.pow(v-e.y,2));w>t||(w<l?(a=[{...d,x:_,y:v}],l=w):w===l&&a.push({...d,x:_,y:v}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function d2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(_=>_.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ls(u,c,c.position,!0)}:c}function p2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $z(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const g2=()=>!0;function Gz(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:_,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:b,isValidConnection:S=g2,onReconnectEnd:x,updateConnection:y,getTransform:E,getFromHandle:R,autoPanSpeed:N,dragThreshold:D=1,handleDomNode:T}){const j=n2(e.target);let B=0,z;const{x:G,y:U}=Qn(e),H=p2(l,T),Y=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!Y||!H)return;const X=d2(a,H,r,c,t);if(!X)return;let K=Qn(e,Y),L=!1,M=null,O=!1,$=null;function F(){if(!p||!Y)return;const[ge,he]=Lm(K,Y,N);_({x:ge,y:he}),B=requestAnimationFrame(F)}const Q={...X,nodeId:a,type:H,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ls(re,Q,Me.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:Vb[Q.position],toNode:null,pointer:K};function P(){q=!0,y(Z),w==null||w(e,{nodeId:a,handleId:r,handleType:H})}D===0&&P();function ee(ge){if(!q){const{x:Ce,y:rt}=Qn(ge),bt=Ce-G,Ge=rt-U;if(!(bt*bt+Ge*Ge>D*D))return;P()}if(!R()||!Q){ne(ge);return}const he=E();K=Qn(ge,Y),z=Uz(vl(K,he,!1,[1,1]),n,c,Q),L||(F(),L=!0);const ye=m2(ge,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:S,doc:j,lib:f,flowId:d,nodeLookup:c});$=ye.handleDomNode,M=ye.connection,O=$z(!!z,ye.isValid);const be=c.get(a),ke=be?ls(be,Q,Me.Left,!0):Z.from,Ee={...Z,from:ke,isValid:O,to:ye.toHandle&&O?va({x:ye.toHandle.x,y:ye.toHandle.y},he):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:Vb[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};y(Ee),Z=Ee}function ne(ge){if(!("touches"in ge&&ge.touches.length>0)){if(q){(z||$)&&M&&O&&(C==null||C(M));const{inProgress:he,...ye}=Z,be={...ye,toPosition:Z.toHandle?Z.toPosition:null};b==null||b(ge,be),l&&(x==null||x(ge,be))}v(),cancelAnimationFrame(B),L=!1,O=!1,M=null,$=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function m2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=g2,nodeLookup:p}){const d=l==="target",_=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:w}=Qn(e),C=u.elementFromPoint(v,w),b=C!=null&&C.classList.contains(`${o}-flow__handle`)?C:_,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const x=p2(void 0,b),y=b.getAttribute("data-nodeid"),E=b.getAttribute("data-handleid"),R=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!x)return S;const D={source:d?y:r,sourceHandle:d?E:a,target:d?r:y,targetHandle:d?a:E};S.connection=D;const j=R&&N&&(n===ma.Strict?d&&x==="source"||!d&&x==="target":y!==r||E!==a);S.isValid=j&&f(D),S.toHandle=d2(y,x,E,p,n,!0)}return S}const gg={onPointerDown:Gz,isValid:m2};function qz({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:_=!0,inversePan:v=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=y.sourceEvent.ctrlKey&&rl()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,D=E[2]*Math.pow(2,N*R);t.scaleTo(D)};let C=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(C=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},S=y=>{const E=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const R=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[R[0]-C[0],R[1]-C[1]];C=R;const D=r()*Math.max(E[2],Math.log(E[2]))*(v?-1:1),T={x:E[0]-N[0]*D,y:E[1]-N[1]*D},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=$C().on("start",b).on("zoom",d?S:null).on("zoom.wheel",_?w:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const wh=e=>({x:e.x,y:e.y,zoom:e.k}),yp=({x:e,y:t,zoom:n})=>bh.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),_2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Vz=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bp=(e,t=0,n=Vz,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},v2=e=>{const t=e.ctrlKey&&rl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Yz({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(la(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const b=Xn(p),S=v2(p),x=d*Math.pow(2,S);r.scaleTo(n,x,b,p);return}const _=p.deltaMode===1?20:1;let v=a===ts.Vertical?0:p.deltaX*_,w=a===ts.Horizontal?0:p.deltaY*_;!rl()&&p.shiftKey&&a!==ts.Vertical&&(v=p.deltaY*_,w=0),r.translateBy(n,-(v/d)*l,-(w/d)*l,{internal:!0});const C=wh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,C),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,C))}}function Wz({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=la(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function Xz({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=wh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function Kz({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&_2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,wh(l.transform)))}}function Zz({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&_2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=wh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function Qz({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var b;const _=e||t,v=n&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(la(d,`${f}-flow__node`)||la(d,`${f}-flow__edge`)))return!0;if(!r&&!_&&!a&&!l&&!n||u||p&&!w||la(d,o)&&w||la(d,c)&&(!w||a&&w&&!e)||!n&&d.ctrlKey&&w)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!_&&!a&&!v&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const C=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w)&&C}}function Jz({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=$C().scaleExtent([t,n]).translateExtent(r),_=An(e).call(d);x({x:a.x,y:a.y,zoom:_a(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const v=_.on("wheel.zoom"),w=_.on("dblclick.zoom");d.wheelDelta(v2);async function C(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).transform(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}function b({noWheelClassName:z,noPanClassName:G,onPaneContextMenu:U,userSelectionActive:H,panOnScroll:Y,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:F,lib:Q,onTransformChange:re,connectionInProgress:ae,paneClickDistance:Z,selectionOnDrag:P}){H&&!f.isZoomingOrPanning&&S();const ee=Y&&!F&&!H;d.clickDistance(P?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?Yz({zoomPanValues:f,noWheelClassName:z,d3Selection:_,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):Wz({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:v});_.on("wheel.zoom",ne,{passive:!1});const ge=Xz({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",ge);const he=Kz({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!U,onPanZoom:l,onTransformChange:re});d.on("zoom",he);const ye=Zz({zoomPanValues:f,panOnDrag:q,panOnScroll:Y,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const be=Qz({zoomActivationKeyPressed:F,panOnDrag:q,zoomOnScroll:O,panOnScroll:Y,zoomOnDoubleClick:$,zoomOnPinch:M,userSelectionActive:H,noPanClassName:G,noWheelClassName:z,lib:Q,connectionInProgress:ae});d.filter(be),$?_.on("dblclick.zoom",w):_.on("dblclick.zoom",null)}function S(){d.on("zoom",null)}async function x(z,G,U){const H=yp(z),Y=d==null?void 0:d.constrain()(H,G,U);return Y&&await C(Y),Y}async function y(z,G){const U=yp(z);return await C(U,G),U}function E(z){if(_){const G=yp(z),U=_.property("__zoom");(U.k!==z.zoom||U.x!==z.x||U.y!==z.y)&&(d==null||d.transform(_,G,null,{sync:!0}))}}function R(){const z=_?UC(_.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).scaleTo(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}async function D(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).scaleBy(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const G=!Zn(z)||z<0?0:z;d==null||d.clickDistance(G)}return{update:b,destroy:S,setViewport:y,setViewportConstrained:x,getViewport:R,scaleTo:N,scaleBy:D,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function eH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function sS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Cr(e,t){return Math.max(0,e-t)}function iu(e,t,n){return Math.max(0,t-e,e-n)}function aS(e,t){return e?!t:t}function tH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,_=p&&d,{xSnapped:v,ySnapped:w}=n,{minWidth:C,maxWidth:b,minHeight:S,maxHeight:x}=r,{x:y,y:E,width:R,height:N,aspectRatio:D}=e;let T=Math.floor(p?v-e.pointerX:0),j=Math.floor(d?w-e.pointerY:0);const B=R+(c?-T:T),z=N+(f?-j:j),G=-l[0]*R,U=-l[1]*N;let H=iu(B,C,b),Y=iu(z,S,x);if(u){let K=0,L=0;c&&T<0?K=wr(y+T+G,u[0][0]):!c&&T>0&&(K=Cr(y+B+G,u[1][0])),f&&j<0?L=wr(E+j+U,u[0][1]):!f&&j>0&&(L=Cr(E+z+U,u[1][1])),H=Math.max(H,K),Y=Math.max(Y,L)}if(o){let K=0,L=0;c&&T>0?K=Cr(y+T,o[0][0]):!c&&T<0&&(K=wr(y+B,o[1][0])),f&&j>0?L=Cr(E+j,o[0][1]):!f&&j<0&&(L=wr(E+z,o[1][1])),H=Math.max(H,K),Y=Math.max(Y,L)}if(a){if(p){const K=iu(B/D,S,x)*D;if(H=Math.max(H,K),u){let L=0;!c&&!f||c&&!f&&_?L=Cr(E+U+B/D,u[1][1])*D:L=wr(E+U+(c?T:-T)/D,u[0][1])*D,H=Math.max(H,L)}if(o){let L=0;!c&&!f||c&&!f&&_?L=wr(E+B/D,o[1][1])*D:L=Cr(E+(c?T:-T)/D,o[0][1])*D,H=Math.max(H,L)}}if(d){const K=iu(z*D,C,b)/D;if(Y=Math.max(Y,K),u){let L=0;!c&&!f||f&&!c&&_?L=Cr(y+z*D+G,u[1][0])/D:L=wr(y+(f?j:-j)*D+G,u[0][0])/D,Y=Math.max(Y,L)}if(o){let L=0;!c&&!f||f&&!c&&_?L=wr(y+z*D,o[1][0])/D:L=Cr(y+(f?j:-j)*D,o[0][0])/D,Y=Math.max(Y,L)}}}j=j+(j<0?Y:-Y),T=T+(T<0?H:-H),a&&(_?B>z*D?j=(aS(c,f)?-T:T)/D:T=(aS(c,f)?-j:j)*D:p?(j=T/D,f=c):(T=j*D,c=f));const q=c?y+T:y,X=f?E+j:E;return{width:R+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const y2={width:0,height:0,x:0,y:0},nH={...y2,pointerX:0,pointerY:0,aspectRatio:1};function iH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function rH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:sS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:_,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:b}){let S={...y2},x={...nH};u={boundaries:p,resizeDirection:_,keepAspectRatio:d,controlDirection:sS(f)};let y,E=null,R=[],N,D,T,j=!1;const B=NC().on("start",z=>{const{nodeLookup:G,transform:U,snapGrid:H,snapToGrid:Y,nodeOrigin:q,paneDomNode:X}=n();if(y=G.get(t),!y)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Ho(z.sourceEvent,{transform:U,snapGrid:H,snapToGrid:Y,containerBounds:E});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...S,pointerX:K,pointerY:L,aspectRatio:S.width/S.height},N=void 0,D=os(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=G.get(y.parentId)),N&&y.extent==="parent"&&(D=[[0,0],[N.measured.width,N.measured.height]]),R=[],T=void 0;for(const[M,O]of G)if(O.parentId===t&&(R.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=iH(O,y,O.origin??q);T?T=[[Math.min($[0][0],T[0][0]),Math.min($[0][1],T[0][1])],[Math.max($[1][0],T[1][0]),Math.max($[1][1],T[1][1])]]:T=$}v==null||v(z,{...S})}).on("drag",z=>{const{transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y}=n(),q=Ho(z.sourceEvent,{transform:G,snapGrid:U,snapToGrid:H,containerBounds:E}),X=[];if(!y)return;const{x:K,y:L,width:M,height:O}=S,$={},F=y.origin??Y,{width:Q,height:re,x:ae,y:Z}=tH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,F,D,T),P=Q!==M,ee=re!==O,ne=ae!==K&&P,ge=Z!==L&ⅇif(!ne&&!ge&&!P&&!ee)return;if((ne||ge||F[0]===1||F[1]===1)&&($.x=ne?ae:S.x,$.y=ge?Z:S.y,S.x=$.x,S.y=$.y,R.length>0)){const ke=ae-K,Ee=Z-L;for(const Ce of R)Ce.position={x:Ce.position.x-ke+F[0]*(Q-M),y:Ce.position.y-Ee+F[1]*(re-O)},X.push(Ce)}if((P||ee)&&($.width=P&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:S.width,$.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:S.height,S.width=$.width,S.height=$.height),N&&y.expandParent){const ke=F[0]*($.width??0);$.x&&$.x<ke&&(S.x=ke,x.x=x.x-($.x-ke));const Ee=F[1]*($.height??0);$.y&&$.y<Ee&&(S.y=Ee,x.y=x.y-($.y-Ee))}const he=eH({width:S.width,prevWidth:M,height:S.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ye={...S,direction:he};(b==null?void 0:b(z,ye))!==!1&&(j=!0,w==null||w(z,ye),r($,X))}).on("end",z=>{j&&(C==null||C(z,{...S}),a==null||a({...S}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Sp={exports:{}},xp={},wp={exports:{}},Cp={};/** * @license React * use-sync-external-store-shim.production.js * @@ -364,7 +364,7 @@ Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githu * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oS;function lH(){if(oS)return Cp;oS=1;var e=al();function t(d,_){return d===_&&(d!==0||1/d===1/_)||d!==d&&_!==_}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,_){var v=_(),w=r({inst:{value:v,getSnapshot:_}}),C=w[0].inst,b=w[1];return l(function(){C.value=v,C.getSnapshot=_,c(C)&&b({inst:C})},[d,v,_]),a(function(){return c(C)&&b({inst:C}),d(function(){c(C)&&b({inst:C})})},[d]),u(v),v}function c(d){var _=d.getSnapshot;d=d.value;try{var v=_();return!n(d,v)}catch{return!0}}function f(d,_){return _()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Cp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Cp}var lS;function cH(){return lS||(lS=1,wp.exports=lH()),wp.exports}/** + */var oS;function sH(){if(oS)return Cp;oS=1;var e=al();function t(d,_){return d===_&&(d!==0||1/d===1/_)||d!==d&&_!==_}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,_){var v=_(),w=r({inst:{value:v,getSnapshot:_}}),C=w[0].inst,b=w[1];return l(function(){C.value=v,C.getSnapshot=_,c(C)&&b({inst:C})},[d,v,_]),a(function(){return c(C)&&b({inst:C}),d(function(){c(C)&&b({inst:C})})},[d]),u(v),v}function c(d){var _=d.getSnapshot;d=d.value;try{var v=_();return!n(d,v)}catch{return!0}}function f(d,_){return _()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Cp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Cp}var lS;function aH(){return lS||(lS=1,wp.exports=sH()),wp.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -372,10 +372,10 @@ Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githu * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var cS;function uH(){if(cS)return xp;cS=1;var e=al(),t=cH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(f,p,d,_,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=o(function(){function S(N){if(!x){if(x=!0,y=N,N=_(N),v!==void 0&&C.hasValue){var D=C.value;if(v(D,N))return E=D}return E=N}if(D=E,r(y,N))return D;var T=_(N);return v!==void 0&&v(D,T)?(y=N,D):(y=N,E=T)}var x=!1,y,E,R=d===void 0?null:d;return[function(){return S(p())},R===null?void 0:function(){return S(R())}]},[p,d,_,v]);var b=a(f,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=b},[b]),c(b),b},xp}var uS;function hH(){return uS||(uS=1,Sp.exports=uH()),Sp.exports}var fH=hH();const dH=Pu(fH),pH={},hS=e=>{let t;const n=new Set,r=(p,d)=>{const _=typeof p=="function"?p(t):p;if(!Object.is(_,t)){const v=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(w=>w(t,v))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(pH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},gH=e=>e?hS(e):hS,{useDebugValue:mH}=dA,{useSyncExternalStoreWithSelector:_H}=dH,vH=e=>e;function w2(e,t=vH,n){const r=_H(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return mH(r),r}const fS=(e,t)=>{const n=gH(e),r=(a,l=t)=>w2(n,a,l);return Object.assign(r,n),r},yH=(e,t)=>e?fS(e,t):fS;function At(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}FS();const Ch=q.createContext(null),bH=Ch.Provider,C2=ei.error001("react");function tt(e,t){const n=q.useContext(Ch);if(n===null)throw new Error(C2);return w2(n,e,t)}function Ct(){const e=q.useContext(Ch);if(e===null)throw new Error(C2);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const dS={display:"none"},SH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},E2="react-flow__node-desc",k2="react-flow__edge-desc",xH="react-flow__aria-live",wH=e=>e.ariaLiveMessage,CH=e=>e.ariaLabelConfig;function EH({rfId:e}){const t=tt(wH);return m.jsx("div",{id:`${xH}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SH,children:t})}function kH({rfId:e,disableKeyboardA11y:t}){const n=tt(CH);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${E2}-${e}`,style:dS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${k2}-${e}`,style:dS,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(EH,{rfId:e})]})}const Eh=q.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return m.jsx("div",{className:Ft(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Eh.displayName="Panel";const pS="https://reactflow.dev?utm_source=attribution";function AH({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Eh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${pS}`,children:m.jsx("a",{href:pS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const NH=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ru=e=>e.id;function TH(e,t){return At(e.selectedNodes.map(ru),t.selectedNodes.map(ru))&&At(e.selectedEdges.map(ru),t.selectedEdges.map(ru))}function RH({onSelectionChange:e}){const t=Ct(),{selectedNodes:n,selectedEdges:r}=tt(NH,TH);return q.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const DH=e=>!!e.onSelectionChangeHandlers;function MH({onSelectionChange:e}){const t=tt(DH);return e||t?m.jsx(RH,{onSelectionChange:e}):null}const A2=[0,0],jH={x:0,y:0,zoom:1},LH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],gS=[...LH,"rfId"],OH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),mS={translateExtent:tl,nodeOrigin:A2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function BH(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=tt(OH,At),f=Ct();q.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=mS,o()}),[]);const p=q.useRef(mS);return q.useEffect(()=>{for(const d of gS){const _=e[d],v=p.current[d];_!==v&&(typeof e[d]>"u"||(d==="nodes"?t(_):d==="edges"?n(_):d==="minZoom"?r(_):d==="maxZoom"?a(_):d==="translateExtent"?l(_):d==="nodeExtent"?u(_):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:bz(_)}):d==="fitView"?f.setState({fitViewQueued:_}):d==="fitViewOptions"?f.setState({fitViewOptions:_}):f.setState({[d]:_})))}p.current=e},gS.map(d=>e[d])),null}function _S(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function IH(e){var r;const[t,n]=q.useState(e==="system"?null:e);return q.useEffect(()=>{if(e!=="system"){n(e);return}const a=_S(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=_S())!=null&&r.matches?"dark":"light"}const vS=typeof document<"u"?document:null;function sl(e=null,t={target:vS,actInsideInputWithModifier:!0}){const[n,r]=q.useState(!1),a=q.useRef(!1),l=q.useRef(new Set([])),[u,o]=q.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` + */var cS;function oH(){if(cS)return xp;cS=1;var e=al(),t=aH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(f,p,d,_,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=o(function(){function S(N){if(!x){if(x=!0,y=N,N=_(N),v!==void 0&&C.hasValue){var D=C.value;if(v(D,N))return E=D}return E=N}if(D=E,r(y,N))return D;var T=_(N);return v!==void 0&&v(D,T)?(y=N,D):(y=N,E=T)}var x=!1,y,E,R=d===void 0?null:d;return[function(){return S(p())},R===null?void 0:function(){return S(R())}]},[p,d,_,v]);var b=a(f,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=b},[b]),c(b),b},xp}var uS;function lH(){return uS||(uS=1,Sp.exports=oH()),Sp.exports}var cH=lH();const uH=Pu(cH),hH={},hS=e=>{let t;const n=new Set,r=(p,d)=>{const _=typeof p=="function"?p(t):p;if(!Object.is(_,t)){const v=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(w=>w(t,v))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(hH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},fH=e=>e?hS(e):hS,{useDebugValue:dH}=cA,{useSyncExternalStoreWithSelector:pH}=uH,gH=e=>e;function b2(e,t=gH,n){const r=pH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dH(r),r}const fS=(e,t)=>{const n=fH(e),r=(a,l=t)=>b2(n,a,l);return Object.assign(r,n),r},mH=(e,t)=>e?fS(e,t):fS;function kt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}zS();const Ch=V.createContext(null),_H=Ch.Provider,S2=ei.error001("react");function tt(e,t){const n=V.useContext(Ch);if(n===null)throw new Error(S2);return b2(n,e,t)}function At(){const e=V.useContext(Ch);if(e===null)throw new Error(S2);return V.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const dS={display:"none"},vH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},x2="react-flow__node-desc",w2="react-flow__edge-desc",yH="react-flow__aria-live",bH=e=>e.ariaLiveMessage,SH=e=>e.ariaLabelConfig;function xH({rfId:e}){const t=tt(bH);return m.jsx("div",{id:`${yH}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vH,children:t})}function wH({rfId:e,disableKeyboardA11y:t}){const n=tt(SH);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${x2}-${e}`,style:dS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${w2}-${e}`,style:dS,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(xH,{rfId:e})]})}const Eh=V.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return m.jsx("div",{className:Ft(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Eh.displayName="Panel";const pS="https://reactflow.dev?utm_source=attribution";function CH({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Eh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${pS}`,children:m.jsx("a",{href:pS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const EH=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ru=e=>e.id;function kH(e,t){return kt(e.selectedNodes.map(ru),t.selectedNodes.map(ru))&&kt(e.selectedEdges.map(ru),t.selectedEdges.map(ru))}function AH({onSelectionChange:e}){const t=At(),{selectedNodes:n,selectedEdges:r}=tt(EH,kH);return V.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const NH=e=>!!e.onSelectionChangeHandlers;function TH({onSelectionChange:e}){const t=tt(NH);return e||t?m.jsx(AH,{onSelectionChange:e}):null}const C2=[0,0],RH={x:0,y:0,zoom:1},DH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],gS=[...DH,"rfId"],MH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),mS={translateExtent:tl,nodeOrigin:C2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jH(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=tt(MH,kt),f=At();V.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=mS,o()}),[]);const p=V.useRef(mS);return V.useEffect(()=>{for(const d of gS){const _=e[d],v=p.current[d];_!==v&&(typeof e[d]>"u"||(d==="nodes"?t(_):d==="edges"?n(_):d==="minZoom"?r(_):d==="maxZoom"?a(_):d==="translateExtent"?l(_):d==="nodeExtent"?u(_):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:_z(_)}):d==="fitView"?f.setState({fitViewQueued:_}):d==="fitViewOptions"?f.setState({fitViewOptions:_}):f.setState({[d]:_})))}p.current=e},gS.map(d=>e[d])),null}function _S(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function LH(e){var r;const[t,n]=V.useState(e==="system"?null:e);return V.useEffect(()=>{if(e!=="system"){n(e);return}const a=_S(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=_S())!=null&&r.matches?"dark":"light"}const vS=typeof document<"u"?document:null;function sl(e=null,t={target:vS,actInsideInputWithModifier:!0}){const[n,r]=V.useState(!1),a=V.useRef(!1),l=V.useRef(new Set([])),[u,o]=V.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),p=f.reduce((d,_)=>d.concat(..._),[]);return[f,p]}return[[],[]]},[e]);return q.useEffect(()=>{const c=(t==null?void 0:t.target)??vS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=v=>{var b,S;if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!f)&&a2(v))return!1;const C=bS(v.code,o);if(l.current.add(v[C]),yS(u,l.current,!1)){const x=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!y)&&v.preventDefault(),r(!0)}},d=v=>{const w=bS(v.code,o);yS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),a.current=!1},_=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,r]),n}function yS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function bS(e,t){return t.includes(e)?"code":"key"}const zH=()=>{const e=Ct();return q.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Om(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return vl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=va(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function N2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)HH(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function HH(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function FH(e,t){return N2(e,t)}function PH(e,t){return N2(e,t)}function Zr(e,t){return{id:e,type:"select",selected:t}}function ca(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(Zr(l.id,u)))}return r}function SS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function xS(e){return{id:e.id,type:"remove"}}const UH=n2();function $H(e,t,n={}){return kz(e,t,{...n,onError:n.onError??UH})}const wS=e=>hz(e),GH=e=>ZC(e);function T2(e){return q.forwardRef(e)}const R2=typeof window<"u"?q.useLayoutEffect:q.useEffect;function CS(e){const[t,n]=q.useState(BigInt(0)),[r]=q.useState(()=>qH(()=>n(a=>a+BigInt(1))));return R2(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function qH(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const D2=q.createContext(null);function VH({children:e}){const t=Ct(),n=q.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:_,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=c;for(const S of o)C=typeof S=="function"?S(C):S;let b=SS({items:C,lookup:_});for(const S of w.values())b=S(b);p&&f(C),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:x,setNodes:y}=t.getState();S&&y(x)})},[]),r=CS(n),a=q.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:_}=t.getState();let v=c;for(const w of o)v=typeof w=="function"?w(v):w;p?f(v):d&&d(SS({items:v,lookup:_}))},[]),l=CS(a),u=q.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return m.jsx(D2.Provider,{value:u,children:e})}function YH(){const e=q.useContext(D2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const WH=e=>!!e.panZoom;function Um(){const e=zH(),t=Ct(),n=YH(),r=tt(WH),a=q.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var S,x;const{nodeLookup:_,nodeOrigin:v}=t.getState(),w=wS(d)?d:_.get(d.id),C=w.parentId?r2(w.position,w.measured,w.parentId,_,v):w.position,b={...w,position:C,width:((S=w.measured)==null?void 0:S.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return il(b)},f=(d,_,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&wS(b)?b:{...C,...b}}return C}))},p=(d,_,v={replace:!1})=>{o(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&GH(b)?b:{...C,...b}}return C}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var _;return(_=l(d))==null?void 0:_.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(_=>({..._}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const _=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,..._])},addEdges:d=>{const _=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,..._])},toObject:()=>{const{nodes:d=[],edges:_=[],transform:v}=t.getState(),[w,C,b]=v;return{nodes:d.map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:w,y:C,zoom:b}}},deleteElements:async({nodes:d=[],edges:_=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:E}=t.getState(),{nodes:R,edges:N}=await mz({nodesToRemove:d,edgesToRemove:_,nodes:v,edges:w,onBeforeDelete:E}),D=N.length>0,T=R.length>0;if(D){const j=N.map(xS);b==null||b(N),x(j)}if(T){const j=R.map(xS);C==null||C(R),S(j)}return(T||D)&&(y==null||y({nodes:R,edges:N})),{deletedNodes:R,deletedEdges:N}},getIntersectingNodes:(d,_=!0,v)=>{const w=Wb(d),C=w?d:c(d),b=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const x=t.getState().nodeLookup.get(S.id);if(x&&!w&&(S.id===d.id||!x.internals.positionAbsolute))return!1;const y=il(b?S:x),E=zu(y,C);return _&&E>0||E>=y.width*y.height||E>=C.width*C.height}):[]},isNodeIntersecting:(d,_,v=!0)=>{const C=Wb(d)?d:c(d);if(!C)return!1;const b=zu(C,_);return v&&b>0||b>=_.width*_.height||b>=C.width*C.height},updateNode:f,updateNodeData:(d,_,v={replace:!1})=>{f(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(d,_,v={replace:!1})=>{p(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:d=>{const{nodeLookup:_,nodeOrigin:v}=t.getState();return fz(d,{nodeLookup:_,nodeOrigin:v})},getHandleConnections:({type:d,id:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}-${d}${_?`-${_}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:d,handleId:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}${d?_?`-${d}-${_}`:`-${d}`:""}`))==null?void 0:w.values())??[])},fitView:async d=>{const _=t.getState().fitViewResolver??yz();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:_}),n.nodeQueue.push(v=>[...v]),_.promise}}},[]);return q.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const ES=e=>e.selected,XH=typeof window<"u"?window:void 0;function KH({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ct(),{deleteElements:r}=Um(),a=sl(e,{actInsideInputWithModifier:!1}),l=sl(t,{target:XH});q.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(ES),edges:u.filter(ES)}),n.setState({nodesSelectionActive:!1})}},[a]),q.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function ZH(e){const t=Ct();q.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Bm(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},QH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function JH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ts.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:_,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:b,onViewportChange:S,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:E}){const R=Ct(),N=q.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:j}=tt(QH,At),B=sl(_),F=q.useRef();ZH(N);const Y=q.useCallback(H=>{S==null||S({x:H[0],y:H[1],zoom:H[2]}),x||R.setState({transform:H})},[S,x]);return q.useEffect(()=>{if(N.current){F.current=nH({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:G=>R.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=R.getState();L==null||L(G,X),K==null||K(X)},onPanZoom:(G,X)=>{const{onViewportChange:K,onMove:L}=R.getState();L==null||L(G,X),K==null||K(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=R.getState();L==null||L(G,X),K==null||K(X)}});const{x:H,y:z,zoom:V}=F.current.getViewport();return R.setState({panZoom:F.current,transform:[H,z,V],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=F.current)==null||G.destroy()}}},[]),q.useEffect(()=>{var H;(H=F.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:b,userSelectionActive:D,noWheelClassName:C,lib:T,onTransformChange:Y,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:y})},[e,t,n,r,a,l,u,o,B,v,b,D,C,T,Y,j,E,y]),m.jsx("div",{className:"react-flow__renderer",ref:N,style:kh,children:w})}const eF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function tF(){const{userSelectionActive:e,userSelectionRect:t}=tt(eF,At);return e&&t?m.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ep=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function iF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nl.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:_,onPaneMouseMove:v,onPaneMouseLeave:w,children:C}){const b=q.useRef(0),S=Ct(),{userSelectionActive:x,elementsSelectable:y,dragging:E,panBy:R,autoPanSpeed:N}=tt(nF,At),D=y&&(e||x),T=q.useRef(null),j=q.useRef(),B=q.useRef(new Set),F=q.useRef(new Set),Y=q.useRef(!1),H=q.useRef(!1),z=q.useRef({x:0,y:0}),V=q.useRef(!1),G=P=>{if(H.current||Y.current||S.getState().connection.inProgress){H.current=!1,Y.current=!1;return}f==null||f(P),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},X=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}p==null||p(P)},K=d?P=>d(P):void 0,L=P=>{H.current&&(P.stopPropagation(),H.current=!1)},M=P=>{var Ce,rt;const{domNode:ee,transform:ne}=S.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const ge=P.target===T.current;if(!ge&&!!P.target.closest(".nokey")||!e||!(u&&ge||t)||P.button!==0||!P.isPrimary)return;(rt=(Ce=P.target)==null?void 0:Ce.setPointerCapture)==null||rt.call(Ce,P.pointerId),H.current=!1;const{x:be,y:ke}=Qn(P.nativeEvent,j.current),Ee=vl({x:be,y:ke},ne);S.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:be,y:ke}}),ge||(P.stopPropagation(),P.preventDefault())};function O(P,ee){const{userSelectionRect:ne}=S.getState();if(!ne)return;const{transform:ge,nodeLookup:he,edgeLookup:ye,connectionLookup:be,triggerNodeChanges:ke,triggerEdgeChanges:Ee,defaultEdgeOptions:Ce}=S.getState(),rt={x:ne.startX,y:ne.startY},{x:bt,y:Ge}=va(rt,ge),ct={startX:rt.x,startY:rt.y,x:P<bt?P:bt,y:ee<Ge?ee:Ge,width:Math.abs(P-bt),height:Math.abs(ee-Ge)},Pt=B.current,ht=F.current;B.current=new Set(jm(he,ct,ge,n===nl.Partial,!0).map(fe=>fe.id)),F.current=new Set;const Fe=(Ce==null?void 0:Ce.selectable)??!0;for(const fe of B.current){const ie=be.get(fe);if(ie)for(const{edgeId:de}of ie.values()){const Se=ye.get(de);Se&&(Se.selectable??Fe)&&F.current.add(de)}}if(!Xb(Pt,B.current)){const fe=ca(he,B.current,!0);ke(fe)}if(!Xb(ht,F.current)){const fe=ca(ye,F.current);Ee(fe)}S.setState({userSelectionRect:ct,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!a||!j.current)return;const[P,ee]=Lm(z.current,j.current,N);R({x:P,y:ee}).then(ne=>{if(!H.current||!ne){b.current=requestAnimationFrame($);return}const{x:ge,y:he}=z.current;O(ge,he),b.current=requestAnimationFrame($)})}const U=()=>{cancelAnimationFrame(b.current),b.current=0,V.current=!1};q.useEffect(()=>()=>U(),[]);const Q=P=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:ge}=S.getState();if(!j.current||!ee)return;const{x:he,y:ye}=Qn(P.nativeEvent,j.current);z.current={x:he,y:ye};const be=va({x:ee.startX,y:ee.startY},ne);if(!H.current){const ke=t?0:l;if(Math.hypot(he-be.x,ye-be.y)<=ke)return;ge(),o==null||o(P)}H.current=!0,V.current||($(),V.current=!0),O(he,ye)},re=P=>{var ee,ne;if(!D){P.target===T.current&&S.getState().connection.inProgress&&(Y.current=!0);return}P.button===0&&((ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),!x&&P.target===T.current&&S.getState().userSelectionRect&&(G==null||G(P)),S.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(c==null||c(P),S.setState({nodesSelectionActive:B.current.size>0})),U())},ae=P=>{var ee,ne;(ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),U()},Z=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:Ft(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:D?void 0:Ep(G,T),onContextMenu:Ep(X,T),onWheel:Ep(K,T),onPointerEnter:D?void 0:_,onPointerMove:D?Q:v,onPointerUp:re,onPointerCancel:D?ae:void 0,onPointerDownCapture:D?M:void 0,onClickCapture:D?L:void 0,onPointerLeave:w,ref:T,style:kh,children:[C,m.jsx(tF,{})]})}function mg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function M2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=Ct(),[c,f]=q.useState(!1),p=q.useRef();return q.useEffect(()=>{if(!t)return p.current=Uz({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{mg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}}),()=>{var d;(d=p.current)==null||d.destroy(),p.current=void 0}},[t,o,e]),q.useEffect(()=>{t||!e.current||!p.current||p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u})},[n,r,t,l,e,a,u]),c}const rF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function j2(){const e=Ct();return q.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,_=rF(u),v=a?l[0]:5,w=a?l[1]:5,C=n.direction.x*v*n.factor,b=n.direction.y*w*n.factor;for(const[,S]of f){if(!_(S))continue;let x={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+b};a&&(x=_l(x,l));const{position:y,positionAbsolute:E}=QC({nodeId:S.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});S.position=y,S.internals.positionAbsolute=E,d.set(S.id,S)}c(d)},[])}const $m=q.createContext(null),sF=$m.Provider;$m.Consumer;const L2=()=>q.useContext($m),aF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),O2=q.createContext(null);function oF({children:e}){const t=tt(aF,At);return m.jsx(O2.Provider,{value:t,children:e})}function lF(){const e=q.useContext(O2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const cF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return cF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===ma.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function hF({type:e="source",position:t=Me.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,..._},v){var V,G;const w=u||null,C=e==="target",b=Ct(),S=L2(),{connectOnClick:x,noPanClassName:y,rfId:E}=lF(),{connectingFrom:R,connectingTo:N,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:F}=tt(uF(S,w,e),At);S||(G=(V=b.getState()).onError)==null||G.call(V,"010",ei.error010());const Y=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=b.getState(),O={...K,...X};if(M){const{edges:$,setEdges:U,onError:Q}=b.getState();U($H(O,$,{onError:Q}))}L==null||L(O),o==null||o(O)},H=X=>{if(!S)return;const K=o2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=b.getState();gg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:C,handleId:w,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,$;return($=(O=b.getState()).onConnectEnd)==null?void 0:$.call(O,...M)},updateConnection:L.updateConnection,onConnect:Y,isValidConnection:n||((...M)=>{var O,$;return(($=(O=b.getState()).isValidConnection)==null?void 0:$.call(O,...M))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},z=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:$,lib:U,rfId:Q,nodeLookup:re,connection:ae}=b.getState();if(!S||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:S,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const Z=s2(X.target),P=n||$,{connection:ee,isValid:ne}=gg.isValid(X.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:P,flowId:Q,doc:Z,lib:U,nodeLookup:re});ne&&ee&&Y(ee);const ge=structuredClone(ae);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(X,ge),b.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${E}-${S}-${w}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,f,{source:!C,target:C,connectable:r,connectablestart:a,connectableend:l,clickconnecting:D,connectingfrom:R,connectingto:N,valid:F,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:H,onTouchStart:H,onClick:x?z:void 0,ref:v,..._,children:c})}const ba=q.memo(T2(hF));function fF({data:e,isConnectable:t,sourcePosition:n=Me.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(ba,{type:"source",position:n,isConnectable:t})]})}function dF({data:e,isConnectable:t,targetPosition:n=Me.Top,sourcePosition:r=Me.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(ba,{type:"source",position:r,isConnectable:t})]})}function pF(){return null}function gF({data:e,isConnectable:t,targetPosition:n=Me.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Hu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},kS={input:fF,default:dF,output:gF,group:pF};function mF(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const _F=e=>{const{width:t,height:n,x:r,y:a}=ml(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function vF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ct(),{width:a,height:l,transformString:u,userSelectionActive:o}=tt(_F,At),c=j2(),f=q.useRef(null);q.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(M2({nodeRef:f,disabled:!p}),!p)return null;const d=e?v=>{const w=r.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,_=v=>{Object.prototype.hasOwnProperty.call(Hu,v.key)&&(v.preventDefault(),c({direction:Hu[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Ft(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:_,style:{width:a,height:l}})})}const AS=typeof window<"u"?window:void 0,yF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function B2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:F,minZoom:Y,maxZoom:H,preventScrolling:z,onSelectionContextMenu:V,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:$}=tt(yF,At),U=sl(f,{target:AS}),Q=sl(C,{target:AS}),re=Q||T,ae=Q||E,Z=p&&re!==!0,P=U||$||Z;return KH({deleteKeyCode:c,multiSelectionKeyCode:w}),m.jsx(JH,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:!U&&re,defaultViewport:B,translateExtent:F,minZoom:Y,maxZoom:H,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:G,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:m.jsxs(iF,{onSelectionStart:_,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!P,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&m.jsx(vF,{onSelectionContextMenu:V,noPanClassName:X,disableKeyboardA11y:K})]})})}B2.displayName="FlowRenderer";const bF=q.memo(B2),SF=e=>t=>e?jm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function xF(e){return tt(q.useCallback(SF(e),[e]),At)}const wF=e=>e.updateNodeInternals;function CF(){const e=tt(wF),[t]=q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return q.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function EF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Ct(),l=q.useRef(null),u=q.useRef(null),o=q.useRef(e.sourcePosition),c=q.useRef(e.targetPosition),f=q.useRef(t),p=n&&!!e.internals.handleBounds;return q.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),q.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),q.useEffect(()=>{if(l.current){const d=f.current!==t,_=o.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||_||v)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function kF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:_,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:b,nodeClickDistance:S,onError:x}){const{node:y,internals:E,isParent:R}=tt(P=>{const ee=P.nodeLookup.get(e),ne=P.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},At);let N=y.type||"default",D=(b==null?void 0:b[N])||kS[N];D===void 0&&(x==null||x("003",ei.error003(N)),N="default",D=(b==null?void 0:b.default)||kS.default);const T=!!(y.draggable||o&&typeof y.draggable>"u"),j=!!(y.selectable||c&&typeof y.selectable>"u"),B=!!(y.connectable||f&&typeof y.connectable>"u"),F=!!(y.focusable||p&&typeof y.focusable>"u"),Y=Ct(),H=i2(y),z=EF({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),V=M2({nodeRef:z,disabled:y.hidden||!T,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:S}),G=j2();if(y.hidden)return null;const X=gi(y),K=mF(y),L=j||T||t||n||r||a,M=n?P=>n(P,{...E.userNode}):void 0,O=r?P=>r(P,{...E.userNode}):void 0,$=a?P=>a(P,{...E.userNode}):void 0,U=l?P=>l(P,{...E.userNode}):void 0,Q=u?P=>u(P,{...E.userNode}):void 0,re=P=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=Y.getState();j&&(!ee||!T||ne>0)&&mg({id:e,store:Y,nodeRef:z}),t&&t(P,{...E.userNode})},ae=P=>{if(!(a2(P.nativeEvent)||w)){if(YC.includes(P.key)&&j){const ee=P.key==="Escape";mg({id:e,store:Y,unselect:ee,nodeRef:z})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(Hu,P.key)){P.preventDefault();const{ariaLabelConfig:ee}=Y.getState();Y.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:P.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),G({direction:Hu[P.key],factor:P.shiftKey?4:1})}}},Z=()=>{var be;if(w||!((be=z.current)!=null&&be.matches(":focus-visible")))return;const{transform:P,width:ee,height:ne,autoPanOnNodeFocus:ge,setCenter:he}=Y.getState();if(!ge)return;jm(new Map([[e,y]]),{x:0,y:0,width:ee,height:ne},P,!0).length>0||he(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:P[2]})};return m.jsx("div",{className:Ft(["react-flow__node",`react-flow__node-${N}`,{[v]:T},y.className,{selected:y.selected,selectable:j,parent:R,draggable:T,dragging:V}]),ref:z,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:H?"visible":"hidden",...y.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:re,onDoubleClick:Q,onKeyDown:F?ae:void 0,tabIndex:F?0:void 0,onFocus:F?Z:void 0,role:y.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${E2}-${C}`,"aria-label":y.ariaLabel,...y.domAttributes,children:m.jsx(sF,{value:e,children:m.jsx(D,{id:e,data:y.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:j,draggable:T,deletable:y.deletable??!0,isConnectable:B,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:V,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...X})})})}var AF=q.memo(kF);const NF=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function I2(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:a}=tt(NF,At),l=xF(e.onlyRenderVisibleElements),u=CF();return m.jsx("div",{className:"react-flow__nodes",style:kh,children:l.map(o=>m.jsx(AF,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}I2.displayName="NodeRenderer";const TF=q.memo(I2);function RF(e){return tt(q.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&wz({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),At)}const DF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},MF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},NS={[Bu.Arrow]:DF,[Bu.ArrowClosed]:MF};function jF(e){const t=Ct();return q.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(NS,e)?NS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const LF=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=jF(t);return c?m.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:m.jsx(c,{color:n,strokeWidth:u})}):null},z2=({defaultColor:e,rfId:t})=>{const n=tt(l=>l.edges),r=tt(l=>l.defaultEdgeOptions),a=q.useMemo(()=>Dz(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:a.map(l=>m.jsx(LF,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};z2.displayName="MarkerDefinitions";var OF=q.memo(z2);function H2({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,_]=q.useState({x:1,y:0,width:0,height:0}),v=Ft(["react-flow__edge-textwrapper",f]),w=q.useRef(null);return q.useEffect(()=>{if(w.current){const C=w.current.getBBox();_({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?m.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...p,children:[a&&m.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),m.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}H2.displayName="EdgeText";const BF=q.memo(H2);function Ah({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...p,d:e,fill:"none",className:Ft(["react-flow__edge-path",p.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?m.jsx(BF,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function TS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Me.Left||e===Me.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function F2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top}){const[u,o]=TS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=TS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,_,v]=l2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,_,v]}function P2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})=>{const[x,y,E]=F2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),R=e.isInternal?void 0:t;return m.jsx(Ah,{id:R,path:x,labelX:y,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})})}const IF=P2({isInternal:!1}),U2=P2({isInternal:!0});IF.displayName="SimpleBezierEdge";U2.displayName="SimpleBezierEdgeInternal";function $2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,sourcePosition:v=Me.Bottom,targetPosition:w=Me.Top,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=fg({sourceX:n,sourceY:r,sourcePosition:v,targetX:a,targetY:l,targetPosition:w,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:C,markerStart:b,interactionWidth:x})})}const G2=$2({isInternal:!1}),q2=$2({isInternal:!0});G2.displayName="SmoothStepEdge";q2.displayName="SmoothStepEdgeInternal";function V2(e){return q.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return m.jsx(G2,{...n,id:r,pathOptions:q.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const zF=V2({isInternal:!1}),Y2=V2({isInternal:!0});zF.displayName="StepEdge";Y2.displayName="StepEdgeInternal";function W2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[b,S,x]=h2({sourceX:n,sourceY:r,targetX:a,targetY:l}),y=e.isInternal?void 0:t;return m.jsx(Ah,{id:y,path:b,labelX:S,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})})}const HF=W2({isInternal:!1}),X2=W2({isInternal:!0});HF.displayName="StraightEdge";X2.displayName="StraightEdgeInternal";function K2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=Me.Bottom,targetPosition:o=Me.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=c2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:S==null?void 0:S.curvature}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:x})})}const FF=K2({isInternal:!1}),Z2=K2({isInternal:!0});FF.displayName="BezierEdge";Z2.displayName="BezierEdgeInternal";const RS={default:Z2,straight:X2,step:Y2,smoothstep:q2,simplebezier:U2},DS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},PF=(e,t,n)=>n===Me.Left?e-t:n===Me.Right?e+t:e,UF=(e,t,n)=>n===Me.Top?e-t:n===Me.Bottom?e+t:e,MS="react-flow__edgeupdater";function jS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return m.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Ft([MS,`${MS}-${o}`]),cx:PF(t,r,e),cy:UF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function $F({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:_,setUpdateHover:v}){const w=Ct(),C=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:D,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:F,cancelConnection:Y,nodeLookup:H,rfId:z,panBy:V,updateConnection:G}=w.getState(),X=R.type==="target",K=(O,$)=>{_(!1),d==null||d(O,n,R.type,$)},L=O=>f==null?void 0:f(n,O),M=(O,$)=>{_(!0),p==null||p(E,n,R.type),F==null||F(O,$)};gg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:D,handleId:R.id,nodeId:R.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:R.type,lib:B,flowId:z,cancelConnection:Y,panBy:V,isValidConnection:(...O)=>{var $,U;return((U=($=w.getState()).isValidConnection)==null?void 0:U.call($,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var $,U;return(U=($=w.getState()).onConnectEnd)==null?void 0:U.call($,...O)},onReconnectEnd:K,updateConnection:G,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},b=E=>C(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=E=>C(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>v(!0),y=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(jS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&m.jsx(jS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function GF({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:b,onError:S,disableKeyboardA11y:x}){let y=tt(he=>he.edgeLookup.get(e));const E=tt(he=>he.defaultEdgeOptions);y=E?{...E,...y}:y;let R=y.type||"default",N=(C==null?void 0:C[R])||RS[R];N===void 0&&(S==null||S("011",ei.error011(R)),R="default",N=(C==null?void 0:C.default)||RS.default);const D=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),j=!!(y.selectable||r&&typeof y.selectable>"u"),B=q.useRef(null),[F,Y]=q.useState(!1),[H,z]=q.useState(!1),V=Ct(),{zIndex:G=y.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$}=tt(q.useCallback(he=>{const ye=he.nodeLookup.get(y.source),be=he.nodeLookup.get(y.target);if(!ye||!be)return DS;const ke=Rz({id:e,sourceNode:ye,targetNode:be,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:he.connectionMode,onError:S}),Ee=xz({selected:y.selected,zIndex:y.zIndex,sourceNode:ye,targetNode:be,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode});return{...ke||DS,zIndex:Ee}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),At),U=q.useMemo(()=>y.markerStart?`url('#${dg(y.markerStart,w)}')`:void 0,[y.markerStart,w]),Q=q.useMemo(()=>y.markerEnd?`url('#${dg(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||X===null||K===null||L===null||M===null)return null;const re=he=>{var Ee;const{addSelectedEdges:ye,unselectNodesAndEdges:be,multiSelectionActive:ke}=V.getState();j&&(V.setState({nodesSelectionActive:!1}),y.selected&&ke?(be({nodes:[],edges:[y]}),(Ee=B.current)==null||Ee.blur()):ye([e])),a&&a(he,y)},ae=l?he=>{l(he,{...y})}:void 0,Z=u?he=>{u(he,{...y})}:void 0,P=o?he=>{o(he,{...y})}:void 0,ee=c?he=>{c(he,{...y})}:void 0,ne=f?he=>{f(he,{...y})}:void 0,ge=he=>{var ye;if(!x&&YC.includes(he.key)&&j){const{unselectNodesAndEdges:be,addSelectedEdges:ke}=V.getState();he.key==="Escape"?((ye=B.current)==null||ye.blur(),be({edges:[y]})):ke([e])}};return m.jsx("svg",{style:{zIndex:G},children:m.jsxs("g",{className:Ft(["react-flow__edge",`react-flow__edge-${R}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!j&&!a,updating:F,selectable:j}]),onClick:re,onDoubleClick:ae,onContextMenu:Z,onMouseEnter:P,onMouseMove:ee,onMouseLeave:ne,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,role:y.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":D?`${k2}-${w}`:void 0,ref:B,...y.domAttributes,children:[!H&&m.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:j,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Q,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&m.jsx($F,{edge:y,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,setUpdateHover:Y,setReconnecting:z})]})})}var qF=q.memo(GF);const VF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Q2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,onError:y}=tt(VF,At),E=RF(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(OF,{defaultColor:e,rfId:n}),E.map(R=>m.jsx(qF,{id:R,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:C},R))]})}Q2.displayName="EdgeRenderer";const YF=q.memo(Q2),LS=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function WF({children:e}){const t=Ct(),n=q.useRef(null),[r]=q.useState(()=>t.getState().transform);return R2(()=>{let a=null;const l=()=>{const u=t.getState().transform;a&&u[0]===a[0]&&u[1]===a[1]&&u[2]===a[2]||(a=u,n.current&&(n.current.style.transform=LS(u)))};return l(),t.subscribe(l)},[t]),m.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:LS(r)},children:e})}function XF(e){const t=Um(),n=q.useRef(!1);q.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const KF=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ZF(e){const t=tt(KF),n=Ct();return q.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function QF(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function JF(e){return QF}function eP(e){const t=JF();return tt(t,At)}const tP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=tt(tP,At);return!(l&&a&&c)?null:m.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:Ft(["react-flow__connection",KC(o)]),children:m.jsx(J2,{style:t,type:n,CustomComponent:r,isValid:o})})})}const J2=({style:e,type:t=Er.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:_,pointer:v}=eP();if(!a)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:_,connectionStatus:KC(r),toNode:p,toHandle:d,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:_};switch(t){case Er.Bezier:[w]=c2(C);break;case Er.SimpleBezier:[w]=F2(C);break;case Er.Step:[w]=fg({...C,borderRadius:0});break;case Er.SmoothStep:[w]=fg(C);break;default:[w]=h2(C)}return m.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};J2.displayName="ConnectionLine";const iP={};function OS(e=iP){q.useRef(e),Ct(),q.useEffect(()=>{},[e])}function rP(){Ct(),q.useRef(!1),q.useEffect(()=>{},[])}function eE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:_,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:F,translateExtent:Y,minZoom:H,maxZoom:z,preventScrolling:V,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:ge,nodeClickDistance:he,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,viewport:de,onViewportChange:Se,nodesDraggable:Ae}){return OS(e),OS(t),rP(),XF(n),ZF(de),m.jsx(bF,{onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:$,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:U,autoPanOnSelection:Q,defaultViewport:F,translateExtent:Y,minZoom:H,maxZoom:z,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,onViewportChange:Se,isControlledViewport:!!de,children:m.jsxs(WF,{children:[m.jsx(YF,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,defaultMarkerColor:G,noPanClassName:ht,disableKeyboardA11y:Fe,rfId:ie}),m.jsx(nP,{style:C,type:w,component:b,containerStyle:S}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(TF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:he,onlyRenderVisibleElements:j,noPanClassName:ht,noDragClassName:ct,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,nodesDraggable:Ae}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}eE.displayName="GraphView";const sP=q.memo(eE),aP=n2(),BS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:_="basic"}={})=>{const v=new Map,w=new Map,C=new Map,b=new Map,S=r??t??[],x=n??e??[],y=p??[0,0],E=d??tl;p2(C,b,S);const{nodesInitialized:R}=pg(x,v,w,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let N=[0,0,1];if(u&&a&&l){const D=ml(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:T,y:j,zoom:B}=Om(D,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:R,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:b,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:tl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ma.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...XC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:aP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:WC,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},oP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_})=>yH((v,w)=>{async function C(){const{nodeLookup:b,panZoom:S,fitViewOptions:x,fitViewResolver:y,width:E,height:R,minZoom:N,maxZoom:D}=w();S&&(await gz({nodes:b,width:E,height:R,panZoom:S,minZoom:N,maxZoom:D},x),y==null||y.resolve(!0),v({fitViewResolver:null}))}return{...BS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:_}),setNodes:b=>{const{nodeLookup:S,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:N,nodesSelectionActive:D}=w(),{nodesInitialized:T,hasSelectedNodes:j}=pg(b,S,x,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=D&&j;R&&T?(C(),v({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):v({nodes:b,nodesInitialized:T,nodesSelectionActive:B})},setEdges:b=>{const{connectionLookup:S,edgeLookup:x}=w();p2(S,x,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:x}=w();x(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:x}=w();x(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:x,parentLookup:y,domNode:E,nodeOrigin:R,nodeExtent:N,debug:D,fitViewQueued:T,zIndexMode:j}=w(),{changes:B,updatedInternals:F}=zz(b,x,y,E,R,N,j);F&&(Lz(x,y,{nodeOrigin:R,nodeExtent:N,zIndexMode:j}),T?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(D&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(b,S=!1)=>{const x=[];let y=[];const{nodeLookup:E,triggerNodeChanges:R,connection:N,updateConnection:D,onNodesChangeMiddlewareMap:T}=w();for(const[j,B]of b){const F=E.get(j),Y=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(B!=null&&B.position)),H={id:j,type:"position",position:Y?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(F&&N.inProgress&&N.fromNode.id===F.id){const z=ls(F,N.fromHandle,Me.Left,!0);D({...N,from:z})}Y&&F.parentId&&x.push({id:j,parentId:F.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),y.push(H)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=w(),F=Pm(x,E,j,B);y.push(...F)}for(const j of T.values())y=j(y);R(y)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:x,nodes:y,hasDefaultNodes:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=FH(b,y);x(N)}R&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:x,edges:y,hasDefaultEdges:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=PH(b,y);x(N)}R&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));E(N);return}E(ca(y,new Set([...b]),!0)),R(ca(x))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));R(N);return}R(ca(x,new Set([...b]))),E(ca(y,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:x,nodes:y,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:N}=w(),D=b||y,T=S||x,j=[];for(const F of D){if(!F.selected)continue;const Y=E.get(F.id);Y&&(Y.selected=!1),j.push(Zr(F.id,!1))}const B=[];for(const F of T)F.selected&&B.push(Zr(F.id,!1));R(j),N(B)},setMinZoom:b=>{const{panZoom:S,maxZoom:x}=w();S==null||S.setScaleExtent([b,x]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:x}=w();S==null||S.setScaleExtent([x,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=w().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:E}=w();if(!E)return;const R=S.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]),N=b.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]);x(R),y(N)},setNodeExtent:b=>{const{nodes:S,nodeLookup:x,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:N,zIndexMode:D}=w();b[0][0]===N[0][0]&&b[0][1]===N[0][1]&&b[1][0]===N[1][0]&&b[1][1]===N[1][1]||(pg(S,x,y,{nodeOrigin:E,nodeExtent:b,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:D}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:x,height:y,panZoom:E,translateExtent:R}=w();return Hz({delta:b,panZoom:E,transform:S,translateExtent:R,width:x,height:y})},setCenter:async(b,S,x)=>{const{width:y,height:E,maxZoom:R,panZoom:N}=w();if(!N)return!1;const D=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:R;return await N.setViewport({x:y/2-b*D,y:E/2-S*D,zoom:D},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{v({connection:{...XC}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...BS()})}},Object.is);function lP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_,children:v}){const[w]=q.useState(()=>oP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:_}));return m.jsx(bH,{value:w,children:m.jsx(VH,{children:m.jsx(oF,{children:v})})})}function cP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v}){return q.useContext(Ch)?m.jsx(m.Fragment,{children:e}):m.jsx(lP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v,children:e})}const uP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:_,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:F,onDelete:Y,onSelectionChange:H,onSelectionDragStart:z,onSelectionDrag:V,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:$=Er.Bezier,connectionLineStyle:U,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:ae="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:P=!1,selectionMode:ee=nl.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ge=rl()?"Meta":"Control",zoomActivationKeyCode:he=rl()?"Meta":"Control",snapToGrid:ye,snapGrid:be,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ee,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,nodeOrigin:ct=A2,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe=!0,defaultViewport:fe=jH,minZoom:ie=.5,maxZoom:de=2,translateExtent:Se=tl,preventScrolling:Ae=!0,nodeExtent:De,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:Ie=!0,zoomOnPinch:Nt=!0,panOnScroll:Et=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:st=ts.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:Ut=!0,onPaneClick:ps,onPaneMouseEnter:mi,onPaneMouseMove:_i,onPaneMouseLeave:vi,onPaneScroll:On,onPaneContextMenu:yi,paneClickDistance:ni=1,nodeClickDistance:oe=0,children:we,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl=10,onNodesChange:bl,onEdgesChange:ii,noDragClassName:$t="nodrag",noWheelClassName:Qt="nowheel",noPanClassName:Si="nopan",fitView:ms,fitViewOptions:Sl,connectOnClick:Nh,attributionPosition:xl,proOptions:Rr,defaultEdgeOptions:Na,elevateNodesOnSelect:Yi=!0,elevateEdgesOnSelect:Wi=!1,disableKeyboardA11y:Xi=!1,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanOnSelection:wl=!0,autoPanSpeed:Cl,connectionRadius:xi,isValidConnection:Zi,onError:Th,style:El,id:Ta,nodeDragThreshold:Rh,connectionDragThreshold:_s,viewport:vs,onViewportChange:qn,width:an,height:kl,colorMode:Dh="light",debug:Ra,onScroll:Dr,ariaLabelConfig:ys,zIndexMode:Al="basic",...on},Da){const bs=Ta||"1",Ma=IH(Dh),Qi=q.useCallback(ja=>{ja.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(ja)},[Dr]);return m.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:Qi,style:{...El,...uP},ref:Da,className:Ft(["react-flow",a,Ma]),id:Ta,role:"application",children:m.jsxs(cP,{nodes:e,edges:t,width:an,height:kl,fitView:ms,fitViewOptions:Sl,minZoom:ie,maxZoom:de,nodeOrigin:ct,nodeExtent:De,zIndexMode:Al,children:[m.jsx(BH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe,elevateNodesOnSelect:Yi,elevateEdgesOnSelect:Wi,minZoom:ie,maxZoom:de,nodeExtent:De,onNodesChange:bl,onEdgesChange:ii,snapToGrid:ye,snapGrid:be,connectionMode:O,translateExtent:Se,connectOnClick:Nh,defaultEdgeOptions:Na,fitView:ms,fitViewOptions:Sl,onNodesDelete:B,onEdgesDelete:F,onDelete:Y,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:V,onSelectionDragStart:z,onSelectionDragStop:G,onMove:p,onMoveStart:d,onMoveEnd:_,noPanClassName:Si,nodeOrigin:ct,rfId:bs,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanSpeed:Cl,onError:Th,connectionRadius:xi,isValidConnection:Zi,selectNodesOnDrag:Ee,nodeDragThreshold:Rh,connectionDragThreshold:_s,onBeforeDelete:M,debug:Ra,ariaLabelConfig:ys,zIndexMode:Al}),m.jsx(sP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:P,selectionMode:ee,deleteKeyCode:ae,multiSelectionKeyCode:ge,panActivationKeyCode:ne,zoomActivationKeyCode:he,onlyRenderVisibleElements:ke,defaultViewport:fe,translateExtent:Se,minZoom:ie,maxZoom:de,preventScrolling:Ae,zoomOnScroll:Ie,zoomOnPinch:Nt,zoomOnDoubleClick:Ln,panOnScroll:Et,panOnScrollSpeed:qt,panOnScrollMode:st,panOnDrag:Ut,autoPanOnSelection:wl,onPaneClick:ps,onPaneMouseEnter:mi,onPaneMouseMove:_i,onPaneMouseLeave:vi,onPaneScroll:On,onPaneContextMenu:yi,paneClickDistance:ni,nodeClickDistance:oe,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl,defaultMarkerColor:Ve,noDragClassName:$t,noWheelClassName:Qt,noPanClassName:Si,rfId:bs,disableKeyboardA11y:Xi,nodeExtent:De,viewport:vs,onViewportChange:qn,nodesDraggable:Ce}),m.jsx(MH,{onSelectionChange:H}),we,m.jsx(AH,{proOptions:Rr,position:xl}),m.jsx(kH,{rfId:bs,disableKeyboardA11y:Xi})]})})}var fP=T2(hP);function dP({dimensions:e,lineWidth:t,variant:n,className:r}){return m.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ft(["react-flow__background-pattern",n,r])})}function pP({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Ft(["react-flow__background-pattern","dots",t])})}var Ui;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ui||(Ui={}));const gP={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},mP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tE({id:e,variant:t=Ui.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=q.useRef(null),{transform:_,patternId:v}=tt(mP,At),w=r||gP[t],C=t===Ui.Dots,b=t===Ui.Cross,S=Array.isArray(n)?n:[n,n],x=[S[0]*_[2]||1,S[1]*_[2]||1],y=w*_[2],E=Array.isArray(l)?l:[l,l],R=b?[y,y]:x,N=[E[0]*_[2]||1+R[0]/2,E[1]*_[2]||1+R[1]/2],D=`${v}${e||""}`;return m.jsxs("svg",{className:Ft(["react-flow__background",f]),style:{...c,...kh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[m.jsx("pattern",{id:D,x:_[0]%x[0],y:_[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:C?m.jsx(pP,{radius:y/2,className:p}):m.jsx(dP,{dimensions:R,lineWidth:a,variant:t,className:p})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}tE.displayName="Background";const _P=q.memo(tE);function vP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function SP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function xP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function su({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Ft(["react-flow__controls-button",t]),...n,children:e})}const wP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:_="vertical","aria-label":v}){const w=Ct(),{isInteractive:C,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:x}=tt(wP,At),{zoomIn:y,zoomOut:E,fitView:R}=Um(),N=()=>{y(),l==null||l()},D=()=>{E(),u==null||u()},T=()=>{R(a),o==null||o()},j=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),c==null||c(!C)},B=_==="horizontal"?"horizontal":"vertical";return m.jsxs(Eh,{className:Ft(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??x["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(su,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:S,children:m.jsx(vP,{})}),m.jsx(su,{onClick:D,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:b,children:m.jsx(yP,{})})]}),n&&m.jsx(su,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:m.jsx(bP,{})}),r&&m.jsx(su,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:C?m.jsx(xP,{}):m.jsx(SP,{})}),p]})}nE.displayName="Controls";q.memo(nE);function CP({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:_,onClick:v}){const{background:w,backgroundColor:C}=l||{},b=u||w||C;return m.jsx("rect",{className:Ft(["react-flow__minimap-node",{selected:_},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:b,stroke:o,strokeWidth:c},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const EP=q.memo(CP),kP=e=>e.nodes.map(t=>t.id),kp=e=>e instanceof Function?e:()=>e;function AP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=EP,onClick:u}){const o=tt(kP,At),c=kp(t),f=kp(e),p=kp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:o.map(_=>m.jsx(TP,{id:_,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},_))})}function NP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:_,height:v}=tt(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const b=C.internals.userNode,{x:S,y:x}=C.internals.positionAbsolute,{width:y,height:E}=gi(b);return{node:b,x:S,y:x,width:y,height:E}},At);return!f||f.hidden||!i2(f)?null:m.jsx(o,{x:p,y:d,width:_,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const TP=q.memo(NP);var RP=q.memo(AP);const DP=200,MP=150,jP=e=>!e.hidden,LP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?e2(ml(e.nodeLookup,{filter:jP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},IS=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,OP=(e,t)=>IS(e.viewBB,t.viewBB)&&IS(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,BP="react-flow__minimap-desc";function iE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:_="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:b=!1,ariaLabel:S,inversePan:x,zoomStep:y=1,offsetScale:E=5}){const R=Ct(),N=q.useRef(null),{boundingRect:D,viewBB:T,rfId:j,panZoom:B,translateExtent:F,flowWidth:Y,flowHeight:H,ariaLabelConfig:z}=tt(LP,OP),V=(e==null?void 0:e.width)??DP,G=(e==null?void 0:e.height)??MP,X=D.width/V,K=D.height/G,L=Math.max(X,K),M=L*V,O=L*G,$=E*L,U=D.x-(M-D.width)/2-$,Q=D.y-(O-D.height)/2-$,re=M+$*2,ae=O+$*2,Z=`${BP}-${j}`,P=q.useRef(0),ee=q.useRef();P.current=L,q.useEffect(()=>{if(N.current&&B)return ee.current=Wz({domNode:N.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>P.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),q.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:F,width:Y,height:H,inversePan:x,pannable:C,zoomStep:y,zoomable:b})},[C,b,x,y,F,Y,H]);const ne=v?ye=>{var Ee;const[be,ke]=((Ee=ee.current)==null?void 0:Ee.pointer(ye))||[0,0];v(ye,{x:be,y:ke})}:void 0,ge=w?q.useCallback((ye,be)=>{const ke=R.getState().nodeLookup.get(be).internals.userNode;w(ye,ke)},[]):void 0,he=S??z["minimap.ariaLabel"];return m.jsx(Eh,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Ft(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:V,height:G,viewBox:`${U} ${Q} ${re} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[he&&m.jsx("title",{id:Z,children:he}),m.jsx(RP,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${Q-$}h${re+$*2}v${ae+$*2}h${-re-$*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}iE.displayName="MiniMap";q.memo(iE);const IP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,zP={[ya.Line]:"right",[ya.Handle]:"bottom-right"};function HP({nodeId:e,position:t,variant:n=ya.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:_,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:b,onResizeEnd:S}){const x=L2(),y=typeof e=="string"?e:x,E=Ct(),R=q.useRef(null),N=n===ya.Handle,D=tt(q.useCallback(IP(N&&v),[N,v]),At),T=q.useRef(null),j=t??zP[n];q.useEffect(()=>{if(!(!R.current||!y))return T.current||(T.current=oH({domNode:R.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:F,transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V,domNode:G}=E.getState();return{nodeLookup:F,transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V,paneDomNode:G}},onChange:(F,Y)=>{const{triggerNodeChanges:H,nodeLookup:z,parentLookup:V,nodeOrigin:G}=E.getState(),X=[],K={x:F.x,y:F.y},L=z.get(y);if(L&&L.expandParent&&L.parentId){const M=L.origin??G,O=F.width??L.measured.width??0,$=F.height??L.measured.height??0,U={id:L.id,parentId:L.parentId,rect:{width:O,height:$,...r2({x:F.x??L.position.x,y:F.y??L.position.y},{width:O,height:$},L.parentId,z,M)}},Q=Pm([U],z,V,G);X.push(...Q),K.x=F.x?Math.max(M[0]*O,F.x):void 0,K.y=F.y?Math.max(M[1]*$,F.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:y,type:"position",position:{...K}};X.push(M)}if(F.width!==void 0&&F.height!==void 0){const O={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};X.push(O)}for(const M of Y){const O={...M,type:"position"};X.push(O)}H(X)},onEnd:({width:F,height:Y})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:F,height:Y}};E.getState().triggerNodeChanges([H])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:_,onResizeStart:C,onResize:b,onResizeEnd:S,shouldResize:w}),()=>{var F;(F=T.current)==null||F.destroy()}},[j,o,c,f,p,d,C,b,S,w]);const B=j.split("-");return m.jsx("div",{className:Ft(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...a,scale:D,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}q.memo(HP);const _g=264,FP=132,yu=44,PP=72;function UP(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function bu(e){if(e.children.length===0)return _g;const t=e.children.reduce((n,r)=>n+bu(r),0)+yu*(e.children.length-1);return Math.max(_g,t)}function $P(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const GP=q.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",_=l?"BASELINE":d?"RUNNING":"EXPERIMENT",v=a.slice(-8);return m.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[m.jsx(ba,{type:"target",position:Me.Top}),m.jsxs("div",{className:"node-eyebrow",children:[m.jsx("span",{children:_}),m.jsx(Vo,{status:p??"idle"})]}),m.jsx("div",{className:"node-head",children:m.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&m.jsx("div",{className:"node-title",children:n.title||n.description}),m.jsxs("div",{className:"node-meta",children:[m.jsx("span",{children:"RUNS"}),v.length>0?m.jsx("span",{className:"run-squares",children:v.map(w=>m.jsx("span",{className:`run-sq ${$P(w.status)}`,title:w.status},w.id))}):m.jsx("span",{children:"no runs"}),m.jsx("span",{style:{flex:1}}),r&&m.jsx("span",{children:Sa(r.createdAt)})]}),m.jsxs("div",{className:"node-actions",onClick:w=>w.stopPropagation(),children:[m.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[m.jsx($u,{size:13}),"Changes"]}),a.length>0&&m.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[m.jsx(XS,{size:13}),"Logs"]}),m.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[m.jsx(VS,{size:13}),"Code"]}),m.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:xg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:m.jsx(pm,{size:13})})]}),m.jsx(ba,{type:"source",position:Me.Bottom})]})}),qP={exp:GP},VP={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function YP({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=q.useMemo(()=>{const o=new Map;for(const v of t){const w=o.get(v.experimentId);w?w.push(v):o.set(v.experimentId,[v])}for(const v of o.values())v.sort((w,C)=>w.createdAt-C.createdAt);const c=[],f=[],p=UP(e);function d(v,w,C){const b=o.get(v.exp.id)??[];if(c.push({id:v.exp.id,type:"exp",position:{x:w-_g/2,y:C},data:{exp:v.exp,latestRun:b[b.length-1]??null,runs:b,isBaseline:!v.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),v.children.length===0)return;const S=v.children.reduce((y,E)=>y+bu(E),0)+yu*(v.children.length-1);let x=w-S/2;for(const y of v.children){const E=bu(y);f.push({id:`e-${v.exp.id}-${y.exp.id}`,source:v.exp.id,target:y.exp.id}),d(y,x+E/2,C+FP+PP),x+=E+yu}}let _=0;for(const v of p){const w=bu(v);d(v,_+w/2,0),_+=w+yu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?m.jsxs("div",{className:"empty-state empty-state-cta",children:[m.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),m.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):m.jsx(fP,{nodes:l,edges:u,nodeTypes:qP,defaultEdgeOptions:VP,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:m.jsx(_P,{variant:Ui.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const au=(e,t)=>e.id===t.id&&e.view===t.view,ou=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,zS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function WP(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const HS="orx:onboarded",rE="orx:panel-width",Fu=360,XP=10,KP=232,ZP=380,QP=KP+56,JP=80;function vg(){return Math.max(Fu,window.innerWidth-QP-ZP)}function eU(){const e=vg();try{const t=Number(localStorage.getItem(rE));if(Number.isFinite(t)&&t>=Fu)return Math.min(t,e)}catch{}return Math.max(Fu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function lu(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function tU(){var ht,Fe;const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState([]),[u,o]=q.useState([]),[c,f]=q.useState(null),[p,d]=q.useState("tree"),[_,v]=q.useState(null),[w,C]=q.useState("experiments"),[b,S]=q.useState([]),[x,y]=q.useState([]),[E,R]=q.useState([]),[N,D]=q.useState(null),[T,j]=q.useState(!0),[B,F]=q.useState(!1),[Y,H]=q.useState(eU),[z,V]=q.useState(!0),[G,X]=q.useState(!1),[K,L]=q.useState("chat"),[M,O]=q.useState(()=>{try{return localStorage.getItem(HS)==="1"}catch{return!0}}),$=q.useRef(n);$.current=n,q.useEffect(()=>{DN().then(fe=>{t(fe),r(ie=>{var de;return ie??((de=fe[0])==null?void 0:de.id)??null})}).catch(()=>t([]))},[]),q.useEffect(()=>{const fe=()=>H(ie=>Math.min(ie,vg()));return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[]),q.useEffect(()=>{n&&(ON(n).catch(()=>{}),l([]),o([]),f(null),v(null),S([]),y([]),R([]),D(null),C("experiments"),IN(n).then(l).catch(()=>{}),zN(n).then(o).catch(()=>{}),Iy(n).then(f).catch(()=>{}))},[n]);const U=q.useCallback(()=>{const fe=$.current;fe&&Iy(fe).then(f).catch(()=>{})},[]);DT({onRun:fe=>{fe.projectId===$.current&&o(ie=>lu(ie,fe))},onExperiment:fe=>{fe.projectId===$.current&&l(ie=>lu(ie,fe))},onProject:fe=>{t(ie=>ie?lu(ie,fe):[fe])},onFiles:fe=>{fe===$.current&&U()}});const Q=q.useCallback((fe,ie="changes")=>{const de={id:fe,view:ie};S(Se=>Se.some(Ae=>au(Ae,de))?Se:[...Se,de]),C(de),j(!0)},[]),re=q.useCallback(fe=>{const ie=b.findIndex(Se=>au(Se,fe));if(ie===-1)return;const de=b.filter((Se,Ae)=>Ae!==ie);S(de),typeof w=="object"&&"view"in w&&au(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[b,w]),ae=q.useCallback((fe,ie,de)=>{var De;const Se=(De=e==null?void 0:e.find(Ve=>Ve.id===n))==null?void 0:De.repoPath,Ae=WP(fe,Se,ie);Ae&&(de&&(Ae.ref=de),y(Ve=>Ve.some(Ie=>ou(Ie,Ae))?Ve:[...Ve,Ae]),C(Ae),j(!0))},[e,n]),Z=q.useCallback(fe=>{const ie=x.findIndex(Se=>ou(Se,fe));if(ie===-1)return;const de=x.filter((Se,Ae)=>Ae!==ie);y(de),typeof w=="object"&&"path"in w&&ou(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[x,w]),P=q.useCallback((fe,ie,de)=>{const Se={kind:"plan",sessionId:ie,promptId:de,plan:fe};R(Ae=>{const De=Ae.findIndex(Ie=>Ie.promptId===de);if(De===-1)return[...Ae,Se];const Ve=Ae.slice();return Ve[De]=Se,Ve}),C(Se),j(!0)},[]),ee=q.useCallback(fe=>{const ie=E.findIndex(Se=>Se.promptId===fe.promptId);if(ie===-1)return;const de=E.filter((Se,Ae)=>Ae!==ie);R(de),typeof w=="object"&&"kind"in w&&w.promptId===fe.promptId&&C(de[Math.min(ie,de.length-1)]??"experiments")},[E,w]),ne=q.useCallback(fe=>{const ie={code:!0,sel:fe,toggled:new Set};D(de=>de?{...de,sel:fe}:ie),C(ie),j(!0)},[]),ge=q.useCallback(fe=>{D(ie=>ie&&{...ie,...fe})},[]),he=q.useCallback(()=>{D(null),C(fe=>typeof fe=="object"&&"code"in fe?"experiments":fe)},[]),ye=fe=>{fe.preventDefault(),fe.currentTarget.setPointerCapture(fe.pointerId);const ie=document.body.style.userSelect;document.body.style.userSelect="none";const de=Ae=>{const De=Math.round(window.innerWidth-Ae.clientX-XP),Ve=vg();if(De>Ve+JP){F(!0);return}F(!1);const Ie=Math.min(Math.max(De,Fu),Ve);H(Ie);try{localStorage.setItem(rE,String(Ie))}catch{}},Se=()=>{window.removeEventListener("pointermove",de),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se),document.body.style.userSelect=ie};window.addEventListener("pointermove",de),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se)},be=fe=>{t(ie=>ie?lu(ie,fe):[fe]),r(fe.id),X(!1)},ke=fe=>{t(ie=>ie&&ie.filter(de=>de.id!==fe)),n===fe&&r(null)},Ee=typeof w=="object"&&"view"in w?w:null,Ce=typeof w=="object"&&"path"in w?w:null,rt=typeof w=="object"&&"kind"in w?w:null,bt=typeof w=="object"&&"code"in w,Ge=(e==null?void 0:e.find(fe=>fe.id===n))??null,ct=Ee?a.find(fe=>fe.id===Ee.id)??null:null;if(e===null)return m.jsx("div",{className:"app",children:m.jsx("div",{className:"empty-state",children:m.jsx("span",{className:"spinner"})})});if(e.length===0)return m.jsx("div",{className:"app",children:M?m.jsx(Nb,{projects:e,onOpen:r,onCreated:be,onDeleted:ke}):m.jsx(SB,{onDone:()=>{try{localStorage.setItem(HS,"1")}catch{}O(!0)}})});const Pt=m.jsx(bB,{projectName:((ht=e.find(fe=>fe.id===n))==null?void 0:ht.name)??"",onHome:()=>X(!0),onCollapse:()=>V(!1)});return m.jsx("div",{className:"app",children:G?m.jsx(Nb,{projects:e,onOpen:fe=>{r(fe),X(!1)},onCreated:be,onDeleted:ke}):m.jsxs("div",{className:"app-body",children:[n&&m.jsx(ML,{projectId:n,paperId:(Fe=e.find(fe=>fe.id===n))==null?void 0:Fe.paperId,railHeader:Pt,railOpen:z,onShowRail:()=>V(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&F(!1),j(!T)},onOpenFile:ae,onOpenPlan:P,children:K==="files"?(()=>{const fe=e.find(ie=>ie.id===n);return fe?m.jsx(GL,{project:fe,files:c,onChanged:U,onOpenStorage:()=>L("storage")}):null})():K!=="chat"?m.jsx(_L,{tab:K}):null}),K==="chat"&&T&&m.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:Y},children:[!B&&m.jsx("div",{className:"panel-resizer",onPointerDown:ye}),m.jsxs("div",{className:"tabs",children:[m.jsxs("div",{className:"tab-strip",children:[m.jsx("button",{className:`tab ${w==="experiments"?"active":""}`,onClick:()=>C("experiments"),children:"Experiments"}),b.map(fe=>{const ie=a.find(de=>de.id===fe.id);return m.jsx(Gc,{active:Ee!==null&&au(Ee,fe),label:ie?ie.title||ie.slug:"…",icon:fe.view==="terminal"?m.jsx(XS,{size:12,style:{flexShrink:0}}):m.jsx($u,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>re(fe)},`${fe.id}:${fe.view}`)}),x.map(fe=>m.jsx(Gc,{active:Ce!==null&&ou(Ce,fe),label:fe.path.split("/").pop()||fe.path,icon:m.jsx(GS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>Z(fe)},`file:${zS(fe)}`)),E.map(fe=>m.jsx(Gc,{active:rt!==null&&rt.promptId===fe.promptId,label:"Plan",icon:m.jsx(WS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>ee(fe)},`plan:${fe.promptId}`)),N&&m.jsx(Gc,{active:bt,label:"Code",icon:m.jsx(VS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(N),onClose:he},"code")]}),m.jsxs("div",{className:"panel-controls",children:[m.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>F(fe=>!fe),children:B?m.jsx(_N,{size:14}):m.jsx(gN,{size:14})}),m.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),F(!1)},children:m.jsx(Fo,{size:14})})]})]}),w==="experiments"?m.jsxs("div",{className:"tab-body",children:[m.jsx("div",{className:"pane-toolbar",children:m.jsxs("div",{className:"seg",children:[m.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),m.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),m.jsx("div",{className:"pane-content",children:p==="tree"?Ge&&m.jsx(YP,{experiments:a,runs:u,project:Ge,onOpenView:Q,onOpenCodeBranch:ne}):m.jsx(DB,{runs:u,experiments:a,onOpen:fe=>{v(fe.id),Q(fe.experimentId,"terminal")},onOpenChanges:fe=>Q(fe,"changes"),onCancel:fe=>void ZS(fe).catch(()=>{})})})]}):Ce?m.jsx("div",{className:"tab-body",children:n&&m.jsx(yB,{projectId:n,path:Ce.path,sessionId:Ce.sessionId,gitRef:Ce.ref,onOpenFile:ae},zS(Ce))}):rt?m.jsx("div",{className:"tab-body",children:m.jsx("div",{className:"pane-content plan-tab-content",children:m.jsx(qo,{text:rt.plan,onOpenFile:fe=>ae(fe,rt.sessionId)})})}):bt?m.jsx("div",{className:"tab-body",children:n&&Ge&&N&&m.jsx(OL,{projectId:n,project:Ge,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:fe=>ge({sel:fe}),onToggledChange:fe=>ge({toggled:fe}),onOpenFile:ae},"code")}):m.jsx("div",{className:"tab-body",children:Ee&&ct&&Ge&&m.jsx(gB,{experiment:ct,project:Ge,view:Ee.view,runs:u,selectedRunId:_,onSelectRun:v},`${Ee.id}:${Ee.view}`)})]})]})})}yA.createRoot(document.getElementById("root")).render(m.jsx(q.StrictMode,{children:m.jsx(tU,{})})); +`)),p=f.reduce((d,_)=>d.concat(..._),[]);return[f,p]}return[[],[]]},[e]);return V.useEffect(()=>{const c=(t==null?void 0:t.target)??vS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=v=>{var b,S;if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!f)&&i2(v))return!1;const C=bS(v.code,o);if(l.current.add(v[C]),yS(u,l.current,!1)){const x=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!y)&&v.preventDefault(),r(!0)}},d=v=>{const w=bS(v.code,o);yS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),a.current=!1},_=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,r]),n}function yS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function bS(e,t){return t.includes(e)?"code":"key"}const OH=()=>{const e=At();return V.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Om(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return vl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=va(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function E2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)BH(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function BH(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function IH(e,t){return E2(e,t)}function zH(e,t){return E2(e,t)}function Zr(e,t){return{id:e,type:"select",selected:t}}function ca(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(Zr(l.id,u)))}return r}function SS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function xS(e){return{id:e.id,type:"remove"}}const HH=JC();function FH(e,t,n={}){return wz(e,t,{...n,onError:n.onError??HH})}const wS=e=>lz(e),PH=e=>WC(e);function k2(e){return V.forwardRef(e)}const UH=typeof window<"u"?V.useLayoutEffect:V.useEffect;function CS(e){const[t,n]=V.useState(BigInt(0)),[r]=V.useState(()=>$H(()=>n(a=>a+BigInt(1))));return UH(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function $H(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const A2=V.createContext(null);function GH({children:e}){const t=At(),n=V.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:_,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=c;for(const S of o)C=typeof S=="function"?S(C):S;let b=SS({items:C,lookup:_});for(const S of w.values())b=S(b);p&&f(C),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:x,setNodes:y}=t.getState();S&&y(x)})},[]),r=CS(n),a=V.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:_}=t.getState();let v=c;for(const w of o)v=typeof w=="function"?w(v):w;p?f(v):d&&d(SS({items:v,lookup:_}))},[]),l=CS(a),u=V.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return m.jsx(A2.Provider,{value:u,children:e})}function qH(){const e=V.useContext(A2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const VH=e=>!!e.panZoom;function Um(){const e=OH(),t=At(),n=qH(),r=tt(VH),a=V.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var S,x;const{nodeLookup:_,nodeOrigin:v}=t.getState(),w=wS(d)?d:_.get(d.id),C=w.parentId?t2(w.position,w.measured,w.parentId,_,v):w.position,b={...w,position:C,width:((S=w.measured)==null?void 0:S.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return il(b)},f=(d,_,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&wS(b)?b:{...C,...b}}return C}))},p=(d,_,v={replace:!1})=>{o(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&PH(b)?b:{...C,...b}}return C}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var _;return(_=l(d))==null?void 0:_.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(_=>({..._}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const _=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,..._])},addEdges:d=>{const _=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,..._])},toObject:()=>{const{nodes:d=[],edges:_=[],transform:v}=t.getState(),[w,C,b]=v;return{nodes:d.map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:w,y:C,zoom:b}}},deleteElements:async({nodes:d=[],edges:_=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:E}=t.getState(),{nodes:R,edges:N}=await dz({nodesToRemove:d,edgesToRemove:_,nodes:v,edges:w,onBeforeDelete:E}),D=N.length>0,T=R.length>0;if(D){const j=N.map(xS);b==null||b(N),x(j)}if(T){const j=R.map(xS);C==null||C(R),S(j)}return(T||D)&&(y==null||y({nodes:R,edges:N})),{deletedNodes:R,deletedEdges:N}},getIntersectingNodes:(d,_=!0,v)=>{const w=Wb(d),C=w?d:c(d),b=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const x=t.getState().nodeLookup.get(S.id);if(x&&!w&&(S.id===d.id||!x.internals.positionAbsolute))return!1;const y=il(b?S:x),E=zu(y,C);return _&&E>0||E>=y.width*y.height||E>=C.width*C.height}):[]},isNodeIntersecting:(d,_,v=!0)=>{const C=Wb(d)?d:c(d);if(!C)return!1;const b=zu(C,_);return v&&b>0||b>=_.width*_.height||b>=C.width*C.height},updateNode:f,updateNodeData:(d,_,v={replace:!1})=>{f(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(d,_,v={replace:!1})=>{p(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:d=>{const{nodeLookup:_,nodeOrigin:v}=t.getState();return cz(d,{nodeLookup:_,nodeOrigin:v})},getHandleConnections:({type:d,id:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}-${d}${_?`-${_}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:d,handleId:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}${d?_?`-${d}-${_}`:`-${d}`:""}`))==null?void 0:w.values())??[])},fitView:async d=>{const _=t.getState().fitViewResolver??mz();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:_}),n.nodeQueue.push(v=>[...v]),_.promise}}},[]);return V.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const ES=e=>e.selected,YH=typeof window<"u"?window:void 0;function WH({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=At(),{deleteElements:r}=Um(),a=sl(e,{actInsideInputWithModifier:!1}),l=sl(t,{target:YH});V.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(ES),edges:u.filter(ES)}),n.setState({nodesSelectionActive:!1})}},[a]),V.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function XH(e){const t=At();V.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Bm(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},KH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ZH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ts.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:_,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:b,onViewportChange:S,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:E}){const R=At(),N=V.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:j}=tt(KH,kt),B=sl(_),z=V.useRef();XH(N);const G=V.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),x||R.setState({transform:U})},[S,x]);return V.useEffect(()=>{if(N.current){z.current=Jz({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:q=>R.setState(X=>X.paneDragging===q?X:{paneDragging:q}),onPanZoomStart:(q,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoom:(q,X)=>{const{onViewportChange:K,onMove:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoomEnd:(q,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=R.getState();L==null||L(q,X),K==null||K(X)}});const{x:U,y:H,zoom:Y}=z.current.getViewport();return R.setState({panZoom:z.current,transform:[U,H,Y],domNode:N.current.closest(".react-flow")}),()=>{var q;(q=z.current)==null||q.destroy()}}},[]),V.useEffect(()=>{var U;(U=z.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:b,userSelectionActive:D,noWheelClassName:C,lib:T,onTransformChange:G,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:y})},[e,t,n,r,a,l,u,o,B,v,b,D,C,T,G,j,E,y]),m.jsx("div",{className:"react-flow__renderer",ref:N,style:kh,children:w})}const QH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function JH(){const{userSelectionActive:e,userSelectionRect:t}=tt(QH,kt);return e&&t?m.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ep=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},eF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function tF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nl.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:_,onPaneMouseMove:v,onPaneMouseLeave:w,children:C}){const b=V.useRef(0),S=At(),{userSelectionActive:x,elementsSelectable:y,dragging:E,panBy:R,autoPanSpeed:N}=tt(eF,kt),D=y&&(e||x),T=V.useRef(null),j=V.useRef(),B=V.useRef(new Set),z=V.useRef(new Set),G=V.useRef(!1),U=V.useRef(!1),H=V.useRef({x:0,y:0}),Y=V.useRef(!1),q=P=>{if(U.current||G.current||S.getState().connection.inProgress){U.current=!1,G.current=!1;return}f==null||f(P),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},X=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}p==null||p(P)},K=d?P=>d(P):void 0,L=P=>{U.current&&(P.stopPropagation(),U.current=!1)},M=P=>{var Ce,rt;const{domNode:ee,transform:ne}=S.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const ge=P.target===T.current;if(!ge&&!!P.target.closest(".nokey")||!e||!(u&&ge||t)||P.button!==0||!P.isPrimary)return;(rt=(Ce=P.target)==null?void 0:Ce.setPointerCapture)==null||rt.call(Ce,P.pointerId),U.current=!1;const{x:be,y:ke}=Qn(P.nativeEvent,j.current),Ee=vl({x:be,y:ke},ne);S.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:be,y:ke}}),ge||(P.stopPropagation(),P.preventDefault())};function O(P,ee){const{userSelectionRect:ne}=S.getState();if(!ne)return;const{transform:ge,nodeLookup:he,edgeLookup:ye,connectionLookup:be,triggerNodeChanges:ke,triggerEdgeChanges:Ee,defaultEdgeOptions:Ce}=S.getState(),rt={x:ne.startX,y:ne.startY},{x:bt,y:Ge}=va(rt,ge),ct={startX:rt.x,startY:rt.y,x:P<bt?P:bt,y:ee<Ge?ee:Ge,width:Math.abs(P-bt),height:Math.abs(ee-Ge)},Pt=B.current,ht=z.current;B.current=new Set(jm(he,ct,ge,n===nl.Partial,!0).map(fe=>fe.id)),z.current=new Set;const Fe=(Ce==null?void 0:Ce.selectable)??!0;for(const fe of B.current){const ie=be.get(fe);if(ie)for(const{edgeId:de}of ie.values()){const Se=ye.get(de);Se&&(Se.selectable??Fe)&&z.current.add(de)}}if(!Xb(Pt,B.current)){const fe=ca(he,B.current,!0);ke(fe)}if(!Xb(ht,z.current)){const fe=ca(ye,z.current);Ee(fe)}S.setState({userSelectionRect:ct,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!a||!j.current)return;const[P,ee]=Lm(H.current,j.current,N);R({x:P,y:ee}).then(ne=>{if(!U.current||!ne){b.current=requestAnimationFrame($);return}const{x:ge,y:he}=H.current;O(ge,he),b.current=requestAnimationFrame($)})}const F=()=>{cancelAnimationFrame(b.current),b.current=0,Y.current=!1};V.useEffect(()=>()=>F(),[]);const Q=P=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:ge}=S.getState();if(!j.current||!ee)return;const{x:he,y:ye}=Qn(P.nativeEvent,j.current);H.current={x:he,y:ye};const be=va({x:ee.startX,y:ee.startY},ne);if(!U.current){const ke=t?0:l;if(Math.hypot(he-be.x,ye-be.y)<=ke)return;ge(),o==null||o(P)}U.current=!0,Y.current||($(),Y.current=!0),O(he,ye)},re=P=>{var ee,ne;if(!D){P.target===T.current&&S.getState().connection.inProgress&&(G.current=!0);return}P.button===0&&((ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),!x&&P.target===T.current&&S.getState().userSelectionRect&&(q==null||q(P)),S.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(P),S.setState({nodesSelectionActive:B.current.size>0})),F())},ae=P=>{var ee,ne;(ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),F()},Z=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:Ft(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:D?void 0:Ep(q,T),onContextMenu:Ep(X,T),onWheel:Ep(K,T),onPointerEnter:D?void 0:_,onPointerMove:D?Q:v,onPointerUp:re,onPointerCancel:D?ae:void 0,onPointerDownCapture:D?M:void 0,onClickCapture:D?L:void 0,onPointerLeave:w,ref:T,style:kh,children:[C,m.jsx(JH,{})]})}function mg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function N2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=At(),[c,f]=V.useState(!1),p=V.useRef();return V.useEffect(()=>{p.current=Hz({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{mg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),V.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{var d;(d=p.current)==null||d.destroy()}},[n,r,t,l,e,a,u]),c}const nF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function T2(){const e=At();return V.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,_=nF(u),v=a?l[0]:5,w=a?l[1]:5,C=n.direction.x*v*n.factor,b=n.direction.y*w*n.factor;for(const[,S]of f){if(!_(S))continue;let x={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+b};a&&(x=_l(x,l));const{position:y,positionAbsolute:E}=XC({nodeId:S.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});S.position=y,S.internals.positionAbsolute=E,d.set(S.id,S)}c(d)},[])}const $m=V.createContext(null),iF=$m.Provider;$m.Consumer;const R2=()=>V.useContext($m),rF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),D2=V.createContext(null);function sF({children:e}){const t=tt(rF,kt);return m.jsx(D2.Provider,{value:t,children:e})}function aF(){const e=V.useContext(D2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const oF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},lF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return oF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===ma.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function cF({type:e="source",position:t=Me.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,..._},v){var Y,q;const w=u||null,C=e==="target",b=At(),S=R2(),{connectOnClick:x,noPanClassName:y,rfId:E}=aF(),{connectingFrom:R,connectingTo:N,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:z}=tt(lF(S,w,e),kt);S||(q=(Y=b.getState()).onError)==null||q.call(Y,"010",ei.error010());const G=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=b.getState(),O={...K,...X};if(M){const{edges:$,setEdges:F,onError:Q}=b.getState();F(FH(O,$,{onError:Q}))}L==null||L(O),o==null||o(O)},U=X=>{if(!S)return;const K=r2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=b.getState();gg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:C,handleId:w,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,$;return($=(O=b.getState()).onConnectEnd)==null?void 0:$.call(O,...M)},updateConnection:L.updateConnection,onConnect:G,isValidConnection:n||((...M)=>{var O,$;return(($=(O=b.getState()).isValidConnection)==null?void 0:$.call(O,...M))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},H=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:$,lib:F,rfId:Q,nodeLookup:re,connection:ae}=b.getState();if(!S||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:S,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const Z=n2(X.target),P=n||$,{connection:ee,isValid:ne}=gg.isValid(X.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:P,flowId:Q,doc:Z,lib:F,nodeLookup:re});ne&&ee&&G(ee);const ge=structuredClone(ae);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(X,ge),b.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${E}-${S}-${w}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,f,{source:!C,target:C,connectable:r,connectablestart:a,connectableend:l,clickconnecting:D,connectingfrom:R,connectingto:N,valid:z,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:U,onTouchStart:U,onClick:x?H:void 0,ref:v,..._,children:c})}const ba=V.memo(k2(cF));function uF({data:e,isConnectable:t,sourcePosition:n=Me.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(ba,{type:"source",position:n,isConnectable:t})]})}function hF({data:e,isConnectable:t,targetPosition:n=Me.Top,sourcePosition:r=Me.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(ba,{type:"source",position:r,isConnectable:t})]})}function fF(){return null}function dF({data:e,isConnectable:t,targetPosition:n=Me.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Hu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},kS={input:uF,default:hF,output:dF,group:fF};function pF(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const gF=e=>{const{width:t,height:n,x:r,y:a}=ml(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function mF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=At(),{width:a,height:l,transformString:u,userSelectionActive:o}=tt(gF,kt),c=T2(),f=V.useRef(null);V.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(N2({nodeRef:f,disabled:!p}),!p)return null;const d=e?v=>{const w=r.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,_=v=>{Object.prototype.hasOwnProperty.call(Hu,v.key)&&(v.preventDefault(),c({direction:Hu[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Ft(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:_,style:{width:a,height:l}})})}const AS=typeof window<"u"?window:void 0,_F=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function M2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:U,preventScrolling:H,onSelectionContextMenu:Y,noWheelClassName:q,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:$}=tt(_F,kt),F=sl(f,{target:AS}),Q=sl(C,{target:AS}),re=Q||T,ae=Q||E,Z=p&&re!==!0,P=F||$||Z;return WH({deleteKeyCode:c,multiSelectionKeyCode:w}),m.jsx(ZH,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:!F&&re,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:H,noWheelClassName:q,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:m.jsxs(tF,{onSelectionStart:_,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!P,selectionMode:d,selectionKeyPressed:F,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&m.jsx(mF,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:K})]})})}M2.displayName="FlowRenderer";const vF=V.memo(M2),yF=e=>t=>e?jm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function bF(e){return tt(V.useCallback(yF(e),[e]),kt)}const SF=e=>e.updateNodeInternals;function xF(){const e=tt(SF),[t]=V.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return V.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function wF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=At(),l=V.useRef(null),u=V.useRef(null),o=V.useRef(e.sourcePosition),c=V.useRef(e.targetPosition),f=V.useRef(t),p=n&&!!e.internals.handleBounds;return V.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),V.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(l.current){const d=f.current!==t,_=o.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||_||v)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function CF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:_,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:b,nodeClickDistance:S,onError:x}){const{node:y,internals:E,isParent:R}=tt(P=>{const ee=P.nodeLookup.get(e),ne=P.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},kt);let N=y.type||"default",D=(b==null?void 0:b[N])||kS[N];D===void 0&&(x==null||x("003",ei.error003(N)),N="default",D=(b==null?void 0:b.default)||kS.default);const T=!!(y.draggable||o&&typeof y.draggable>"u"),j=!!(y.selectable||c&&typeof y.selectable>"u"),B=!!(y.connectable||f&&typeof y.connectable>"u"),z=!!(y.focusable||p&&typeof y.focusable>"u"),G=At(),U=e2(y),H=wF({node:y,nodeType:N,hasDimensions:U,resizeObserver:d}),Y=N2({nodeRef:H,disabled:y.hidden||!T,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:S}),q=T2();if(y.hidden)return null;const X=Vi(y),K=pF(y),L=j||T||t||n||r||a,M=n?P=>n(P,{...E.userNode}):void 0,O=r?P=>r(P,{...E.userNode}):void 0,$=a?P=>a(P,{...E.userNode}):void 0,F=l?P=>l(P,{...E.userNode}):void 0,Q=u?P=>u(P,{...E.userNode}):void 0,re=P=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=G.getState();j&&(!ee||!T||ne>0)&&mg({id:e,store:G,nodeRef:H}),t&&t(P,{...E.userNode})},ae=P=>{if(!(i2(P.nativeEvent)||w)){if(GC.includes(P.key)&&j){const ee=P.key==="Escape";mg({id:e,store:G,unselect:ee,nodeRef:H})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(Hu,P.key)){P.preventDefault();const{ariaLabelConfig:ee}=G.getState();G.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:P.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),q({direction:Hu[P.key],factor:P.shiftKey?4:1})}}},Z=()=>{var be;if(w||!((be=H.current)!=null&&be.matches(":focus-visible")))return;const{transform:P,width:ee,height:ne,autoPanOnNodeFocus:ge,setCenter:he}=G.getState();if(!ge)return;jm(new Map([[e,y]]),{x:0,y:0,width:ee,height:ne},P,!0).length>0||he(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:P[2]})};return m.jsx("div",{className:Ft(["react-flow__node",`react-flow__node-${N}`,{[v]:T},y.className,{selected:y.selected,selectable:j,parent:R,draggable:T,dragging:Y}]),ref:H,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:U?"visible":"hidden",...y.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:$,onContextMenu:F,onClick:re,onDoubleClick:Q,onKeyDown:z?ae:void 0,tabIndex:z?0:void 0,onFocus:z?Z:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${x2}-${C}`,"aria-label":y.ariaLabel,...y.domAttributes,children:m.jsx(iF,{value:e,children:m.jsx(D,{id:e,data:y.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:j,draggable:T,deletable:y.deletable??!0,isConnectable:B,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...X})})})}var EF=V.memo(CF);const kF=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function j2(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=tt(kF,kt),u=bF(e.onlyRenderVisibleElements),o=xF();return m.jsx("div",{className:"react-flow__nodes",style:kh,children:u.map(c=>m.jsx(EF,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},c))})}j2.displayName="NodeRenderer";const AF=V.memo(j2);function NF(e){return tt(V.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&bz({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),kt)}const TF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},RF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},NS={[Bu.Arrow]:TF,[Bu.ArrowClosed]:RF};function DF(e){const t=At();return V.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(NS,e)?NS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const MF=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=DF(t);return c?m.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:m.jsx(c,{color:n,strokeWidth:u})}):null},L2=({defaultColor:e,rfId:t})=>{const n=tt(l=>l.edges),r=tt(l=>l.defaultEdgeOptions),a=V.useMemo(()=>Nz(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:a.map(l=>m.jsx(MF,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};L2.displayName="MarkerDefinitions";var jF=V.memo(L2);function O2({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,_]=V.useState({x:1,y:0,width:0,height:0}),v=Ft(["react-flow__edge-textwrapper",f]),w=V.useRef(null);return V.useEffect(()=>{if(w.current){const C=w.current.getBBox();_({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?m.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...p,children:[a&&m.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),m.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}O2.displayName="EdgeText";const LF=V.memo(O2);function Ah({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...p,d:e,fill:"none",className:Ft(["react-flow__edge-path",p.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?m.jsx(LF,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function TS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Me.Left||e===Me.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function B2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top}){const[u,o]=TS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=TS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,_,v]=s2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,_,v]}function I2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})=>{const[x,y,E]=B2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),R=e.isInternal?void 0:t;return m.jsx(Ah,{id:R,path:x,labelX:y,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})})}const OF=I2({isInternal:!1}),z2=I2({isInternal:!0});OF.displayName="SimpleBezierEdge";z2.displayName="SimpleBezierEdgeInternal";function H2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,sourcePosition:v=Me.Bottom,targetPosition:w=Me.Top,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=fg({sourceX:n,sourceY:r,sourcePosition:v,targetX:a,targetY:l,targetPosition:w,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:C,markerStart:b,interactionWidth:x})})}const F2=H2({isInternal:!1}),P2=H2({isInternal:!0});F2.displayName="SmoothStepEdge";P2.displayName="SmoothStepEdgeInternal";function U2(e){return V.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return m.jsx(F2,{...n,id:r,pathOptions:V.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const BF=U2({isInternal:!1}),$2=U2({isInternal:!0});BF.displayName="StepEdge";$2.displayName="StepEdgeInternal";function G2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[b,S,x]=l2({sourceX:n,sourceY:r,targetX:a,targetY:l}),y=e.isInternal?void 0:t;return m.jsx(Ah,{id:y,path:b,labelX:S,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})})}const IF=G2({isInternal:!1}),q2=G2({isInternal:!0});IF.displayName="StraightEdge";q2.displayName="StraightEdgeInternal";function V2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=Me.Bottom,targetPosition:o=Me.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=a2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:S==null?void 0:S.curvature}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:x})})}const zF=V2({isInternal:!1}),Y2=V2({isInternal:!0});zF.displayName="BezierEdge";Y2.displayName="BezierEdgeInternal";const RS={default:Y2,straight:q2,step:$2,smoothstep:P2,simplebezier:z2},DS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},HF=(e,t,n)=>n===Me.Left?e-t:n===Me.Right?e+t:e,FF=(e,t,n)=>n===Me.Top?e-t:n===Me.Bottom?e+t:e,MS="react-flow__edgeupdater";function jS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return m.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Ft([MS,`${MS}-${o}`]),cx:HF(t,r,e),cy:FF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function PF({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:_,setUpdateHover:v}){const w=At(),C=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:D,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:z,cancelConnection:G,nodeLookup:U,rfId:H,panBy:Y,updateConnection:q}=w.getState(),X=R.type==="target",K=(O,$)=>{_(!1),d==null||d(O,n,R.type,$)},L=O=>f==null?void 0:f(n,O),M=(O,$)=>{_(!0),p==null||p(E,n,R.type),z==null||z(O,$)};gg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:D,handleId:R.id,nodeId:R.nodeId,nodeLookup:U,isTarget:X,edgeUpdaterType:R.type,lib:B,flowId:H,cancelConnection:G,panBy:Y,isValidConnection:(...O)=>{var $,F;return((F=($=w.getState()).isValidConnection)==null?void 0:F.call($,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var $,F;return(F=($=w.getState()).onConnectEnd)==null?void 0:F.call($,...O)},onReconnectEnd:K,updateConnection:q,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},b=E=>C(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=E=>C(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>v(!0),y=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(jS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&m.jsx(jS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function UF({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:b,onError:S,disableKeyboardA11y:x}){let y=tt(he=>he.edgeLookup.get(e));const E=tt(he=>he.defaultEdgeOptions);y=E?{...E,...y}:y;let R=y.type||"default",N=(C==null?void 0:C[R])||RS[R];N===void 0&&(S==null||S("011",ei.error011(R)),R="default",N=(C==null?void 0:C.default)||RS.default);const D=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),j=!!(y.selectable||r&&typeof y.selectable>"u"),B=V.useRef(null),[z,G]=V.useState(!1),[U,H]=V.useState(!1),Y=At(),{zIndex:q=y.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$}=tt(V.useCallback(he=>{const ye=he.nodeLookup.get(y.source),be=he.nodeLookup.get(y.target);if(!ye||!be)return DS;const ke=Az({id:e,sourceNode:ye,targetNode:be,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:he.connectionMode,onError:S}),Ee=yz({selected:y.selected,zIndex:y.zIndex,sourceNode:ye,targetNode:be,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode});return{...ke||DS,zIndex:Ee}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kt),F=V.useMemo(()=>y.markerStart?`url('#${dg(y.markerStart,w)}')`:void 0,[y.markerStart,w]),Q=V.useMemo(()=>y.markerEnd?`url('#${dg(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||X===null||K===null||L===null||M===null)return null;const re=he=>{var Ee;const{addSelectedEdges:ye,unselectNodesAndEdges:be,multiSelectionActive:ke}=Y.getState();j&&(Y.setState({nodesSelectionActive:!1}),y.selected&&ke?(be({nodes:[],edges:[y]}),(Ee=B.current)==null||Ee.blur()):ye([e])),a&&a(he,y)},ae=l?he=>{l(he,{...y})}:void 0,Z=u?he=>{u(he,{...y})}:void 0,P=o?he=>{o(he,{...y})}:void 0,ee=c?he=>{c(he,{...y})}:void 0,ne=f?he=>{f(he,{...y})}:void 0,ge=he=>{var ye;if(!x&&GC.includes(he.key)&&j){const{unselectNodesAndEdges:be,addSelectedEdges:ke}=Y.getState();he.key==="Escape"?((ye=B.current)==null||ye.blur(),be({edges:[y]})):ke([e])}};return m.jsx("svg",{style:{zIndex:q},children:m.jsxs("g",{className:Ft(["react-flow__edge",`react-flow__edge-${R}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!j&&!a,updating:z,selectable:j}]),onClick:re,onDoubleClick:ae,onContextMenu:Z,onMouseEnter:P,onMouseMove:ee,onMouseLeave:ne,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,role:y.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":D?`${w2}-${w}`:void 0,ref:B,...y.domAttributes,children:[!U&&m.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:j,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&m.jsx(PF,{edge:y,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,setUpdateHover:G,setReconnecting:H})]})})}var $F=V.memo(UF);const GF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function W2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,onError:y}=tt(GF,kt),E=NF(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(jF,{defaultColor:e,rfId:n}),E.map(R=>m.jsx($F,{id:R,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:C},R))]})}W2.displayName="EdgeRenderer";const qF=V.memo(W2),VF=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function YF({children:e}){const t=tt(VF);return m.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WF(e){const t=Um(),n=V.useRef(!1);V.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const XF=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function KF(e){const t=tt(XF),n=At();return V.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ZF(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function QF(e){return ZF}function JF(e){const t=QF();return tt(t,kt)}const eP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=tt(eP,kt);return!(l&&a&&c)?null:m.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:Ft(["react-flow__connection",YC(o)]),children:m.jsx(X2,{style:t,type:n,CustomComponent:r,isValid:o})})})}const X2=({style:e,type:t=Er.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:_,pointer:v}=JF();if(!a)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:_,connectionStatus:YC(r),toNode:p,toHandle:d,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:_};switch(t){case Er.Bezier:[w]=a2(C);break;case Er.SimpleBezier:[w]=B2(C);break;case Er.Step:[w]=fg({...C,borderRadius:0});break;case Er.SmoothStep:[w]=fg(C);break;default:[w]=l2(C)}return m.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};X2.displayName="ConnectionLine";const nP={};function LS(e=nP){V.useRef(e),At(),V.useEffect(()=>{},[e])}function iP(){At(),V.useRef(!1),V.useEffect(()=>{},[])}function K2({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:_,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:z,translateExtent:G,minZoom:U,maxZoom:H,preventScrolling:Y,defaultMarkerColor:q,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:F,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:ge,nodeClickDistance:he,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,viewport:de,onViewportChange:Se}){return LS(e),LS(t),iP(),WF(n),KF(de),m.jsx(vF,{onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:$,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:F,autoPanOnSelection:Q,defaultViewport:z,translateExtent:G,minZoom:U,maxZoom:H,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,onViewportChange:Se,isControlledViewport:!!de,children:m.jsxs(YF,{children:[m.jsx(qF,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,defaultMarkerColor:q,noPanClassName:ht,disableKeyboardA11y:Fe,rfId:ie}),m.jsx(tP,{style:C,type:w,component:b,containerStyle:S}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(AF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:he,onlyRenderVisibleElements:j,noPanClassName:ht,noDragClassName:ct,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}K2.displayName="GraphView";const rP=V.memo(K2),sP=JC(),OS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:_="basic"}={})=>{const v=new Map,w=new Map,C=new Map,b=new Map,S=r??t??[],x=n??e??[],y=p??[0,0],E=d??tl;h2(C,b,S);const{nodesInitialized:R}=pg(x,v,w,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let N=[0,0,1];if(u&&a&&l){const D=ml(v,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:T,y:j,zoom:B}=Om(D,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:R,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:b,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:tl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ma.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...VC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:sP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qC,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},aP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_})=>mH((v,w)=>{async function C(){const{nodeLookup:b,panZoom:S,fitViewOptions:x,fitViewResolver:y,width:E,height:R,minZoom:N,maxZoom:D}=w();S&&(await fz({nodes:b,width:E,height:R,panZoom:S,minZoom:N,maxZoom:D},x),y==null||y.resolve(!0),v({fitViewResolver:null}))}return{...OS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:_}),setNodes:b=>{const{nodeLookup:S,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:N,nodesSelectionActive:D}=w(),{nodesInitialized:T,hasSelectedNodes:j}=pg(b,S,x,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=D&&j;R&&T?(C(),v({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):v({nodes:b,nodesInitialized:T,nodesSelectionActive:B})},setEdges:b=>{const{connectionLookup:S,edgeLookup:x}=w();h2(S,x,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:x}=w();x(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:x}=w();x(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:x,parentLookup:y,domNode:E,nodeOrigin:R,nodeExtent:N,debug:D,fitViewQueued:T,zIndexMode:j}=w(),{changes:B,updatedInternals:z}=Oz(b,x,y,E,R,N,j);z&&(Dz(x,y,{nodeOrigin:R,nodeExtent:N,zIndexMode:j}),T?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(D&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(b,S=!1)=>{const x=[];let y=[];const{nodeLookup:E,triggerNodeChanges:R,connection:N,updateConnection:D,onNodesChangeMiddlewareMap:T}=w();for(const[j,B]of b){const z=E.get(j),G=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(B!=null&&B.position)),U={id:j,type:"position",position:G?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(z&&N.inProgress&&N.fromNode.id===z.id){const H=ls(z,N.fromHandle,Me.Left,!0);D({...N,from:H})}G&&z.parentId&&x.push({id:j,parentId:z.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),y.push(U)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=w(),z=Pm(x,E,j,B);y.push(...z)}for(const j of T.values())y=j(y);R(y)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:x,nodes:y,hasDefaultNodes:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=IH(b,y);x(N)}R&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:x,edges:y,hasDefaultEdges:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=zH(b,y);x(N)}R&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));E(N);return}E(ca(y,new Set([...b]),!0)),R(ca(x))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));R(N);return}R(ca(x,new Set([...b]))),E(ca(y,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:x,nodes:y,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:N}=w(),D=b||y,T=S||x,j=[];for(const z of D){if(!z.selected)continue;const G=E.get(z.id);G&&(G.selected=!1),j.push(Zr(z.id,!1))}const B=[];for(const z of T)z.selected&&B.push(Zr(z.id,!1));R(j),N(B)},setMinZoom:b=>{const{panZoom:S,maxZoom:x}=w();S==null||S.setScaleExtent([b,x]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:x}=w();S==null||S.setScaleExtent([x,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=w().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:E}=w();if(!E)return;const R=S.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]),N=b.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]);x(R),y(N)},setNodeExtent:b=>{const{nodes:S,nodeLookup:x,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:N,zIndexMode:D}=w();b[0][0]===N[0][0]&&b[0][1]===N[0][1]&&b[1][0]===N[1][0]&&b[1][1]===N[1][1]||(pg(S,x,y,{nodeOrigin:E,nodeExtent:b,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:D}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:x,height:y,panZoom:E,translateExtent:R}=w();return Bz({delta:b,panZoom:E,transform:S,translateExtent:R,width:x,height:y})},setCenter:async(b,S,x)=>{const{width:y,height:E,maxZoom:R,panZoom:N}=w();if(!N)return!1;const D=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:R;return await N.setViewport({x:y/2-b*D,y:E/2-S*D,zoom:D},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{v({connection:{...VC}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...OS()})}},Object.is);function oP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_,children:v}){const[w]=V.useState(()=>aP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:_}));return m.jsx(_H,{value:w,children:m.jsx(GH,{children:m.jsx(sF,{children:v})})})}function lP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v}){return V.useContext(Ch)?m.jsx(m.Fragment,{children:e}):m.jsx(oP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v,children:e})}const cP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function uP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:_,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:z,onDelete:G,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:Y,onSelectionDragStop:q,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:$=Er.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:ae="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:P=!1,selectionMode:ee=nl.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ge=rl()?"Meta":"Control",zoomActivationKeyCode:he=rl()?"Meta":"Control",snapToGrid:ye,snapGrid:be,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ee,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,nodeOrigin:ct=C2,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe=!0,defaultViewport:fe=RH,minZoom:ie=.5,maxZoom:de=2,translateExtent:Se=tl,preventScrolling:Ae=!0,nodeExtent:De,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:Ie=!0,zoomOnPinch:Nt=!0,panOnScroll:Ct=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:st=ts.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:Ut=!0,onPaneClick:ps,onPaneMouseEnter:gi,onPaneMouseMove:mi,onPaneMouseLeave:_i,onPaneScroll:On,onPaneContextMenu:vi,paneClickDistance:ni=1,nodeClickDistance:oe=0,children:we,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:yi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl=10,onNodesChange:bl,onEdgesChange:ii,noDragClassName:$t="nodrag",noWheelClassName:Qt="nowheel",noPanClassName:bi="nopan",fitView:ms,fitViewOptions:Sl,connectOnClick:Nh,attributionPosition:xl,proOptions:Rr,defaultEdgeOptions:Na,elevateNodesOnSelect:Yi=!0,elevateEdgesOnSelect:Wi=!1,disableKeyboardA11y:Xi=!1,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanOnSelection:wl=!0,autoPanSpeed:Cl,connectionRadius:Si,isValidConnection:Zi,onError:Th,style:El,id:Ta,nodeDragThreshold:Rh,connectionDragThreshold:_s,viewport:vs,onViewportChange:qn,width:an,height:kl,colorMode:Dh="light",debug:Ra,onScroll:Dr,ariaLabelConfig:ys,zIndexMode:Al="basic",...on},Da){const bs=Ta||"1",Ma=LH(Dh),Qi=V.useCallback(ja=>{ja.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(ja)},[Dr]);return m.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:Qi,style:{...El,...cP},ref:Da,className:Ft(["react-flow",a,Ma]),id:Ta,role:"application",children:m.jsxs(lP,{nodes:e,edges:t,width:an,height:kl,fitView:ms,fitViewOptions:Sl,minZoom:ie,maxZoom:de,nodeOrigin:ct,nodeExtent:De,zIndexMode:Al,children:[m.jsx(jH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe,elevateNodesOnSelect:Yi,elevateEdgesOnSelect:Wi,minZoom:ie,maxZoom:de,nodeExtent:De,onNodesChange:bl,onEdgesChange:ii,snapToGrid:ye,snapGrid:be,connectionMode:O,translateExtent:Se,connectOnClick:Nh,defaultEdgeOptions:Na,fitView:ms,fitViewOptions:Sl,onNodesDelete:B,onEdgesDelete:z,onDelete:G,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:Y,onSelectionDragStart:H,onSelectionDragStop:q,onMove:p,onMoveStart:d,onMoveEnd:_,noPanClassName:bi,nodeOrigin:ct,rfId:bs,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanSpeed:Cl,onError:Th,connectionRadius:Si,isValidConnection:Zi,selectNodesOnDrag:Ee,nodeDragThreshold:Rh,connectionDragThreshold:_s,onBeforeDelete:M,debug:Ra,ariaLabelConfig:ys,zIndexMode:Al}),m.jsx(rP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:P,selectionMode:ee,deleteKeyCode:ae,multiSelectionKeyCode:ge,panActivationKeyCode:ne,zoomActivationKeyCode:he,onlyRenderVisibleElements:ke,defaultViewport:fe,translateExtent:Se,minZoom:ie,maxZoom:de,preventScrolling:Ae,zoomOnScroll:Ie,zoomOnPinch:Nt,zoomOnDoubleClick:Ln,panOnScroll:Ct,panOnScrollSpeed:qt,panOnScrollMode:st,panOnDrag:Ut,autoPanOnSelection:wl,onPaneClick:ps,onPaneMouseEnter:gi,onPaneMouseMove:mi,onPaneMouseLeave:_i,onPaneScroll:On,onPaneContextMenu:vi,paneClickDistance:ni,nodeClickDistance:oe,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:yi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl,defaultMarkerColor:Ve,noDragClassName:$t,noWheelClassName:Qt,noPanClassName:bi,rfId:bs,disableKeyboardA11y:Xi,nodeExtent:De,viewport:vs,onViewportChange:qn}),m.jsx(TH,{onSelectionChange:U}),we,m.jsx(CH,{proOptions:Rr,position:xl}),m.jsx(wH,{rfId:bs,disableKeyboardA11y:Xi})]})})}var hP=k2(uP);function fP({dimensions:e,lineWidth:t,variant:n,className:r}){return m.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ft(["react-flow__background-pattern",n,r])})}function dP({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Ft(["react-flow__background-pattern","dots",t])})}var Pi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pi||(Pi={}));const pP={[Pi.Dots]:1,[Pi.Lines]:1,[Pi.Cross]:6},gP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Z2({id:e,variant:t=Pi.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=V.useRef(null),{transform:_,patternId:v}=tt(gP,kt),w=r||pP[t],C=t===Pi.Dots,b=t===Pi.Cross,S=Array.isArray(n)?n:[n,n],x=[S[0]*_[2]||1,S[1]*_[2]||1],y=w*_[2],E=Array.isArray(l)?l:[l,l],R=b?[y,y]:x,N=[E[0]*_[2]||1+R[0]/2,E[1]*_[2]||1+R[1]/2],D=`${v}${e||""}`;return m.jsxs("svg",{className:Ft(["react-flow__background",f]),style:{...c,...kh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[m.jsx("pattern",{id:D,x:_[0]%x[0],y:_[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:C?m.jsx(dP,{radius:y/2,className:p}):m.jsx(fP,{dimensions:R,lineWidth:a,variant:t,className:p})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Z2.displayName="Background";const mP=V.memo(Z2);function _P(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function vP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function yP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function bP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function SP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function su({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Ft(["react-flow__controls-button",t]),...n,children:e})}const xP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Q2({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:_="vertical","aria-label":v}){const w=At(),{isInteractive:C,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:x}=tt(xP,kt),{zoomIn:y,zoomOut:E,fitView:R}=Um(),N=()=>{y(),l==null||l()},D=()=>{E(),u==null||u()},T=()=>{R(a),o==null||o()},j=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),c==null||c(!C)},B=_==="horizontal"?"horizontal":"vertical";return m.jsxs(Eh,{className:Ft(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??x["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(su,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:S,children:m.jsx(_P,{})}),m.jsx(su,{onClick:D,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:b,children:m.jsx(vP,{})})]}),n&&m.jsx(su,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:m.jsx(yP,{})}),r&&m.jsx(su,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:C?m.jsx(SP,{}):m.jsx(bP,{})}),p]})}Q2.displayName="Controls";V.memo(Q2);function wP({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:_,onClick:v}){const{background:w,backgroundColor:C}=l||{},b=u||w||C;return m.jsx("rect",{className:Ft(["react-flow__minimap-node",{selected:_},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:b,stroke:o,strokeWidth:c},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const CP=V.memo(wP),EP=e=>e.nodes.map(t=>t.id),kp=e=>e instanceof Function?e:()=>e;function kP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=CP,onClick:u}){const o=tt(EP,kt),c=kp(t),f=kp(e),p=kp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:o.map(_=>m.jsx(NP,{id:_,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},_))})}function AP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:_,height:v}=tt(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const b=C.internals.userNode,{x:S,y:x}=C.internals.positionAbsolute,{width:y,height:E}=Vi(b);return{node:b,x:S,y:x,width:y,height:E}},kt);return!f||f.hidden||!e2(f)?null:m.jsx(o,{x:p,y:d,width:_,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const NP=V.memo(AP);var TP=V.memo(kP);const RP=200,DP=150,MP=e=>!e.hidden,jP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?ZC(ml(e.nodeLookup,{filter:MP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LP="react-flow__minimap-desc";function J2({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:_="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:b=!1,ariaLabel:S,inversePan:x,zoomStep:y=1,offsetScale:E=5}){const R=At(),N=V.useRef(null),{boundingRect:D,viewBB:T,rfId:j,panZoom:B,translateExtent:z,flowWidth:G,flowHeight:U,ariaLabelConfig:H}=tt(jP,kt),Y=(e==null?void 0:e.width)??RP,q=(e==null?void 0:e.height)??DP,X=D.width/Y,K=D.height/q,L=Math.max(X,K),M=L*Y,O=L*q,$=E*L,F=D.x-(M-D.width)/2-$,Q=D.y-(O-D.height)/2-$,re=M+$*2,ae=O+$*2,Z=`${LP}-${j}`,P=V.useRef(0),ee=V.useRef();P.current=L,V.useEffect(()=>{if(N.current&&B)return ee.current=qz({domNode:N.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>P.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),V.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:z,width:G,height:U,inversePan:x,pannable:C,zoomStep:y,zoomable:b})},[C,b,x,y,z,G,U]);const ne=v?ye=>{var Ee;const[be,ke]=((Ee=ee.current)==null?void 0:Ee.pointer(ye))||[0,0];v(ye,{x:be,y:ke})}:void 0,ge=w?V.useCallback((ye,be)=>{const ke=R.getState().nodeLookup.get(be).internals.userNode;w(ye,ke)},[]):void 0,he=S??H["minimap.ariaLabel"];return m.jsx(Eh,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Ft(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:Y,height:q,viewBox:`${F} ${Q} ${re} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[he&&m.jsx("title",{id:Z,children:he}),m.jsx(TP,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-$},${Q-$}h${re+$*2}v${ae+$*2}h${-re-$*2}z + M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}J2.displayName="MiniMap";V.memo(J2);const OP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[ya.Line]:"right",[ya.Handle]:"bottom-right"};function IP({nodeId:e,position:t,variant:n=ya.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:_,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:b,onResizeEnd:S}){const x=R2(),y=typeof e=="string"?e:x,E=At(),R=V.useRef(null),N=n===ya.Handle,D=tt(V.useCallback(OP(N&&v),[N,v]),kt),T=V.useRef(null),j=t??BP[n];V.useEffect(()=>{if(!(!R.current||!y))return T.current||(T.current=rH({domNode:R.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y,domNode:q}=E.getState();return{nodeLookup:z,transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y,paneDomNode:q}},onChange:(z,G)=>{const{triggerNodeChanges:U,nodeLookup:H,parentLookup:Y,nodeOrigin:q}=E.getState(),X=[],K={x:z.x,y:z.y},L=H.get(y);if(L&&L.expandParent&&L.parentId){const M=L.origin??q,O=z.width??L.measured.width??0,$=z.height??L.measured.height??0,F={id:L.id,parentId:L.parentId,rect:{width:O,height:$,...t2({x:z.x??L.position.x,y:z.y??L.position.y},{width:O,height:$},L.parentId,H,M)}},Q=Pm([F],H,Y,q);X.push(...Q),K.x=z.x?Math.max(M[0]*O,z.x):void 0,K.y=z.y?Math.max(M[1]*$,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:y,type:"position",position:{...K}};X.push(M)}if(z.width!==void 0&&z.height!==void 0){const O={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};X.push(O)}for(const M of G){const O={...M,type:"position"};X.push(O)}U(X)},onEnd:({width:z,height:G})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:G}};E.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:_,onResizeStart:C,onResize:b,onResizeEnd:S,shouldResize:w}),()=>{var z;(z=T.current)==null||z.destroy()}},[j,o,c,f,p,d,C,b,S,w]);const B=j.split("-");return m.jsx("div",{className:Ft(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...a,scale:D,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}V.memo(IP);const _g=264,zP=132,yu=44,HP=72;function FP(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function bu(e){if(e.children.length===0)return _g;const t=e.children.reduce((n,r)=>n+bu(r),0)+yu*(e.children.length-1);return Math.max(_g,t)}function PP(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const UP=V.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",_=l?"BASELINE":d?"RUNNING":"EXPERIMENT",v=a.slice(-8);return m.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[m.jsx(ba,{type:"target",position:Me.Top}),m.jsxs("div",{className:"node-eyebrow",children:[m.jsx("span",{children:_}),m.jsx(Vo,{status:p??"idle"})]}),m.jsx("div",{className:"node-head",children:m.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&m.jsx("div",{className:"node-title",children:n.title||n.description}),m.jsxs("div",{className:"node-meta",children:[m.jsx("span",{children:"RUNS"}),v.length>0?m.jsx("span",{className:"run-squares",children:v.map(w=>m.jsx("span",{className:`run-sq ${PP(w.status)}`,title:w.status},w.id))}):m.jsx("span",{children:"no runs"}),m.jsx("span",{style:{flex:1}}),r&&m.jsx("span",{children:Sa(r.createdAt)})]}),m.jsxs("div",{className:"node-actions",onClick:w=>w.stopPropagation(),children:[m.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[m.jsx($u,{size:13}),"Changes"]}),a.length>0&&m.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[m.jsx(YS,{size:13}),"Logs"]}),m.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[m.jsx(GS,{size:13}),"Code"]}),m.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:xg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:m.jsx(pm,{size:13})})]}),m.jsx(ba,{type:"source",position:Me.Bottom})]})}),$P={exp:UP},GP={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function qP({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=V.useMemo(()=>{const o=new Map;for(const v of t){const w=o.get(v.experimentId);w?w.push(v):o.set(v.experimentId,[v])}for(const v of o.values())v.sort((w,C)=>w.createdAt-C.createdAt);const c=[],f=[],p=FP(e);function d(v,w,C){const b=o.get(v.exp.id)??[];if(c.push({id:v.exp.id,type:"exp",position:{x:w-_g/2,y:C},data:{exp:v.exp,latestRun:b[b.length-1]??null,runs:b,isBaseline:!v.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),v.children.length===0)return;const S=v.children.reduce((y,E)=>y+bu(E),0)+yu*(v.children.length-1);let x=w-S/2;for(const y of v.children){const E=bu(y);f.push({id:`e-${v.exp.id}-${y.exp.id}`,source:v.exp.id,target:y.exp.id}),d(y,x+E/2,C+zP+HP),x+=E+yu}}let _=0;for(const v of p){const w=bu(v);d(v,_+w/2,0),_+=w+yu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?m.jsxs("div",{className:"empty-state empty-state-cta",children:[m.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),m.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):m.jsx(hP,{nodes:l,edges:u,nodeTypes:$P,defaultEdgeOptions:GP,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:m.jsx(mP,{variant:Pi.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const au=(e,t)=>e.id===t.id&&e.view===t.view,ou=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,BS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function VP(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const IS="orx:onboarded",eE="orx:panel-width",Fu=360,YP=10,WP=232,XP=380,KP=WP+56,ZP=80;function vg(){return Math.max(Fu,window.innerWidth-KP-XP)}function QP(){const e=vg();try{const t=Number(localStorage.getItem(eE));if(Number.isFinite(t)&&t>=Fu)return Math.min(t,e)}catch{}return Math.max(Fu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function lu(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function JP(){var ht,Fe;const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState([]),[u,o]=V.useState([]),[c,f]=V.useState(null),[p,d]=V.useState("tree"),[_,v]=V.useState(null),[w,C]=V.useState("experiments"),[b,S]=V.useState([]),[x,y]=V.useState([]),[E,R]=V.useState([]),[N,D]=V.useState(null),[T,j]=V.useState(!0),[B,z]=V.useState(!1),[G,U]=V.useState(QP),[H,Y]=V.useState(!0),[q,X]=V.useState(!1),[K,L]=V.useState("chat"),[M,O]=V.useState(()=>{try{return localStorage.getItem(IS)==="1"}catch{return!0}}),$=V.useRef(n);$.current=n,V.useEffect(()=>{AN().then(fe=>{t(fe),r(ie=>{var de;return ie??((de=fe[0])==null?void 0:de.id)??null})}).catch(()=>t([]))},[]),V.useEffect(()=>{const fe=()=>U(ie=>Math.min(ie,vg()));return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[]),V.useEffect(()=>{n&&(DN(n).catch(()=>{}),l([]),o([]),f(null),v(null),S([]),y([]),R([]),D(null),C("experiments"),jN(n).then(l).catch(()=>{}),LN(n).then(o).catch(()=>{}),Iy(n).then(f).catch(()=>{}))},[n]);const F=V.useCallback(()=>{const fe=$.current;fe&&Iy(fe).then(f).catch(()=>{})},[]);AT({onRun:fe=>{fe.projectId===$.current&&o(ie=>lu(ie,fe))},onExperiment:fe=>{fe.projectId===$.current&&l(ie=>lu(ie,fe))},onProject:fe=>{t(ie=>ie?lu(ie,fe):[fe])},onFiles:fe=>{fe===$.current&&F()}});const Q=V.useCallback((fe,ie="changes")=>{const de={id:fe,view:ie};S(Se=>Se.some(Ae=>au(Ae,de))?Se:[...Se,de]),C(de),j(!0)},[]),re=V.useCallback(fe=>{const ie=b.findIndex(Se=>au(Se,fe));if(ie===-1)return;const de=b.filter((Se,Ae)=>Ae!==ie);S(de),typeof w=="object"&&"view"in w&&au(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[b,w]),ae=V.useCallback((fe,ie,de)=>{var De;const Se=(De=e==null?void 0:e.find(Ve=>Ve.id===n))==null?void 0:De.repoPath,Ae=VP(fe,Se,ie);Ae&&(de&&(Ae.ref=de),y(Ve=>Ve.some(Ie=>ou(Ie,Ae))?Ve:[...Ve,Ae]),C(Ae),j(!0))},[e,n]),Z=V.useCallback(fe=>{const ie=x.findIndex(Se=>ou(Se,fe));if(ie===-1)return;const de=x.filter((Se,Ae)=>Ae!==ie);y(de),typeof w=="object"&&"path"in w&&ou(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[x,w]),P=V.useCallback((fe,ie,de)=>{const Se={kind:"plan",sessionId:ie,promptId:de,plan:fe};R(Ae=>{const De=Ae.findIndex(Ie=>Ie.promptId===de);if(De===-1)return[...Ae,Se];const Ve=Ae.slice();return Ve[De]=Se,Ve}),C(Se),j(!0)},[]),ee=V.useCallback(fe=>{const ie=E.findIndex(Se=>Se.promptId===fe.promptId);if(ie===-1)return;const de=E.filter((Se,Ae)=>Ae!==ie);R(de),typeof w=="object"&&"kind"in w&&w.promptId===fe.promptId&&C(de[Math.min(ie,de.length-1)]??"experiments")},[E,w]),ne=V.useCallback(fe=>{const ie={code:!0,sel:fe,toggled:new Set};D(de=>de?{...de,sel:fe}:ie),C(ie),j(!0)},[]),ge=V.useCallback(fe=>{D(ie=>ie&&{...ie,...fe})},[]),he=V.useCallback(()=>{D(null),C(fe=>typeof fe=="object"&&"code"in fe?"experiments":fe)},[]),ye=fe=>{fe.preventDefault(),fe.currentTarget.setPointerCapture(fe.pointerId);const ie=document.body.style.userSelect;document.body.style.userSelect="none";const de=Ae=>{const De=Math.round(window.innerWidth-Ae.clientX-YP),Ve=vg();if(De>Ve+ZP){z(!0);return}z(!1);const Ie=Math.min(Math.max(De,Fu),Ve);U(Ie);try{localStorage.setItem(eE,String(Ie))}catch{}},Se=()=>{window.removeEventListener("pointermove",de),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se),document.body.style.userSelect=ie};window.addEventListener("pointermove",de),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se)},be=fe=>{t(ie=>ie?lu(ie,fe):[fe]),r(fe.id),X(!1)},ke=fe=>{t(ie=>ie&&ie.filter(de=>de.id!==fe)),n===fe&&r(null)},Ee=typeof w=="object"&&"view"in w?w:null,Ce=typeof w=="object"&&"path"in w?w:null,rt=typeof w=="object"&&"kind"in w?w:null,bt=typeof w=="object"&&"code"in w,Ge=(e==null?void 0:e.find(fe=>fe.id===n))??null,ct=Ee?a.find(fe=>fe.id===Ee.id)??null:null;if(e===null)return m.jsx("div",{className:"app",children:m.jsx("div",{className:"empty-state",children:m.jsx("span",{className:"spinner"})})});if(e.length===0)return m.jsx("div",{className:"app",children:M?m.jsx(Nb,{projects:e,onOpen:r,onCreated:be,onDeleted:ke}):m.jsx(vB,{onDone:()=>{try{localStorage.setItem(IS,"1")}catch{}O(!0)}})});const Pt=m.jsx(_B,{projectName:((ht=e.find(fe=>fe.id===n))==null?void 0:ht.name)??"",onHome:()=>X(!0),onCollapse:()=>Y(!1)});return m.jsx("div",{className:"app",children:q?m.jsx(Nb,{projects:e,onOpen:fe=>{r(fe),X(!1)},onCreated:be,onDeleted:ke}):m.jsxs("div",{className:"app-body",children:[n&&m.jsx(TL,{projectId:n,paperId:(Fe=e.find(fe=>fe.id===n))==null?void 0:Fe.paperId,railHeader:Pt,railOpen:H,onShowRail:()=>Y(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&z(!1),j(!T)},onOpenFile:ae,onOpenPlan:P,children:K==="files"?(()=>{const fe=e.find(ie=>ie.id===n);return fe?m.jsx(PL,{project:fe,files:c,onChanged:F,onOpenStorage:()=>L("storage")}):null})():K!=="chat"?m.jsx(pL,{tab:K}):null}),K==="chat"&&T&&m.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:G},children:[!B&&m.jsx("div",{className:"panel-resizer",onPointerDown:ye}),m.jsxs("div",{className:"tabs",children:[m.jsxs("div",{className:"tab-strip",children:[m.jsx("button",{className:`tab ${w==="experiments"?"active":""}`,onClick:()=>C("experiments"),children:"Experiments"}),b.map(fe=>{const ie=a.find(de=>de.id===fe.id);return m.jsx(Gc,{active:Ee!==null&&au(Ee,fe),label:ie?ie.title||ie.slug:"…",icon:fe.view==="terminal"?m.jsx(YS,{size:12,style:{flexShrink:0}}):m.jsx($u,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>re(fe)},`${fe.id}:${fe.view}`)}),x.map(fe=>m.jsx(Gc,{active:Ce!==null&&ou(Ce,fe),label:fe.path.split("/").pop()||fe.path,icon:m.jsx(US,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>Z(fe)},`file:${BS(fe)}`)),E.map(fe=>m.jsx(Gc,{active:rt!==null&&rt.promptId===fe.promptId,label:"Plan",icon:m.jsx(VS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>ee(fe)},`plan:${fe.promptId}`)),N&&m.jsx(Gc,{active:bt,label:"Code",icon:m.jsx(GS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(N),onClose:he},"code")]}),m.jsxs("div",{className:"panel-controls",children:[m.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>z(fe=>!fe),children:B?m.jsx(dN,{size:14}):m.jsx(hN,{size:14})}),m.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),z(!1)},children:m.jsx(Fo,{size:14})})]})]}),w==="experiments"?m.jsxs("div",{className:"tab-body",children:[m.jsx("div",{className:"pane-toolbar",children:m.jsxs("div",{className:"seg",children:[m.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),m.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),m.jsx("div",{className:"pane-content",children:p==="tree"?Ge&&m.jsx(qP,{experiments:a,runs:u,project:Ge,onOpenView:Q,onOpenCodeBranch:ne}):m.jsx(NB,{runs:u,experiments:a,onOpen:fe=>{v(fe.id),Q(fe.experimentId,"terminal")},onOpenChanges:fe=>Q(fe,"changes"),onCancel:fe=>void XS(fe).catch(()=>{})})})]}):Ce?m.jsx("div",{className:"tab-body",children:n&&m.jsx(mB,{projectId:n,path:Ce.path,sessionId:Ce.sessionId,gitRef:Ce.ref,onOpenFile:ae},BS(Ce))}):rt?m.jsx("div",{className:"tab-body",children:m.jsx("div",{className:"pane-content plan-tab-content",children:m.jsx(qo,{text:rt.plan,onOpenFile:fe=>ae(fe,rt.sessionId)})})}):bt?m.jsx("div",{className:"tab-body",children:n&&Ge&&N&&m.jsx(ML,{projectId:n,project:Ge,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:fe=>ge({sel:fe}),onToggledChange:fe=>ge({toggled:fe}),onOpenFile:ae},"code")}):m.jsx("div",{className:"tab-body",children:Ee&&ct&&Ge&&m.jsx(fB,{experiment:ct,project:Ge,view:Ee.view,runs:u,selectedRunId:_,onSelectRun:v},`${Ee.id}:${Ee.view}`)})]})]})})}gA.createRoot(document.getElementById("root")).render(m.jsx(V.StrictMode,{children:m.jsx(JP,{})})); diff --git a/ui/dist/assets/index-BsmS7b0n.css b/ui/dist/assets/index-Dj5p3Wr0.css similarity index 99% rename from ui/dist/assets/index-BsmS7b0n.css rename to ui/dist/assets/index-Dj5p3Wr0.css index 023c284..da3530d 100644 --- a/ui/dist/assets/index-BsmS7b0n.css +++ b/ui/dist/assets/index-Dj5p3Wr0.css @@ -1,4 +1,4 @@ -:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:0;padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.home-brand{font-weight:800;font-size:28px;letter-spacing:-.02em;margin-bottom:36px}.home-brand span{color:var(--primary)}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:18px;letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:6px;color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:600;font-size:14px}.project-card .repo{color:var(--subtext)}.project-card .paper,.project-card .time{font-size:11px;color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:4px 6px 4px 0;border-radius:6px}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:12px;font-weight:600;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--subtext)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:11px;border-radius:6px}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--subtext);text-transform:capitalize;white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:10px;box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:12.5px;color:var(--subtext);border-radius:8px;text-align:left}.rail-nav-item:hover{background:var(--surface);color:var(--text)}.rail-nav-item.active{background:var(--panel);color:var(--text);font-weight:600}.rail-section-label{padding:10px 10px 6px;font-size:12px;font-weight:500;color:var(--muted)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:6px}.rail-empty{padding:6px 10px;font-size:12px;color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px;white-space:nowrap;flex-shrink:0}.tab:hover{color:var(--text)}.tab.active{color:var(--text);background:var(--surface)}.tab .tab-count{font-family:var(--mono);font-weight:400;color:var(--muted)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);color:var(--text);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:13px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:8px;font-size:12.5px;color:var(--subtext);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface);color:var(--text)}.session-row.active{color:var(--text);background:var(--surface);font-weight:500}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:10px;font-family:var(--mono);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:5px;color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:5px;outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--subtext);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:34px;font-weight:700;letter-spacing:-.02em;color:var(--text)}.chat-empty h2 span{color:var(--primary)}.chat-empty .chat-empty-hint{font-size:12px;color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:13px;max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:12px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:13px;white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:4px;display:block}.msg-assistant{font-size:14px;line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:12px;margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:600}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:12.5px;text-align:left;border-radius:6px}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:5px}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--subtext)}.tool-open{flex-shrink:0;font-size:11px;color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--text);background:var(--surface);border-radius:5px;white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:5px}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:13px;min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:6px;display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:600}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:8px;padding:8px 12px;overflow-x:auto;font-size:12px;color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--text);background:var(--panel);border:1px solid var(--border-variant);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:400}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:6px;opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:600;margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:13px;margin:10px 0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:500;color:var(--subtext);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:12.5px;transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--subtext);font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);font-family:var(--mono);text-transform:uppercase;letter-spacing:.05em}.exp-node .baseline-chip{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border);padding:0 4px;flex-shrink:0}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:10.5px;font-weight:700;color:var(--subtext);border-radius:6px;text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--base);border:1px solid var(--border);border-radius:10px;overflow:hidden}.runs-table th{text-align:left;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:11.5px}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--canvas);border:1px solid var(--border);font-size:11px;font-weight:500;letter-spacing:0;color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:10px;background:var(--base);color:var(--subtext);font-size:12.5px}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:500}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.status-chip{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-family:var(--mono)}.status-chip .dot{width:8px;height:8px;border-radius:50%}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:12.5px}.kv .k{color:var(--muted)}.kv .v{font-family:var(--mono);font-size:11.5px;word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:11.5px;color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:#1a1a1a;padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:12.5px;color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:12px;font-weight:600}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12px;border-radius:6px}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:600}.history-item .when{margin-left:auto;font-size:11px;color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:11.5px;color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:13px;line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:18px;font-weight:400;color:var(--text)}.empty-state p.empty-state-hint{font-size:15px;color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:14px}.onb-eyebrow span{color:var(--primary)}.onb-title{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}.onb-sub{color:var(--subtext);font-size:13.5px;line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:10px;padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:600;font-size:14px}.onb-card-detail{font-size:12px}.onb-card-meta{font-size:12px;color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:11px}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:13px;padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--subtext)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--border-variant);border-radius:5px;padding:3px 8px}.onb-gh-hint{font-size:12px;color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:11px}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:12px}.onb-token-form a{font-size:12px;color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:12.5px;white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:400;text-transform:none;letter-spacing:normal;font-size:11px;color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:12.5px;font-weight:500}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:11px;color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:13px;font-weight:600}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--subtext);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.report-view .error,.settings-card>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:16px}:is(.modal,.home) :is(input,select,textarea){border-radius:8px}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:4px 0}.settings-note{margin:10px 0 0;font-size:12px;padding:8px 10px;border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:600}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:var(--mono);text-transform:uppercase;letter-spacing:.06em;padding:1px 7px;border:1px solid var(--border);color:var(--muted)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;overflow-y:auto;padding:20px 24px 48px}.files-col{max-width:var(--readable-col);margin:0 auto;display:flex;flex-direction:column;gap:10px}.files-meta{display:flex;gap:8px;flex-wrap:wrap}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.files-pill-dir{flex:1;min-width:240px}.files-pill-dir code{flex:1;color:var(--subtext)}.files-pill-dir .icon-btn{width:22px;height:22px;margin:-4px -6px -4px 0}button.files-pill-link{cursor:pointer;font:inherit;font-size:12px;color:var(--muted);white-space:nowrap}button.files-pill-link:hover{border-color:var(--muted);color:var(--text)}.files-hint{margin:0;font-size:11.5px;line-height:1.5;color:var(--muted)}.files-hint code{font-family:var(--mono);font-size:10.5px}.files-card{border:1px solid var(--border);border-radius:10px;background:var(--base);overflow:hidden;margin-top:4px}.files-card>*+*{border-top:1px solid var(--border-variant)}.ftree-row{display:flex;align-items:center;gap:8px;padding:8px 14px}.ftree-row.clickable{cursor:pointer}.ftree-row:hover{background:var(--surface)}.ftree-children{background:var(--canvas);border-top:1px solid var(--border-variant)}.ftree-children .ftree-row:hover{background:var(--panel)}.ftree-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ftree-chevron.open{transform:rotate(90deg)}.ftree-chevron.spacer{visibility:hidden}.ftree-dirname{flex:1;min-width:0;font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-title{flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-tag{flex-shrink:0;font-size:11px;color:var(--primary)}.ftree-status{flex-shrink:0;font-family:var(--mono);font-size:10.5px;color:var(--subtext)}.ftree-link{flex:1;min-width:0;display:flex;align-items:center;gap:8px;color:var(--text);text-decoration:none}.ftree-link:hover .ftree-name{text-decoration:underline}.ftree-name{min-width:0;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-thumb{width:22px;height:22px;object-fit:cover;border-radius:4px;border:1px solid var(--border-variant);flex-shrink:0}.ftree-del{width:22px;height:22px;visibility:hidden}.ftree-row:hover .ftree-del{visibility:visible}.ftree-del:hover{color:var(--accent-red)}.ftree-date,.ftree-size{flex-shrink:0}.ftree-size{font-family:var(--mono);font-size:10.5px;color:var(--muted);white-space:nowrap}.ftree-divider{padding:10px 14px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.files-empty{font-size:12.5px;line-height:1.55;color:var(--subtext);border:1px solid var(--border);border-radius:10px;background:var(--base);padding:18px;margin:4px 0 0}.files-empty code{font-family:var(--mono);font-size:11.5px}.files-truncated{margin:0;padding:8px 14px;font-size:11px;color:var(--muted)}.report-date,.ftree-date{font-size:11px;color:var(--muted);white-space:nowrap}.report-view{height:100%;overflow-y:auto;padding:16px 24px 48px}.report-view-col{max-width:var(--readable-col);margin:0 auto}.report-view-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--border-variant)}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:11.5px;color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:8px;background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:8px 8px 0 0}.diff-file-header .chev{color:var(--muted);font-size:10px;flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.7rem;font-weight:700;color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:.65rem;font-weight:700;font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:12.5px}.truncated-notice{border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);padding:12px 14px;font-size:12.5px}.truncated-notice h4{margin:0 0 4px;font-size:13px;color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:12px;line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.report-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--subtext);padding:4px 8px;border-radius:6px}.report-back:hover{color:var(--text);background:var(--surface)}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:22px}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--subtext);font-size:13px}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:12.5px;margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:10px}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:10px}.compute-row.open .compute-row-head:hover{border-radius:10px 10px 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:13px;font-weight:600;color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:6px}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:12px}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:12px;color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:13px;font-weight:600;color:var(--subtext);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{color:var(--text);border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:12.5px}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:500;color:var(--muted)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:11px}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:11.5px;color:var(--subtext);padding:5px 8px;border-radius:6px}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--subtext);padding:5px 4px;border-radius:6px}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:400}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:12.5px;outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12.5px;border-radius:6px}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:10px;color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:11px;color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:6px}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-family:var(--mono);font-size:12px}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:11px;color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--border-variant);border-radius:6px;padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:12px;line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:12px;color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:13.5px}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:6px;background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.prompt-head code{font-family:var(--mono);font-size:11.5px;text-transform:none;color:var(--text)}.prompt-sub{font-family:var(--mono);font-size:12px;color:var(--subtext);word-break:break-word}.prompt-q{font-size:14px;font-weight:600;line-height:1.5;color:var(--text)}.prompt-plan{font-size:13.5px;line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:5px;background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:13px;font-weight:600}.prompt-option-desc{display:block;font-size:12px;font-weight:400;line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:5px;cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:13px;margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:600;word-break:break-word}.prompt-outcome{font-size:12px;color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:13px;color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:600}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:8px;background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:12.5px;cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:8px;padding:9px 11px;font-size:13px;font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:13px;font-weight:600;white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:5px;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:12px;padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:12px}.code-tab-note{padding:8px 16px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:12.5px}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** +:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:0;padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.home-brand{font-weight:800;font-size:28px;letter-spacing:-.02em;margin-bottom:36px}.home-brand span{color:var(--primary)}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:18px;letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:6px;color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:600;font-size:14px}.project-card .repo{color:var(--subtext)}.project-card .paper,.project-card .time{font-size:11px;color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:4px 6px 4px 0;border-radius:6px}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:12px;font-weight:600;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--subtext)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:11px;border-radius:6px}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--subtext);text-transform:capitalize;white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:10px;box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:12.5px;color:var(--subtext);border-radius:8px;text-align:left}.rail-nav-item:hover{background:var(--surface);color:var(--text)}.rail-nav-item.active{background:var(--panel);color:var(--text);font-weight:600}.rail-section-label{padding:10px 10px 6px;font-size:12px;font-weight:500;color:var(--muted)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:6px}.rail-empty{padding:6px 10px;font-size:12px;color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px;white-space:nowrap;flex-shrink:0}.tab:hover{color:var(--text)}.tab.active{color:var(--text);background:var(--surface)}.tab .tab-count{font-family:var(--mono);font-weight:400;color:var(--muted)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);color:var(--text);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:13px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:8px;font-size:12.5px;color:var(--subtext);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface);color:var(--text)}.session-row.active{color:var(--text);background:var(--surface);font-weight:500}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:10px;font-family:var(--mono);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:5px;color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:5px;outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--subtext);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:34px;font-weight:700;letter-spacing:-.02em;color:var(--text)}.chat-empty h2 span{color:var(--primary)}.chat-empty .chat-empty-hint{font-size:12px;color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:13px;max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:12px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:13px;white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:4px;display:block}.msg-assistant{font-size:14px;line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:12px;margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:600}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:12.5px;text-align:left;border-radius:6px}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:5px}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--subtext)}.tool-open{flex-shrink:0;font-size:11px;color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--text);background:var(--surface);border-radius:5px;white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:5px}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:13px;min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:6px;display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:600}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:8px;padding:8px 12px;overflow-x:auto;font-size:12px;color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--text);background:var(--panel);border:1px solid var(--border-variant);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:400}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:6px;opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:600;margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:13px;margin:10px 0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:500;color:var(--subtext);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:12.5px;transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--subtext);font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);font-family:var(--mono);text-transform:uppercase;letter-spacing:.05em}.exp-node .baseline-chip{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border);padding:0 4px;flex-shrink:0}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:10.5px;font-weight:700;color:var(--subtext);border-radius:6px;text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--base);border:1px solid var(--border);border-radius:10px;overflow:hidden}.runs-table th{text-align:left;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:11.5px}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--canvas);border:1px solid var(--border);font-size:11px;font-weight:500;letter-spacing:0;color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:10px;background:var(--base);color:var(--subtext);font-size:12.5px}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:500}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.status-chip{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-family:var(--mono)}.status-chip .dot{width:8px;height:8px;border-radius:50%}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:12.5px}.kv .k{color:var(--muted)}.kv .v{font-family:var(--mono);font-size:11.5px;word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:11.5px;color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:#1a1a1a;padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:12.5px;color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:12px;font-weight:600}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12px;border-radius:6px}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:600}.history-item .when{margin-left:auto;font-size:11px;color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:11.5px;color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:13px;line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:18px;font-weight:400;color:var(--text)}.empty-state p.empty-state-hint{font-size:15px;color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:14px}.onb-eyebrow span{color:var(--primary)}.onb-title{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}.onb-sub{color:var(--subtext);font-size:13.5px;line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:10px;padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:600;font-size:14px}.onb-card-detail{font-size:12px}.onb-card-meta{font-size:12px;color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:11px}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:13px;padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--subtext)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--border-variant);border-radius:5px;padding:3px 8px}.onb-gh-hint{font-size:12px;color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:11px}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:12px}.onb-token-form a{font-size:12px;color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:12.5px;white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:400;text-transform:none;letter-spacing:normal;font-size:11px;color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:12.5px;font-weight:500}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:11px;color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:13px;font-weight:600}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--subtext);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.report-view .error,.settings-card>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:16px}:is(.modal,.home) :is(input,select,textarea){border-radius:8px}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:4px 0}.settings-note{margin:10px 0 0;font-size:12px;padding:8px 10px;border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:600}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:var(--mono);text-transform:uppercase;letter-spacing:.06em;padding:1px 7px;border:1px solid var(--border);color:var(--muted)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;overflow-y:auto;padding:20px 24px 48px}.files-col{max-width:var(--readable-col);margin:0 auto;display:flex;flex-direction:column;gap:10px}.files-meta{display:flex;gap:8px;flex-wrap:wrap}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.files-pill-dir{flex:1;min-width:240px}.files-pill-dir code{flex:1;color:var(--subtext)}.files-pill-dir .icon-btn{width:22px;height:22px;margin:-4px -6px -4px 0}button.files-pill-link{cursor:pointer;font:inherit;font-size:12px;color:var(--muted);white-space:nowrap}button.files-pill-link:hover{border-color:var(--muted);color:var(--text)}.files-hint{margin:0;font-size:11.5px;line-height:1.5;color:var(--muted)}.files-hint code{font-family:var(--mono);font-size:10.5px}.files-card{border:1px solid var(--border);border-radius:10px;background:var(--base);overflow:hidden;margin-top:4px}.files-card>*+*{border-top:1px solid var(--border-variant)}.ftree-row{display:flex;align-items:center;gap:8px;padding:8px 14px}.ftree-row.clickable{cursor:pointer}.ftree-row:hover{background:var(--surface)}.ftree-children{background:var(--canvas);border-top:1px solid var(--border-variant)}.ftree-children .ftree-row:hover{background:var(--panel)}.ftree-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ftree-chevron.open{transform:rotate(90deg)}.ftree-chevron.spacer{visibility:hidden}.ftree-dirname{flex:1;min-width:0;font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-title{flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-tag{flex-shrink:0;font-size:11px;color:var(--primary)}.ftree-status{flex-shrink:0;font-family:var(--mono);font-size:10.5px;color:var(--subtext)}.ftree-link{flex:1;min-width:0;display:flex;align-items:center;gap:8px;color:var(--text);text-decoration:none}.ftree-link:hover .ftree-name{text-decoration:underline}.ftree-name{min-width:0;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-thumb{width:22px;height:22px;object-fit:cover;border-radius:4px;border:1px solid var(--border-variant);flex-shrink:0}.ftree-del{width:22px;height:22px;visibility:hidden}.ftree-row:hover .ftree-del{visibility:visible}.ftree-del:hover{color:var(--accent-red)}.ftree-date,.ftree-size{flex-shrink:0}.ftree-size{font-family:var(--mono);font-size:10.5px;color:var(--muted);white-space:nowrap}.ftree-divider{padding:10px 14px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.files-empty{font-size:12.5px;line-height:1.55;color:var(--subtext);border:1px solid var(--border);border-radius:10px;background:var(--base);padding:18px;margin:4px 0 0}.files-empty code{font-family:var(--mono);font-size:11.5px}.files-truncated{margin:0;padding:8px 14px;font-size:11px;color:var(--muted)}.report-date,.ftree-date{font-size:11px;color:var(--muted);white-space:nowrap}.report-view{height:100%;overflow-y:auto;padding:16px 24px 48px}.report-view-col{max-width:var(--readable-col);margin:0 auto}.report-view-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--border-variant)}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:11.5px;color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:8px;background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:8px 8px 0 0}.diff-file-header .chev{color:var(--muted);font-size:10px;flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.7rem;font-weight:700;color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:.65rem;font-weight:700;font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:12.5px}.truncated-notice{border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);padding:12px 14px;font-size:12.5px}.truncated-notice h4{margin:0 0 4px;font-size:13px;color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:12px;line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.report-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--subtext);padding:4px 8px;border-radius:6px}.report-back:hover{color:var(--text);background:var(--surface)}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:22px}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--subtext);font-size:13px}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:12.5px;margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:10px}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:10px}.compute-row.open .compute-row-head:hover{border-radius:10px 10px 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:13px;font-weight:600;color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:6px}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:12px}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:12px;color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:13px;font-weight:600;color:var(--subtext);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{color:var(--text);border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:12.5px}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:500;color:var(--muted)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:11px}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:11.5px;color:var(--subtext);padding:5px 8px;border-radius:6px}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--subtext);padding:5px 4px;border-radius:6px}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:400}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:12.5px;outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12.5px;border-radius:6px}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:10px;color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:11px;color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:6px}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-family:var(--mono);font-size:12px}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:11px;color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--border-variant);border-radius:6px;padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:12px;line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:12px;color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:13.5px}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:6px;background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.prompt-head code{font-family:var(--mono);font-size:11.5px;text-transform:none;color:var(--text)}.prompt-sub{font-family:var(--mono);font-size:12px;color:var(--subtext);word-break:break-word}.prompt-q{font-size:14px;font-weight:600;line-height:1.5;color:var(--text)}.prompt-plan{font-size:13.5px;line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:5px;background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:13px;font-weight:600}.prompt-option-desc{display:block;font-size:12px;font-weight:400;line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:5px;cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:13px;margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:600;word-break:break-word}.prompt-outcome{font-size:12px;color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:13px;color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:600}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:8px;background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:12.5px;cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:8px;padding:9px 11px;font-size:13px;font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:13px;font-weight:600;white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:5px;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:12px;padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:12px}.code-tab-note{padding:8px 16px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:12.5px}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** * Copyright (c) 2014 The xterm.js authors. All rights reserved. * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) * https://github.com/chjj/term.js diff --git a/ui/dist/index.html b/ui/dist/index.html index 15a3269..938440f 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -8,8 +8,8 @@ html { background: #ffffff; } @media (prefers-color-scheme: dark) { html { background: #0e0c0c; } } </style> - <script type="module" crossorigin src="/assets/index-DgScguTc.js"></script> - <link rel="stylesheet" crossorigin href="/assets/index-BsmS7b0n.css"> + <script type="module" crossorigin src="/assets/index-DE9xlq83.js"></script> + <link rel="stylesheet" crossorigin href="/assets/index-Dj5p3Wr0.css"> </head> <body> <div id="root"></div> From 4559b7fb787fc8f09be3a4c6511cc3291aed0ea8 Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 16:58:44 -0700 Subject: [PATCH 3/7] Revert incidental ui/dist rebuild (no UI source changes in this branch) --- ui/dist/assets/index-BsmS7b0n.css | 32 +++ ui/dist/assets/index-DgScguTc.js | 381 ++++++++++++++++++++++++++++++ ui/dist/index.html | 4 +- 3 files changed, 415 insertions(+), 2 deletions(-) create mode 100644 ui/dist/assets/index-BsmS7b0n.css create mode 100644 ui/dist/assets/index-DgScguTc.js diff --git a/ui/dist/assets/index-BsmS7b0n.css b/ui/dist/assets/index-BsmS7b0n.css new file mode 100644 index 0000000..023c284 --- /dev/null +++ b/ui/dist/assets/index-BsmS7b0n.css @@ -0,0 +1,32 @@ +:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:0;padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.home-brand{font-weight:800;font-size:28px;letter-spacing:-.02em;margin-bottom:36px}.home-brand span{color:var(--primary)}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:18px;letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:6px;color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:600;font-size:14px}.project-card .repo{color:var(--subtext)}.project-card .paper,.project-card .time{font-size:11px;color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:4px 6px 4px 0;border-radius:6px}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:12px;font-weight:600;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--subtext)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:11px;border-radius:6px}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--subtext);text-transform:capitalize;white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:10px;box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:12.5px;color:var(--subtext);border-radius:8px;text-align:left}.rail-nav-item:hover{background:var(--surface);color:var(--text)}.rail-nav-item.active{background:var(--panel);color:var(--text);font-weight:600}.rail-section-label{padding:10px 10px 6px;font-size:12px;font-weight:500;color:var(--muted)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:6px}.rail-empty{padding:6px 10px;font-size:12px;color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px;white-space:nowrap;flex-shrink:0}.tab:hover{color:var(--text)}.tab.active{color:var(--text);background:var(--surface)}.tab .tab-count{font-family:var(--mono);font-weight:400;color:var(--muted)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);color:var(--text);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:13px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:8px;font-size:12.5px;color:var(--subtext);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface);color:var(--text)}.session-row.active{color:var(--text);background:var(--surface);font-weight:500}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:10px;font-family:var(--mono);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:5px;color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:5px;outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--subtext);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:34px;font-weight:700;letter-spacing:-.02em;color:var(--text)}.chat-empty h2 span{color:var(--primary)}.chat-empty .chat-empty-hint{font-size:12px;color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:13px;max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:12px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:13px;white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:4px;display:block}.msg-assistant{font-size:14px;line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:12px;margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:600}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:12.5px;text-align:left;border-radius:6px}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:5px}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--subtext)}.tool-open{flex-shrink:0;font-size:11px;color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--text);background:var(--surface);border-radius:5px;white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:5px}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:13px;min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:6px;display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:600}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:8px;padding:8px 12px;overflow-x:auto;font-size:12px;color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--text);background:var(--panel);border:1px solid var(--border-variant);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:400}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:6px;opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:600;margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:13px;margin:10px 0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:500;color:var(--subtext);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:12.5px;transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--subtext);font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);font-family:var(--mono);text-transform:uppercase;letter-spacing:.05em}.exp-node .baseline-chip{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border);padding:0 4px;flex-shrink:0}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:10.5px;font-weight:700;color:var(--subtext);border-radius:6px;text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--base);border:1px solid var(--border);border-radius:10px;overflow:hidden}.runs-table th{text-align:left;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:11.5px}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--canvas);border:1px solid var(--border);font-size:11px;font-weight:500;letter-spacing:0;color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:10px;background:var(--base);color:var(--subtext);font-size:12.5px}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:500}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.status-chip{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-family:var(--mono)}.status-chip .dot{width:8px;height:8px;border-radius:50%}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:12.5px}.kv .k{color:var(--muted)}.kv .v{font-family:var(--mono);font-size:11.5px;word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:11.5px;color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:#1a1a1a;padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:12.5px;color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:12px;font-weight:600}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12px;border-radius:6px}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:600}.history-item .when{margin-left:auto;font-size:11px;color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:11.5px;color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:13px;line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:18px;font-weight:400;color:var(--text)}.empty-state p.empty-state-hint{font-size:15px;color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:14px}.onb-eyebrow span{color:var(--primary)}.onb-title{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}.onb-sub{color:var(--subtext);font-size:13.5px;line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:10px;padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:600;font-size:14px}.onb-card-detail{font-size:12px}.onb-card-meta{font-size:12px;color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:11px}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:13px;padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--subtext)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--border-variant);border-radius:5px;padding:3px 8px}.onb-gh-hint{font-size:12px;color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:11px}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:12px}.onb-token-form a{font-size:12px;color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:12.5px;white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:400;text-transform:none;letter-spacing:normal;font-size:11px;color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:12.5px;font-weight:500}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:11px;color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:13px;font-weight:600}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--subtext);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.report-view .error,.settings-card>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:16px}:is(.modal,.home) :is(input,select,textarea){border-radius:8px}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:4px 0}.settings-note{margin:10px 0 0;font-size:12px;padding:8px 10px;border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:600}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:var(--mono);text-transform:uppercase;letter-spacing:.06em;padding:1px 7px;border:1px solid var(--border);color:var(--muted)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;overflow-y:auto;padding:20px 24px 48px}.files-col{max-width:var(--readable-col);margin:0 auto;display:flex;flex-direction:column;gap:10px}.files-meta{display:flex;gap:8px;flex-wrap:wrap}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.files-pill-dir{flex:1;min-width:240px}.files-pill-dir code{flex:1;color:var(--subtext)}.files-pill-dir .icon-btn{width:22px;height:22px;margin:-4px -6px -4px 0}button.files-pill-link{cursor:pointer;font:inherit;font-size:12px;color:var(--muted);white-space:nowrap}button.files-pill-link:hover{border-color:var(--muted);color:var(--text)}.files-hint{margin:0;font-size:11.5px;line-height:1.5;color:var(--muted)}.files-hint code{font-family:var(--mono);font-size:10.5px}.files-card{border:1px solid var(--border);border-radius:10px;background:var(--base);overflow:hidden;margin-top:4px}.files-card>*+*{border-top:1px solid var(--border-variant)}.ftree-row{display:flex;align-items:center;gap:8px;padding:8px 14px}.ftree-row.clickable{cursor:pointer}.ftree-row:hover{background:var(--surface)}.ftree-children{background:var(--canvas);border-top:1px solid var(--border-variant)}.ftree-children .ftree-row:hover{background:var(--panel)}.ftree-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ftree-chevron.open{transform:rotate(90deg)}.ftree-chevron.spacer{visibility:hidden}.ftree-dirname{flex:1;min-width:0;font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-title{flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-tag{flex-shrink:0;font-size:11px;color:var(--primary)}.ftree-status{flex-shrink:0;font-family:var(--mono);font-size:10.5px;color:var(--subtext)}.ftree-link{flex:1;min-width:0;display:flex;align-items:center;gap:8px;color:var(--text);text-decoration:none}.ftree-link:hover .ftree-name{text-decoration:underline}.ftree-name{min-width:0;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-thumb{width:22px;height:22px;object-fit:cover;border-radius:4px;border:1px solid var(--border-variant);flex-shrink:0}.ftree-del{width:22px;height:22px;visibility:hidden}.ftree-row:hover .ftree-del{visibility:visible}.ftree-del:hover{color:var(--accent-red)}.ftree-date,.ftree-size{flex-shrink:0}.ftree-size{font-family:var(--mono);font-size:10.5px;color:var(--muted);white-space:nowrap}.ftree-divider{padding:10px 14px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.files-empty{font-size:12.5px;line-height:1.55;color:var(--subtext);border:1px solid var(--border);border-radius:10px;background:var(--base);padding:18px;margin:4px 0 0}.files-empty code{font-family:var(--mono);font-size:11.5px}.files-truncated{margin:0;padding:8px 14px;font-size:11px;color:var(--muted)}.report-date,.ftree-date{font-size:11px;color:var(--muted);white-space:nowrap}.report-view{height:100%;overflow-y:auto;padding:16px 24px 48px}.report-view-col{max-width:var(--readable-col);margin:0 auto}.report-view-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--border-variant)}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:11.5px;color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:8px;background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:8px 8px 0 0}.diff-file-header .chev{color:var(--muted);font-size:10px;flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.7rem;font-weight:700;color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:.65rem;font-weight:700;font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:12.5px}.truncated-notice{border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);padding:12px 14px;font-size:12.5px}.truncated-notice h4{margin:0 0 4px;font-size:13px;color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:12px;line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.report-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--subtext);padding:4px 8px;border-radius:6px}.report-back:hover{color:var(--text);background:var(--surface)}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:22px}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--subtext);font-size:13px}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:12.5px;margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:10px}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:10px}.compute-row.open .compute-row-head:hover{border-radius:10px 10px 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:13px;font-weight:600;color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:6px}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:12px}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:12px;color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:13px;font-weight:600;color:var(--subtext);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{color:var(--text);border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:12.5px}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:500;color:var(--muted)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:11px}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:11.5px;color:var(--subtext);padding:5px 8px;border-radius:6px}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--subtext);padding:5px 4px;border-radius:6px}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:400}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:12.5px;outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12.5px;border-radius:6px}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:10px;color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:11px;color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:6px}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-family:var(--mono);font-size:12px}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:11px;color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--border-variant);border-radius:6px;padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:12px;line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:12px;color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:13.5px}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:6px;background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.prompt-head code{font-family:var(--mono);font-size:11.5px;text-transform:none;color:var(--text)}.prompt-sub{font-family:var(--mono);font-size:12px;color:var(--subtext);word-break:break-word}.prompt-q{font-size:14px;font-weight:600;line-height:1.5;color:var(--text)}.prompt-plan{font-size:13.5px;line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:5px;background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:13px;font-weight:600}.prompt-option-desc{display:block;font-size:12px;font-weight:400;line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:5px;cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:13px;margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:600;word-break:break-word}.prompt-outcome{font-size:12px;color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:13px;color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:600}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:8px;background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:12.5px;cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:8px;padding:9px 11px;font-size:13px;font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:13px;font-weight:600;white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:5px;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:12px;padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:12px}.code-tab-note{padding:8px 16px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:12.5px}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** + * Copyright (c) 2014 The xterm.js authors. All rights reserved. + * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) + * https://github.com/chjj/term.js + * @license MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Originally forked from (with the author's permission): + * Fabrice Bellard's javascript vt100 for jslinux: + * http://bellard.org/jslinux/ + * Copyright (c) 2011 Fabrice Bellard + * The original design remains. The terminal itself + * has been extended to include xterm CSI codes, among + * other features. + */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} diff --git a/ui/dist/assets/index-DgScguTc.js b/ui/dist/assets/index-DgScguTc.js new file mode 100644 index 0000000..d704024 --- /dev/null +++ b/ui/dist/assets/index-DgScguTc.js @@ -0,0 +1,381 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Id={exports:{}},xo={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ey;function uA(){if(Ey)return xo;Ey=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return xo.Fragment=t,xo.jsx=n,xo.jsxs=n,xo}var ky;function hA(){return ky||(ky=1,Id.exports=uA()),Id.exports}var m=hA(),zd={exports:{}},He={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ay;function fA(){if(Ay)return He;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),_=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function S(O,$,U){this.props=O,this.context=$,this.refs=b,this.updater=U||w}S.prototype.isReactComponent={},S.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,$,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function x(){}x.prototype=S.prototype;function y(O,$,U){this.props=O,this.context=$,this.refs=b,this.updater=U||w}var E=y.prototype=new x;E.constructor=y,C(E,S.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function j(O,$,U){var Q=U.ref;return{$$typeof:e,type:O,key:$,ref:Q!==void 0?Q:null,props:U}}function B(O,$){return j(O.type,$,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function Y(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(U){return $[U]})}var H=/\/+/g;function z(O,$){return typeof O=="object"&&O!==null&&O.key!=null?Y(""+O.key):$.toString(36)}function V(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function G(O,$,U,Q,re){var ae=typeof O;(ae==="undefined"||ae==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case t:Z=!0;break;case p:return Z=O._init,G(Z(O._payload),$,U,Q,re)}}if(Z)return re=re(O),Z=Q===""?"."+z(O,0):Q,R(re)?(U="",Z!=null&&(U=Z.replace(H,"$&/")+"/"),G(re,$,U,"",function(ne){return ne})):re!=null&&(F(re)&&(re=B(re,U+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(H,"$&/")+"/")+Z)),$.push(re)),1;Z=0;var P=Q===""?".":Q+":";if(R(O))for(var ee=0;ee<O.length;ee++)Q=O[ee],ae=P+z(Q,ee),Z+=G(Q,$,U,ae,re);else if(ee=v(O),typeof ee=="function")for(O=ee.call(O),ee=0;!(Q=O.next()).done;)Q=Q.value,ae=P+z(Q,ee++),Z+=G(Q,$,U,ae,re);else if(ae==="object"){if(typeof O.then=="function")return G(V(O),$,U,Q,re);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Z}function X(O,$,U){if(O==null)return O;var Q=[],re=0;return G(O,Q,"","",function(ae){return $.call(U,ae,re++)}),Q}function K(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(U){(O._status===0||O._status===-1)&&(O._status=1,O._result=U)},function(U){(O._status===0||O._status===-1)&&(O._status=2,O._result=U)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var L=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},M={map:X,forEach:function(O,$,U){X(O,function(){$.apply(this,arguments)},U)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return He.Activity=d,He.Children=M,He.Component=S,He.Fragment=n,He.Profiler=a,He.PureComponent=y,He.StrictMode=r,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},He.cache=function(O){return function(){return O.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(O,$,U){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Q=C({},O.props),re=O.key;if($!=null)for(ae in $.key!==void 0&&(re=""+$.key),$)!T.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=U;else if(1<ae){for(var Z=Array(ae),P=0;P<ae;P++)Z[P]=arguments[P+2];Q.children=Z}return j(O.type,re,Q)},He.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},He.createElement=function(O,$,U){var Q,re={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)T.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=$[Q]);var Z=arguments.length-2;if(Z===1)re.children=U;else if(1<Z){for(var P=Array(Z),ee=0;ee<Z;ee++)P[ee]=arguments[ee+2];re.children=P}if(O&&O.defaultProps)for(Q in Z=O.defaultProps,Z)re[Q]===void 0&&(re[Q]=Z[Q]);return j(O,ae,re)},He.createRef=function(){return{current:null}},He.forwardRef=function(O){return{$$typeof:o,render:O}},He.isValidElement=F,He.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:K}},He.memo=function(O,$){return{$$typeof:f,type:O,compare:$===void 0?null:$}},He.startTransition=function(O){var $=D.T,U={};D.T=U;try{var Q=O(),re=D.S;re!==null&&re(U,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,L)}catch(ae){L(ae)}finally{$!==null&&U.types!==null&&($.types=U.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(O){return D.H.use(O)},He.useActionState=function(O,$,U){return D.H.useActionState(O,$,U)},He.useCallback=function(O,$){return D.H.useCallback(O,$)},He.useContext=function(O){return D.H.useContext(O)},He.useDebugValue=function(){},He.useDeferredValue=function(O,$){return D.H.useDeferredValue(O,$)},He.useEffect=function(O,$){return D.H.useEffect(O,$)},He.useEffectEvent=function(O){return D.H.useEffectEvent(O)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(O,$,U){return D.H.useImperativeHandle(O,$,U)},He.useInsertionEffect=function(O,$){return D.H.useInsertionEffect(O,$)},He.useLayoutEffect=function(O,$){return D.H.useLayoutEffect(O,$)},He.useMemo=function(O,$){return D.H.useMemo(O,$)},He.useOptimistic=function(O,$){return D.H.useOptimistic(O,$)},He.useReducer=function(O,$,U){return D.H.useReducer(O,$,U)},He.useRef=function(O){return D.H.useRef(O)},He.useState=function(O){return D.H.useState(O)},He.useSyncExternalStore=function(O,$,U){return D.H.useSyncExternalStore(O,$,U)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.7",He}var Ny;function al(){return Ny||(Ny=1,zd.exports=fA()),zd.exports}var q=al();const dA=Pu(q);var Hd={exports:{}},wo={},Fd={exports:{}},Pd={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ty;function pA(){return Ty||(Ty=1,(function(e){function t(G,X){var K=G.length;G.push(X);e:for(;0<K;){var L=K-1>>>1,M=G[L];if(0<a(M,X))G[L]=X,G[K]=M,K=L;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var X=G[0],K=G.pop();if(K!==X){G[0]=K;e:for(var L=0,M=G.length,O=M>>>1;L<O;){var $=2*(L+1)-1,U=G[$],Q=$+1,re=G[Q];if(0>a(U,K))Q<M&&0>a(re,U)?(G[L]=re,G[Q]=K,L=Q):(G[L]=U,G[$]=K,L=$);else if(Q<M&&0>a(re,K))G[L]=re,G[Q]=K,L=Q;else break e}}return X}function a(G,X){var K=G.sortIndex-X.sortIndex;return K!==0?K:G.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,_=3,v=!1,w=!1,C=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(G){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=G)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function R(G){if(C=!1,E(G),!w)if(n(c)!==null)w=!0,N||(N=!0,Y());else{var X=n(f);X!==null&&V(R,X.startTime-G)}}var N=!1,D=-1,T=5,j=-1;function B(){return b?!0:!(e.unstable_now()-j<T)}function F(){if(b=!1,N){var G=e.unstable_now();j=G;var X=!0;try{e:{w=!1,C&&(C=!1,x(D),D=-1),v=!0;var K=_;try{t:{for(E(G),d=n(c);d!==null&&!(d.expirationTime>G&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,_=d.priorityLevel;var M=L(d.expirationTime<=G);if(G=e.unstable_now(),typeof M=="function"){d.callback=M,E(G),X=!0;break t}d===n(c)&&r(c),E(G)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&V(R,O.startTime-G),X=!1}}break e}finally{d=null,_=K,v=!1}X=void 0}}finally{X?Y():N=!1}}}var Y;if(typeof y=="function")Y=function(){y(F)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,z=H.port2;H.port1.onmessage=F,Y=function(){z.postMessage(null)}}else Y=function(){S(F,0)};function V(G,X){D=S(function(){G(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(G){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var K=_;_=X;try{return G()}finally{_=K}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(G,X){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var K=_;_=G;try{return X()}finally{_=K}},e.unstable_scheduleCallback=function(G,X,K){var L=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?L+K:L):K=L,G){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=K+M,G={id:p++,callback:X,priorityLevel:G,startTime:K,expirationTime:M,sortIndex:-1},K>L?(G.sortIndex=K,t(f,G),n(c)===null&&G===n(f)&&(C?(x(D),D=-1):C=!0,V(R,K-L))):(G.sortIndex=M,t(c,G),w||v||(w=!0,N||(N=!0,Y()))),G},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(G){var X=_;return function(){var K=_;_=X;try{return G.apply(this,arguments)}finally{_=K}}}})(Pd)),Pd}var Ry;function gA(){return Ry||(Ry=1,Fd.exports=pA()),Fd.exports}var Ud={exports:{}},Jt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Dy;function mA(){if(Dy)return Jt;Dy=1;var e=al();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(c,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jt.createPortal=function(c,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(c,f,null,p)},Jt.flushSync=function(c){var f=u.T,p=r.p;try{if(u.T=null,r.p=2,c)return c()}finally{u.T=f,r.p=p,r.d.f()}},Jt.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Jt.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Jt.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:_,fetchPriority:v}):p==="script"&&r.d.X(c,{crossOrigin:d,integrity:_,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Jt.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=o(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Jt.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin);r.d.L(c,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Jt.preloadModule=function(c,f){if(typeof c=="string")if(f){var p=o(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Jt.requestFormReset=function(c){r.d.r(c)},Jt.unstable_batchedUpdates=function(c,f){return c(f)},Jt.useFormState=function(c,f,p){return u.H.useFormState(c,f,p)},Jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Jt.version="19.2.7",Jt}var My;function FS(){if(My)return Ud.exports;My=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ud.exports=mA(),Ud.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var jy;function _A(){if(jy)return wo;jy=1;var e=gA(),t=al(),n=FS();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)s+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,h=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(h=s.return),i=s.return;while(i)}return s.tag===3?h:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function o(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var h=i,g=s;;){var k=h.return;if(k===null)break;var A=k.alternate;if(A===null){if(g=k.return,g!==null){h=g;continue}break}if(k.child===A.child){for(A=k.child;A;){if(A===h)return c(k),i;if(A===g)return c(k),s;A=A.sibling}throw Error(r(188))}if(h.return!==g.return)h=k,g=A;else{for(var I=!1,W=k.child;W;){if(W===h){I=!0,h=k,g=A;break}if(W===g){I=!0,g=k,h=A;break}W=W.sibling}if(!I){for(W=A.child;W;){if(W===h){I=!0,h=A,g=k;break}if(W===g){I=!0,g=A,h=k;break}W=W.sibling}if(!I)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var d=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Y(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var H=Symbol.for("react.client.reference");function z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===H?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case y:return i.displayName||"Context";case x:return(i._context.displayName||"Context")+".Consumer";case E:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return s=i.displayName||null,s!==null?s:z(i.type)||"Memo";case T:s=i._payload,i=i._init;try{return z(i(s))}catch{}}return null}var V=Array.isArray,G=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},L=[],M=-1;function O(i){return{current:i}}function $(i){0>M||(i.current=L[M],L[M]=null,M--)}function U(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),ae=O(null),Z=O(null);function P(i,s){switch(U(ae,s),U(re,i),U(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Wv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Wv(s),i=Xv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(Q),U(Q,i)}function ee(){$(Q),$(re),$(ae)}function ne(i){i.memoizedState!==null&&U(Z,i);var s=Q.current,h=Xv(s,i.type);s!==h&&(U(re,i),U(Q,h))}function ge(i){re.current===i&&($(Q),$(re)),Z.current===i&&($(Z),vo._currentValue=K)}var he,ye;function be(i){if(he===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);he=s&&s[1]||"",ye=-1<h.stack.indexOf(` + at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return` +`+he+i+ye}var ke=!1;function Ee(i,s){if(!i||ke)return"";ke=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(s){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(pe){var ue=pe}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(pe){ue=pe}i.call(ve.prototype)}}else{try{throw Error()}catch(pe){ue=pe}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(pe){if(pe&&ue&&typeof pe.stack=="string")return[pe.stack,ue.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=g.DetermineComponentFrameRoot(),I=A[0],W=A[1];if(I&&W){var J=I.split(` +`),ce=W.split(` +`);for(k=g=0;g<J.length&&!J[g].includes("DetermineComponentFrameRoot");)g++;for(;k<ce.length&&!ce[k].includes("DetermineComponentFrameRoot");)k++;if(g===J.length||k===ce.length)for(g=J.length-1,k=ce.length-1;1<=g&&0<=k&&J[g]!==ce[k];)k--;for(;1<=g&&0<=k;g--,k--)if(J[g]!==ce[k]){if(g!==1||k!==1)do if(g--,k--,0>k||J[g]!==ce[k]){var me=` +`+J[g].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=g&&0<=k);break}}}finally{ke=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?be(h):""}function Ce(i,s){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==s&&s!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ee(i.type,!1);case 11:return Ee(i.type.render,!1);case 1:return Ee(i.type,!0);case 31:return be("Activity");default:return""}}function rt(i){try{var s="",h=null;do s+=Ce(i,h),h=i,i=i.return;while(i);return s}catch(g){return` +Error generating stack: `+g.message+` +`+g.stack}}var bt=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,Pt=e.unstable_shouldYield,ht=e.unstable_requestPaint,Fe=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,De=e.unstable_IdlePriority,Ve=e.log,Ie=e.unstable_setDisableYieldValue,Nt=null,Et=null;function qt(i){if(typeof Ve=="function"&&Ie(i),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Nt,i)}catch{}}var st=Math.clz32?Math.clz32:ps,Ln=Math.log,Ut=Math.LN2;function ps(i){return i>>>=0,i===0?32:31-(Ln(i)/Ut|0)|0}var mi=256,_i=262144,vi=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function yi(i,s,h){var g=i.pendingLanes;if(g===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var W=g&134217727;return W!==0?(g=W&~A,g!==0?k=On(g):(I&=W,I!==0?k=On(I):h||(h=W&~i,h!==0&&(k=On(h))))):(W=g&~A,W!==0?k=On(W):I!==0?k=On(I):h||(h=g&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ni(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function oe(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function we(){var i=vi;return vi<<=1,(vi&62914560)===0&&(vi=4194304),i}function Ne(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function qe(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function at(i,s,h,g,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var W=i.entanglements,J=i.expirationTimes,ce=i.hiddenUpdates;for(h=I&~h;0<h;){var me=31-st(h),ve=1<<me;W[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var pe=ue[me];pe!==null&&(pe.lane&=-536870913)}h&=~ve}g!==0&&bi(i,g,0),A!==0&&k===0&&i.tag!==0&&(i.suspendedLanes|=A&~(I&~s))}function bi(i,s,h){i.pendingLanes|=s,i.suspendedLanes&=~s;var g=31-st(s);i.entangledLanes|=s,i.entanglements[g]=i.entanglements[g]|1073741824|h&261930}function nn(i,s){var h=i.entangledLanes|=s;for(i=i.entanglements;h;){var g=31-st(h),k=1<<g;k&s|i[g]&s&&(i[g]|=s),h&=~k}}function gs(i,s){var h=s&-s;return h=(h&42)!==0?1:ka(h),(h&(i.suspendedLanes|s))!==0?0:h}function ka(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Aa(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yl(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:vy(i.type))}function bl(i,s){var h=X.p;try{return X.p=i,s()}finally{X.p=h}}var ii=Math.random().toString(36).slice(2),$t="__reactFiber$"+ii,Qt="__reactProps$"+ii,Si="__reactContainer$"+ii,ms="__reactEvents$"+ii,Sl="__reactListeners$"+ii,Nh="__reactHandles$"+ii,xl="__reactResources$"+ii,Rr="__reactMarker$"+ii;function Na(i){delete i[$t],delete i[Qt],delete i[ms],delete i[Sl],delete i[Nh]}function Yi(i){var s=i[$t];if(s)return s;for(var h=i.parentNode;h;){if(s=h[Si]||h[$t]){if(h=s.alternate,s.child!==null||h!==null&&h.child!==null)for(i=ny(i);i!==null;){if(h=i[$t])return h;i=ny(i)}return s}i=h,h=i.parentNode}return null}function Wi(i){if(i=i[$t]||i[Si]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Xi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ki(i){var s=i[xl];return s||(s=i[xl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[Rr]=!0}var wl=new Set,Cl={};function xi(i,s){Zi(i,s),Zi(i+"Capture",s)}function Zi(i,s){for(Cl[i]=s,i=0;i<s.length;i++)wl.add(s[i])}var Th=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),El={},Ta={};function Rh(i){return bt.call(Ta,i)?!0:bt.call(El,i)?!1:Th.test(i)?Ta[i]=!0:(El[i]=!0,!1)}function _s(i,s,h){if(Rh(s))if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var g=s.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+h)}}function vs(i,s,h){if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+h)}}function qn(i,s,h,g){if(g===null)i.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(s,h,""+g)}}function an(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function kl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Dh(i,s,h){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var k=g.get,A=g.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return k.call(this)},set:function(I){h=""+I,A.call(this,I)}}),Object.defineProperty(i,s,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ra(i){if(!i._valueTracker){var s=kl(i)?"checked":"value";i._valueTracker=Dh(i,s,""+i[s])}}function Dr(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var h=s.getValue(),g="";return i&&(g=kl(i)?i.checked?"true":"false":i.value),i=g,i!==h?(s.setValue(i),!0):!1}function ys(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Al=/[\n"\\]/g;function on(i){return i.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Da(i,s,h,g,k,A,I,W){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?Ma(i,I,an(s)):h!=null?Ma(i,I,an(h)):g!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+an(W):i.removeAttribute("name")}function bs(i,s,h,g,k,A,I,W){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Ra(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,W||s===i.value||(i.value=s),i.defaultValue=s}g=g??k,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=W?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ra(i)}function Ma(i,s,h){s==="number"&&ys(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function Qi(i,s,h,g){if(i=i.options,s){s={};for(var k=0;k<h.length;k++)s["$"+h[k]]=!0;for(h=0;h<i.length;h++)k=s.hasOwnProperty("$"+i[h].value),i[h].selected!==k&&(i[h].selected=k),k&&g&&(i[h].defaultSelected=!0)}else{for(h=""+an(h),s=null,k=0;k<i.length;k++){if(i[k].value===h){i[k].selected=!0,g&&(i[k].defaultSelected=!0);return}s!==null||i[k].disabled||(s=i[k])}s!==null&&(s.selected=!0)}}function ja(i,s,h){if(s!=null&&(s=""+an(s),s!==i.value&&(i.value=s),h==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=h!=null?""+an(h):""}function Gm(i,s,h,g){if(s==null){if(g!=null){if(h!=null)throw Error(r(92));if(V(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),s=h}h=an(s),i.defaultValue=h,g=i.textContent,g===h&&g!==""&&g!==null&&(i.value=g),Ra(i)}function Ss(i,s){if(s){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=s;return}}i.textContent=s}var sE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qm(i,s,h){var g=s.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":g?i.setProperty(s,h):typeof h!="number"||h===0||sE.has(s)?s==="float"?i.cssFloat=h:i[s]=(""+h).trim():i[s]=h+"px"}function Vm(i,s,h){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||s!=null&&s.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var k in s)g=s[k],s.hasOwnProperty(k)&&h[k]!==g&&qm(i,k,g)}else for(var A in s)s.hasOwnProperty(A)&&qm(i,A,s[A])}function Mh(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var aE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),oE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(i){return oE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function wi(){}var jh=null;function Lh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xs=null,ws=null;function Ym(i){var s=Wi(i);if(s&&(i=s.stateNode)){var h=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Da(i,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),s=h.name,h.type==="radio"&&s!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+on(""+s)+'"][type="radio"]'),s=0;s<h.length;s++){var g=h[s];if(g!==i&&g.form===i.form){var k=g[Qt]||null;if(!k)throw Error(r(90));Da(g,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(s=0;s<h.length;s++)g=h[s],g.form===i.form&&Dr(g)}break e;case"textarea":ja(i,h.value,h.defaultValue);break e;case"select":s=h.value,s!=null&&Qi(i,!!h.multiple,s,!1)}}}var Oh=!1;function Wm(i,s,h){if(Oh)return i(s,h);Oh=!0;try{var g=i(s);return g}finally{if(Oh=!1,(xs!==null||ws!==null)&&(gc(),xs&&(s=xs,i=ws,ws=xs=null,Ym(s),i)))for(s=0;s<i.length;s++)Ym(i[s])}}function La(i,s){var h=i.stateNode;if(h===null)return null;var g=h[Qt]||null;if(g===null)return null;h=g[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(r(231,s,typeof h));return h}var Ci=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(Ci)try{var Oa={};Object.defineProperty(Oa,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{Bh=!1}var Ji=null,Ih=null,Tl=null;function Xm(){if(Tl)return Tl;var i,s=Ih,h=s.length,g,k="value"in Ji?Ji.value:Ji.textContent,A=k.length;for(i=0;i<h&&s[i]===k[i];i++);var I=h-i;for(g=1;g<=I&&s[h-g]===k[A-g];g++);return Tl=k.slice(i,1<g?1-g:void 0)}function Rl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Dl(){return!0}function Km(){return!1}function ln(i){function s(h,g,k,A,I){this._reactName=h,this._targetInst=k,this.type=g,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(h=i[W],this[W]=h?h(A):A[W]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Dl:Km,this.isPropagationStopped=Km,this}return d(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Dl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Dl)},persist:function(){},isPersistent:Dl}),s}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=ln(Mr),Ba=d({},Mr,{view:0,detail:0}),lE=ln(Ba),zh,Hh,Ia,jl=d({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ia&&(Ia&&i.type==="mousemove"?(zh=i.screenX-Ia.screenX,Hh=i.screenY-Ia.screenY):Hh=zh=0,Ia=i),zh)},movementY:function(i){return"movementY"in i?i.movementY:Hh}}),Zm=ln(jl),cE=d({},jl,{dataTransfer:0}),uE=ln(cE),hE=d({},Ba,{relatedTarget:0}),Fh=ln(hE),fE=d({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),dE=ln(fE),pE=d({},Mr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),gE=ln(pE),mE=d({},Mr,{data:0}),Qm=ln(mE),_E={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bE(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=yE[i])?!!s[i]:!1}function Ph(){return bE}var SE=d({},Ba,{key:function(i){if(i.key){var s=_E[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Rl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?vE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(i){return i.type==="keypress"?Rl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Rl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),xE=ln(SE),wE=d({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=ln(wE),CE=d({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),EE=ln(CE),kE=d({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),AE=ln(kE),NE=d({},jl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),TE=ln(NE),RE=d({},Mr,{newState:0,oldState:0}),DE=ln(RE),ME=[9,13,27,32],Uh=Ci&&"CompositionEvent"in window,za=null;Ci&&"documentMode"in document&&(za=document.documentMode);var jE=Ci&&"TextEvent"in window&&!za,e0=Ci&&(!Uh||za&&8<za&&11>=za),t0=" ",n0=!1;function i0(i,s){switch(i){case"keyup":return ME.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Cs=!1;function LE(i,s){switch(i){case"compositionend":return r0(s);case"keypress":return s.which!==32?null:(n0=!0,t0);case"textInput":return i=s.data,i===t0&&n0?null:i;default:return null}}function OE(i,s){if(Cs)return i==="compositionend"||!Uh&&i0(i,s)?(i=Xm(),Tl=Ih=Ji=null,Cs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return e0&&s.locale!=="ko"?null:s.data;default:return null}}var BE={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!BE[i.type]:s==="textarea"}function a0(i,s,h,g){xs?ws?ws.push(g):ws=[g]:xs=g,s=xc(s,"onChange"),0<s.length&&(h=new Ml("onChange","change",null,h,g),i.push({event:h,listeners:s}))}var Ha=null,Fa=null;function IE(i){Uv(i,0)}function Ll(i){var s=Xi(i);if(Dr(s))return i}function o0(i,s){if(i==="change")return s}var l0=!1;if(Ci){var $h;if(Ci){var Gh="oninput"in document;if(!Gh){var c0=document.createElement("div");c0.setAttribute("oninput","return;"),Gh=typeof c0.oninput=="function"}$h=Gh}else $h=!1;l0=$h&&(!document.documentMode||9<document.documentMode)}function u0(){Ha&&(Ha.detachEvent("onpropertychange",h0),Fa=Ha=null)}function h0(i){if(i.propertyName==="value"&&Ll(Fa)){var s=[];a0(s,Fa,i,Lh(i)),Wm(IE,s)}}function zE(i,s,h){i==="focusin"?(u0(),Ha=s,Fa=h,Ha.attachEvent("onpropertychange",h0)):i==="focusout"&&u0()}function HE(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ll(Fa)}function FE(i,s){if(i==="click")return Ll(s)}function PE(i,s){if(i==="input"||i==="change")return Ll(s)}function UE(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var yn=typeof Object.is=="function"?Object.is:UE;function Pa(i,s){if(yn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var h=Object.keys(i),g=Object.keys(s);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var k=h[g];if(!bt.call(s,k)||!yn(i[k],s[k]))return!1}return!0}function f0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function d0(i,s){var h=f0(i);i=0;for(var g;h;){if(h.nodeType===3){if(g=i+h.textContent.length,i<=s&&g>=s)return{node:h,offset:s-i};i=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=f0(h)}}function p0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?p0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function g0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=ys(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=ys(i.document)}return s}function qh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var $E=Ci&&"documentMode"in document&&11>=document.documentMode,Es=null,Vh=null,Ua=null,Yh=!1;function m0(i,s,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yh||Es==null||Es!==ys(g)||(g=Es,"selectionStart"in g&&qh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ua&&Pa(Ua,g)||(Ua=g,g=xc(Vh,"onSelect"),0<g.length&&(s=new Ml("onSelect","select",null,s,h),i.push({event:s,listeners:g}),s.target=Es)))}function jr(i,s){var h={};return h[i.toLowerCase()]=s.toLowerCase(),h["Webkit"+i]="webkit"+s,h["Moz"+i]="moz"+s,h}var ks={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Wh={},_0={};Ci&&(_0=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Lr(i){if(Wh[i])return Wh[i];if(!ks[i])return i;var s=ks[i],h;for(h in s)if(s.hasOwnProperty(h)&&h in _0)return Wh[i]=s[h];return i}var v0=Lr("animationend"),y0=Lr("animationiteration"),b0=Lr("animationstart"),GE=Lr("transitionrun"),qE=Lr("transitionstart"),VE=Lr("transitioncancel"),S0=Lr("transitionend"),x0=new Map,Xh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xh.push("scrollEnd");function Vn(i,s){x0.set(i,s),xi(s,[i])}var Ol=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Bn=[],As=0,Kh=0;function Bl(){for(var i=As,s=Kh=As=0;s<i;){var h=Bn[s];Bn[s++]=null;var g=Bn[s];Bn[s++]=null;var k=Bn[s];Bn[s++]=null;var A=Bn[s];if(Bn[s++]=null,g!==null&&k!==null){var I=g.pending;I===null?k.next=k:(k.next=I.next,I.next=k),g.pending=k}A!==0&&w0(h,k,A)}}function Il(i,s,h,g){Bn[As++]=i,Bn[As++]=s,Bn[As++]=h,Bn[As++]=g,Kh|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Zh(i,s,h,g){return Il(i,s,h,g),zl(i)}function Or(i,s){return Il(i,null,null,s),zl(i)}function w0(i,s,h){i.lanes|=h;var g=i.alternate;g!==null&&(g.lanes|=h);for(var k=!1,A=i.return;A!==null;)A.childLanes|=h,g=A.alternate,g!==null&&(g.childLanes|=h),A.tag===22&&(i=A.stateNode,i===null||i._visibility&1||(k=!0)),i=A,A=A.return;return i.tag===3?(A=i.stateNode,k&&s!==null&&(k=31-st(h),i=A.hiddenUpdates,g=i[k],g===null?i[k]=[s]:g.push(s),s.lane=h|536870912),A):null}function zl(i){if(50<uo)throw uo=0,od=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ns={};function YE(i,s,h,g){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(i,s,h,g){return new YE(i,s,h,g)}function Qh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ei(i,s){var h=i.alternate;return h===null?(h=bn(i.tag,s,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=s,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&65011712,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,s=i.dependencies,h.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h.refCleanup=i.refCleanup,h}function C0(i,s){i.flags&=65011714;var h=i.alternate;return h===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=h.childLanes,i.lanes=h.lanes,i.child=h.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=h.memoizedProps,i.memoizedState=h.memoizedState,i.updateQueue=h.updateQueue,i.type=h.type,s=h.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Hl(i,s,h,g,k,A){var I=0;if(g=i,typeof i=="function")Qh(i)&&(I=1);else if(typeof i=="string")I=Qk(i,h,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case j:return i=bn(31,h,s,k),i.elementType=j,i.lanes=A,i;case C:return Br(h.children,k,A,s);case b:I=8,k|=24;break;case S:return i=bn(12,h,s,k|2),i.elementType=S,i.lanes=A,i;case R:return i=bn(13,h,s,k),i.elementType=R,i.lanes=A,i;case N:return i=bn(19,h,s,k),i.elementType=N,i.lanes=A,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case y:I=10;break e;case x:I=9;break e;case E:I=11;break e;case D:I=14;break e;case T:I=16,g=null;break e}I=29,h=Error(r(130,i===null?"null":typeof i,"")),g=null}return s=bn(I,h,s,k),s.elementType=i,s.type=g,s.lanes=A,s}function Br(i,s,h,g){return i=bn(7,i,g,s),i.lanes=h,i}function Jh(i,s,h){return i=bn(6,i,null,s),i.lanes=h,i}function E0(i){var s=bn(18,null,null,0);return s.stateNode=i,s}function ef(i,s,h){return s=bn(4,i.children!==null?i.children:[],i.key,s),s.lanes=h,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var k0=new WeakMap;function In(i,s){if(typeof i=="object"&&i!==null){var h=k0.get(i);return h!==void 0?h:(s={value:i,source:s,stack:rt(s)},k0.set(i,s),s)}return{value:i,source:s,stack:rt(s)}}var Ts=[],Rs=0,Fl=null,$a=0,zn=[],Hn=0,er=null,ri=1,si="";function ki(i,s){Ts[Rs++]=$a,Ts[Rs++]=Fl,Fl=i,$a=s}function A0(i,s,h){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,er=i;var g=ri;i=si;var k=32-st(g)-1;g&=~(1<<k),h+=1;var A=32-st(s)+k;if(30<A){var I=k-k%5;A=(g&(1<<I)-1).toString(32),g>>=I,k-=I,ri=1<<32-st(s)+k|h<<k|g,si=A+i}else ri=1<<A|h<<k|g,si=i}function tf(i){i.return!==null&&(ki(i,1),A0(i,1,0))}function nf(i){for(;i===Fl;)Fl=Ts[--Rs],Ts[Rs]=null,$a=Ts[--Rs],Ts[Rs]=null;for(;i===er;)er=zn[--Hn],zn[Hn]=null,si=zn[--Hn],zn[Hn]=null,ri=zn[--Hn],zn[Hn]=null}function N0(i,s){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,ri=s.id,si=s.overflow,er=i}var Wt=null,St=null,Qe=!1,tr=null,Fn=!1,rf=Error(r(519));function nr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(In(s,i)),rf}function T0(i){var s=i.stateNode,h=i.type,g=i.memoizedProps;switch(s[$t]=i,s[Qt]=g,h){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(h=0;h<fo.length;h++)We(fo[h],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),bs(s,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),Gm(s,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||s.textContent===""+h||g.suppressHydrationWarning===!0||Vv(s.textContent,h)?(g.popover!=null&&(We("beforetoggle",s),We("toggle",s)),g.onScroll!=null&&We("scroll",s),g.onScrollEnd!=null&&We("scrollend",s),g.onClick!=null&&(s.onclick=wi),s=!0):s=!1,s||nr(i,!0)}function R0(i){for(Wt=i.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Wt=Wt.return}}function Ds(i){if(i!==Wt)return!1;if(!Qe)return R0(i),Qe=!0,!1;var s=i.tag,h;if((h=s!==3&&s!==27)&&((h=s===5)&&(h=i.type,h=!(h!=="form"&&h!=="button")||xd(i.type,i.memoizedProps)),h=!h),h&&St&&nr(i),R0(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else s===27?(s=St,mr(i.type)?(i=Ad,Ad=null,St=i):St=s):St=Wt?Un(i.stateNode.nextSibling):null;return!0}function Ir(){St=Wt=null,Qe=!1}function sf(){var i=tr;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),tr=null),i}function Ga(i){tr===null?tr=[i]:tr.push(i)}var af=O(null),zr=null,Ai=null;function ir(i,s,h){U(af,s._currentValue),s._currentValue=h}function Ni(i){i._currentValue=af.current,$(af)}function of(i,s,h){for(;i!==null;){var g=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),i===h)break;i=i.return}}function lf(i,s,h,g){var k=i.child;for(k!==null&&(k.return=i);k!==null;){var A=k.dependencies;if(A!==null){var I=k.child;A=A.firstContext;e:for(;A!==null;){var W=A;A=k;for(var J=0;J<s.length;J++)if(W.context===s[J]){A.lanes|=h,W=A.alternate,W!==null&&(W.lanes|=h),of(A.return,h,i),g||(I=null);break e}A=W.next}}else if(k.tag===18){if(I=k.return,I===null)throw Error(r(341));I.lanes|=h,A=I.alternate,A!==null&&(A.lanes|=h),of(I,h,i),I=null}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===i){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}}function Ms(i,s,h,g){i=null;for(var k=s,A=!1;k!==null;){if(!A){if((k.flags&524288)!==0)A=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var I=k.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var W=k.type;yn(k.pendingProps.value,I.value)||(i!==null?i.push(W):i=[W])}}else if(k===Z.current){if(I=k.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(i!==null?i.push(vo):i=[vo])}k=k.return}i!==null&&lf(s,i,h,g),s.flags|=262144}function Pl(i){for(i=i.firstContext;i!==null;){if(!yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Hr(i){zr=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Xt(i){return D0(zr,i)}function Ul(i,s){return zr===null&&Hr(i),D0(i,s)}function D0(i,s){var h=s._currentValue;if(s={context:s,memoizedValue:h,next:null},Ai===null){if(i===null)throw Error(r(308));Ai=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ai=Ai.next=s;return h}var WE=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(h,g){i.push(g)}};this.abort=function(){s.aborted=!0,i.forEach(function(h){return h()})}},XE=e.unstable_scheduleCallback,KE=e.unstable_NormalPriority,Ot={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cf(){return{controller:new WE,data:new Map,refCount:0}}function qa(i){i.refCount--,i.refCount===0&&XE(KE,function(){i.controller.abort()})}var Va=null,uf=0,js=0,Ls=null;function ZE(i,s){if(Va===null){var h=Va=[];uf=0,js=dd(),Ls={status:"pending",value:void 0,then:function(g){h.push(g)}}}return uf++,s.then(M0,M0),s}function M0(){if(--uf===0&&Va!==null){Ls!==null&&(Ls.status="fulfilled");var i=Va;Va=null,js=0,Ls=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function QE(i,s){var h=[],g={status:"pending",value:null,reason:null,then:function(k){h.push(k)}};return i.then(function(){g.status="fulfilled",g.value=s;for(var k=0;k<h.length;k++)(0,h[k])(s)},function(k){for(g.status="rejected",g.reason=k,k=0;k<h.length;k++)(0,h[k])(void 0)}),g}var j0=G.S;G.S=function(i,s){mv=Fe(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&ZE(i,s),j0!==null&&j0(i,s)};var Fr=O(null);function hf(){var i=Fr.current;return i!==null?i:_t.pooledCache}function $l(i,s){s===null?U(Fr,Fr.current):U(Fr,s.pool)}function L0(){var i=hf();return i===null?null:{parent:Ot._currentValue,pool:i}}var Os=Error(r(460)),ff=Error(r(474)),Gl=Error(r(542)),ql={then:function(){}};function O0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function B0(i,s,h){switch(h=i[h],h===void 0?i.push(s):h!==s&&(s.then(wi,wi),s=h),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i;default:if(typeof s.status=="string")s.then(wi,wi);else{if(i=_t,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var k=s;k.status="fulfilled",k.value=g}},function(g){if(s.status==="pending"){var k=s;k.status="rejected",k.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i}throw Ur=s,Os}}function Pr(i){try{var s=i._init;return s(i._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ur=h,Os):h}}var Ur=null;function I0(){if(Ur===null)throw Error(r(459));var i=Ur;return Ur=null,i}function z0(i){if(i===Os||i===Gl)throw Error(r(483))}var Bs=null,Ya=0;function Vl(i){var s=Ya;return Ya+=1,Bs===null&&(Bs=[]),B0(Bs,i,s)}function Wa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Yl(i,s){throw s.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function H0(i){function s(se,te){if(i){var le=se.deletions;le===null?(se.deletions=[te],se.flags|=16):le.push(te)}}function h(se,te){if(!i)return null;for(;te!==null;)s(se,te),te=te.sibling;return null}function g(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function k(se,te){return se=Ei(se,te),se.index=0,se.sibling=null,se}function A(se,te,le){return se.index=le,i?(le=se.alternate,le!==null?(le=le.index,le<te?(se.flags|=67108866,te):le):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function I(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function W(se,te,le,_e){return te===null||te.tag!==6?(te=Jh(le,se.mode,_e),te.return=se,te):(te=k(te,le),te.return=se,te)}function J(se,te,le,_e){var Le=le.type;return Le===C?me(se,te,le.props.children,_e,le.key):te!==null&&(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type)?(te=k(te,le.props),Wa(te,le),te.return=se,te):(te=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(te,le),te.return=se,te)}function ce(se,te,le,_e){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=ef(le,se.mode,_e),te.return=se,te):(te=k(te,le.children||[]),te.return=se,te)}function me(se,te,le,_e,Le){return te===null||te.tag!==7?(te=Br(le,se.mode,_e,Le),te.return=se,te):(te=k(te,le),te.return=se,te)}function ve(se,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Jh(""+te,se.mode,le),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return le=Hl(te.type,te.key,te.props,null,se.mode,le),Wa(le,te),le.return=se,le;case w:return te=ef(te,se.mode,le),te.return=se,te;case T:return te=Pr(te),ve(se,te,le)}if(V(te)||Y(te))return te=Br(te,se.mode,le,null),te.return=se,te;if(typeof te.then=="function")return ve(se,Vl(te),le);if(te.$$typeof===y)return ve(se,Ul(se,te),le);Yl(se,te)}return null}function ue(se,te,le,_e){var Le=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Le!==null?null:W(se,te,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return le.key===Le?J(se,te,le,_e):null;case w:return le.key===Le?ce(se,te,le,_e):null;case T:return le=Pr(le),ue(se,te,le,_e)}if(V(le)||Y(le))return Le!==null?null:me(se,te,le,_e,null);if(typeof le.then=="function")return ue(se,te,Vl(le),_e);if(le.$$typeof===y)return ue(se,te,Ul(se,le),_e);Yl(se,le)}return null}function pe(se,te,le,_e,Le){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return se=se.get(le)||null,W(te,se,""+_e,Le);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return se=se.get(_e.key===null?le:_e.key)||null,J(te,se,_e,Le);case w:return se=se.get(_e.key===null?le:_e.key)||null,ce(te,se,_e,Le);case T:return _e=Pr(_e),pe(se,te,le,_e,Le)}if(V(_e)||Y(_e))return se=se.get(le)||null,me(te,se,_e,Le,null);if(typeof _e.then=="function")return pe(se,te,le,Vl(_e),Le);if(_e.$$typeof===y)return pe(se,te,le,Ul(te,_e),Le);Yl(te,_e)}return null}function Te(se,te,le,_e){for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null;Re!==null&&Ue<le.length;Ue++){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var it=ue(se,Re,le[Ue],_e);if(it===null){Re===null&&(Re=Ze);break}i&&Re&&it.alternate===null&&s(se,Re),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it,Re=Ze}if(Ue===le.length)return h(se,Re),Qe&&ki(se,Ue),Le;if(Re===null){for(;Ue<le.length;Ue++)Re=ve(se,le[Ue],_e),Re!==null&&(te=A(Re,te,Ue),nt===null?Le=Re:nt.sibling=Re,nt=Re);return Qe&&ki(se,Ue),Le}for(Re=g(Re);Ue<le.length;Ue++)Ze=pe(Re,se,Ue,le[Ue],_e),Ze!==null&&(i&&Ze.alternate!==null&&Re.delete(Ze.key===null?Ue:Ze.key),te=A(Ze,te,Ue),nt===null?Le=Ze:nt.sibling=Ze,nt=Ze);return i&&Re.forEach(function(Sr){return s(se,Sr)}),Qe&&ki(se,Ue),Le}function Be(se,te,le,_e){if(le==null)throw Error(r(151));for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null,it=le.next();Re!==null&&!it.done;Ue++,it=le.next()){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var Sr=ue(se,Re,it.value,_e);if(Sr===null){Re===null&&(Re=Ze);break}i&&Re&&Sr.alternate===null&&s(se,Re),te=A(Sr,te,Ue),nt===null?Le=Sr:nt.sibling=Sr,nt=Sr,Re=Ze}if(it.done)return h(se,Re),Qe&&ki(se,Ue),Le;if(Re===null){for(;!it.done;Ue++,it=le.next())it=ve(se,it.value,_e),it!==null&&(te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return Qe&&ki(se,Ue),Le}for(Re=g(Re);!it.done;Ue++,it=le.next())it=pe(Re,se,Ue,it.value,_e),it!==null&&(i&&it.alternate!==null&&Re.delete(it.key===null?Ue:it.key),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return i&&Re.forEach(function(cA){return s(se,cA)}),Qe&&ki(se,Ue),Le}function mt(se,te,le,_e){if(typeof le=="object"&&le!==null&&le.type===C&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case v:e:{for(var Le=le.key;te!==null;){if(te.key===Le){if(Le=le.type,Le===C){if(te.tag===7){h(se,te.sibling),_e=k(te,le.props.children),_e.return=se,se=_e;break e}}else if(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type){h(se,te.sibling),_e=k(te,le.props),Wa(_e,le),_e.return=se,se=_e;break e}h(se,te);break}else s(se,te);te=te.sibling}le.type===C?(_e=Br(le.props.children,se.mode,_e,le.key),_e.return=se,se=_e):(_e=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(_e,le),_e.return=se,se=_e)}return I(se);case w:e:{for(Le=le.key;te!==null;){if(te.key===Le)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){h(se,te.sibling),_e=k(te,le.children||[]),_e.return=se,se=_e;break e}else{h(se,te);break}else s(se,te);te=te.sibling}_e=ef(le,se.mode,_e),_e.return=se,se=_e}return I(se);case T:return le=Pr(le),mt(se,te,le,_e)}if(V(le))return Te(se,te,le,_e);if(Y(le)){if(Le=Y(le),typeof Le!="function")throw Error(r(150));return le=Le.call(le),Be(se,te,le,_e)}if(typeof le.then=="function")return mt(se,te,Vl(le),_e);if(le.$$typeof===y)return mt(se,te,Ul(se,le),_e);Yl(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(h(se,te.sibling),_e=k(te,le),_e.return=se,se=_e):(h(se,te),_e=Jh(le,se.mode,_e),_e.return=se,se=_e),I(se)):h(se,te)}return function(se,te,le,_e){try{Ya=0;var Le=mt(se,te,le,_e);return Bs=null,Le}catch(Re){if(Re===Os||Re===Gl)throw Re;var nt=bn(29,Re,null,se.mode);return nt.lanes=_e,nt.return=se,nt}finally{}}}var $r=H0(!0),F0=H0(!1),rr=!1;function df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function sr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ar(i,s,h){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(ot&2)!==0){var k=g.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),g.pending=s,s=zl(i),w0(i,null,h),s}return Il(i,g,s,h),zl(i)}function Xa(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}function gf(i,s){var h=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:g.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:g.shared,callbacks:g.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var mf=!1;function Ka(){if(mf){var i=Ls;if(i!==null)throw i}}function Za(i,s,h,g){mf=!1;var k=i.updateQueue;rr=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,W=k.shared.pending;if(W!==null){k.shared.pending=null;var J=W,ce=J.next;J.next=null,I===null?A=ce:I.next=ce,I=J;var me=i.alternate;me!==null&&(me=me.updateQueue,W=me.lastBaseUpdate,W!==I&&(W===null?me.firstBaseUpdate=ce:W.next=ce,me.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,me=ce=J=null,W=A;do{var ue=W.lane&-536870913,pe=ue!==W.lane;if(pe?(Ke&ue)===ue:(g&ue)===ue){ue!==0&&ue===js&&(mf=!0),me!==null&&(me=me.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Te=i,Be=W;ue=s;var mt=h;switch(Be.tag){case 1:if(Te=Be.payload,typeof Te=="function"){ve=Te.call(mt,ve,ue);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Be.payload,ue=typeof Te=="function"?Te.call(mt,ve,ue):Te,ue==null)break e;ve=d({},ve,ue);break e;case 2:rr=!0}}ue=W.callback,ue!==null&&(i.flags|=64,pe&&(i.flags|=8192),pe=k.callbacks,pe===null?k.callbacks=[ue]:pe.push(ue))}else pe={lane:ue,tag:W.tag,payload:W.payload,callback:W.callback,next:null},me===null?(ce=me=pe,J=ve):me=me.next=pe,I|=ue;if(W=W.next,W===null){if(W=k.shared.pending,W===null)break;pe=W,W=pe.next,pe.next=null,k.lastBaseUpdate=pe,k.shared.pending=null}}while(!0);me===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=ce,k.lastBaseUpdate=me,A===null&&(k.shared.lanes=0),hr|=I,i.lanes=I,i.memoizedState=ve}}function P0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function U0(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;i<h.length;i++)P0(h[i],s)}var Is=O(null),Wl=O(0);function $0(i,s){i=Ii,U(Wl,i),U(Is,s),Ii=i|s.baseLanes}function _f(){U(Wl,Ii),U(Is,Is.current)}function vf(){Ii=Wl.current,$(Is),$(Wl)}var Sn=O(null),Pn=null;function or(i){var s=i.alternate;U(Mt,Mt.current&1),U(Sn,i),Pn===null&&(s===null||Is.current!==null||s.memoizedState!==null)&&(Pn=i)}function yf(i){U(Mt,Mt.current),U(Sn,i),Pn===null&&(Pn=i)}function G0(i){i.tag===22?(U(Mt,Mt.current),U(Sn,i),Pn===null&&(Pn=i)):lr()}function lr(){U(Mt,Mt.current),U(Sn,Sn.current)}function xn(i){$(Sn),Pn===i&&(Pn=null),$(Mt)}var Mt=O(0);function Xl(i){for(var s=i;s!==null;){if(s.tag===13){var h=s.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ed(h)||kd(h)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ti=0,Pe=null,pt=null,Bt=null,Kl=!1,zs=!1,Gr=!1,Zl=0,Qa=0,Hs=null,JE=0;function Tt(){throw Error(r(321))}function bf(i,s){if(s===null)return!1;for(var h=0;h<s.length&&h<i.length;h++)if(!yn(i[h],s[h]))return!1;return!0}function Sf(i,s,h,g,k,A){return Ti=A,Pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,G.H=i===null||i.memoizedState===null?A_:Bf,Gr=!1,A=h(g,k),Gr=!1,zs&&(A=V0(s,h,g,k)),q0(i),A}function q0(i){G.H=to;var s=pt!==null&&pt.next!==null;if(Ti=0,Bt=pt=Pe=null,Kl=!1,Qa=0,Hs=null,s)throw Error(r(300));i===null||It||(i=i.dependencies,i!==null&&Pl(i)&&(It=!0))}function V0(i,s,h,g){Pe=i;var k=0;do{if(zs&&(Hs=null),Qa=0,zs=!1,25<=k)throw Error(r(301));if(k+=1,Bt=pt=null,i.updateQueue!=null){var A=i.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}G.H=N_,A=s(h,g)}while(zs);return A}function ek(){var i=G.H,s=i.useState()[0];return s=typeof s.then=="function"?Ja(s):s,i=i.useState()[0],(pt!==null?pt.memoizedState:null)!==i&&(Pe.flags|=1024),s}function xf(){var i=Zl!==0;return Zl=0,i}function wf(i,s,h){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~h}function Cf(i){if(Kl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Kl=!1}Ti=0,Bt=pt=Pe=null,zs=!1,Qa=Zl=0,Hs=null}function rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i,Bt}function jt(){if(pt===null){var i=Pe.alternate;i=i!==null?i.memoizedState:null}else i=pt.next;var s=Bt===null?Pe.memoizedState:Bt.next;if(s!==null)Bt=s,pt=i;else{if(i===null)throw Pe.alternate===null?Error(r(467)):Error(r(310));pt=i,i={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i}return Bt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var s=Qa;return Qa+=1,Hs===null&&(Hs=[]),i=B0(Hs,i,s),s=Pe,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,G.H=s===null||s.memoizedState===null?A_:Bf),i}function Jl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===y)return Xt(i)}throw Error(r(438,String(i)))}function Ef(i){var s=null,h=Pe.updateQueue;if(h!==null&&(s=h.memoCache),s==null){var g=Pe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(s={data:g.data.map(function(k){return k.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),h===null&&(h=Ql(),Pe.updateQueue=h),h.memoCache=s,h=s.data[s.index],h===void 0)for(h=s.data[s.index]=Array(i),g=0;g<i;g++)h[g]=B;return s.index++,h}function Ri(i,s){return typeof s=="function"?s(i):s}function ec(i){var s=jt();return kf(s,pt,i)}function kf(i,s,h){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var k=i.baseQueue,A=g.pending;if(A!==null){if(k!==null){var I=k.next;k.next=A.next,A.next=I}s.baseQueue=k=A,g.pending=null}if(A=i.baseState,k===null)i.memoizedState=A;else{s=k.next;var W=I=null,J=null,ce=s,me=!1;do{var ve=ce.lane&-536870913;if(ve!==ce.lane?(Ke&ve)===ve:(Ti&ve)===ve){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ve===js&&(me=!0);else if((Ti&ue)===ue){ce=ce.next,ue===js&&(me=!0);continue}else ve={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ve,I=A):J=J.next=ve,Pe.lanes|=ue,hr|=ue;ve=ce.action,Gr&&h(A,ve),A=ce.hasEagerState?ce.eagerState:h(A,ve)}else ue={lane:ve,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ue,I=A):J=J.next=ue,Pe.lanes|=ve,hr|=ve;ce=ce.next}while(ce!==null&&ce!==s);if(J===null?I=A:J.next=W,!yn(A,i.memoizedState)&&(It=!0,me&&(h=Ls,h!==null)))throw h;i.memoizedState=A,i.baseState=I,i.baseQueue=J,g.lastRenderedState=A}return k===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Af(i){var s=jt(),h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=i;var g=h.dispatch,k=h.pending,A=s.memoizedState;if(k!==null){h.pending=null;var I=k=k.next;do A=i(A,I.action),I=I.next;while(I!==k);yn(A,s.memoizedState)||(It=!0),s.memoizedState=A,s.baseQueue===null&&(s.baseState=A),h.lastRenderedState=A}return[A,g]}function Y0(i,s,h){var g=Pe,k=jt(),A=Qe;if(A){if(h===void 0)throw Error(r(407));h=h()}else h=s();var I=!yn((pt||k).memoizedState,h);if(I&&(k.memoizedState=h,It=!0),k=k.queue,Rf(K0.bind(null,g,k,i),[i]),k.getSnapshot!==s||I||Bt!==null&&Bt.memoizedState.tag&1){if(g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,k,h,s),null),_t===null)throw Error(r(349));A||(Ti&127)!==0||W0(g,s,h)}return h}function W0(i,s,h){i.flags|=16384,i={getSnapshot:s,value:h},s=Pe.updateQueue,s===null?(s=Ql(),Pe.updateQueue=s,s.stores=[i]):(h=s.stores,h===null?s.stores=[i]:h.push(i))}function X0(i,s,h,g){s.value=h,s.getSnapshot=g,Z0(s)&&Q0(i)}function K0(i,s,h){return h(function(){Z0(s)&&Q0(i)})}function Z0(i){var s=i.getSnapshot;i=i.value;try{var h=s();return!yn(i,h)}catch{return!0}}function Q0(i){var s=Or(i,2);s!==null&&dn(s,i,2)}function Nf(i){var s=rn();if(typeof i=="function"){var h=i;if(i=h(),Gr){qt(!0);try{h()}finally{qt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},s}function J0(i,s,h,g){return i.baseState=h,kf(i,pt,typeof g=="function"?g:Ri)}function tk(i,s,h,g,k){if(ic(i))throw Error(r(485));if(i=s.action,i!==null){var A={payload:k,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};G.T!==null?h(!0):A.isTransition=!1,g(A),h=s.pending,h===null?(A.next=s.pending=A,e_(s,A)):(A.next=h.next,s.pending=h.next=A)}}function e_(i,s){var h=s.action,g=s.payload,k=i.state;if(s.isTransition){var A=G.T,I={};G.T=I;try{var W=h(k,g),J=G.S;J!==null&&J(I,W),t_(i,s,W)}catch(ce){Tf(i,s,ce)}finally{A!==null&&I.types!==null&&(A.types=I.types),G.T=A}}else try{A=h(k,g),t_(i,s,A)}catch(ce){Tf(i,s,ce)}}function t_(i,s,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){n_(i,s,g)},function(g){return Tf(i,s,g)}):n_(i,s,h)}function n_(i,s,h){s.status="fulfilled",s.value=h,i_(s),i.state=h,s=i.pending,s!==null&&(h=s.next,h===s?i.pending=null:(h=h.next,s.next=h,e_(i,h)))}function Tf(i,s,h){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do s.status="rejected",s.reason=h,i_(s),s=s.next;while(s!==g)}i.action=null}function i_(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function r_(i,s){return s}function s_(i,s){if(Qe){var h=_t.formState;if(h!==null){e:{var g=Pe;if(Qe){if(St){t:{for(var k=St,A=Fn;k.nodeType!==8;){if(!A){k=null;break t}if(k=Un(k.nextSibling),k===null){k=null;break t}}A=k.data,k=A==="F!"||A==="F"?k:null}if(k){St=Un(k.nextSibling),g=k.data==="F!";break e}}nr(g)}g=!1}g&&(s=h[0])}}return h=rn(),h.memoizedState=h.baseState=s,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r_,lastRenderedState:s},h.queue=g,h=C_.bind(null,Pe,g),g.dispatch=h,g=Nf(!1),A=Of.bind(null,Pe,!1,g.queue),g=rn(),k={state:s,dispatch:null,action:i,pending:null},g.queue=k,h=tk.bind(null,Pe,k,A,h),k.dispatch=h,g.memoizedState=i,[s,h,!1]}function a_(i){var s=jt();return o_(s,pt,i)}function o_(i,s,h){if(s=kf(i,s,r_)[0],i=ec(Ri)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var g=Ja(s)}catch(I){throw I===Os?Gl:I}else g=s;s=jt();var k=s.queue,A=k.dispatch;return h!==s.memoizedState&&(Pe.flags|=2048,Fs(9,{destroy:void 0},nk.bind(null,k,h),null)),[g,A,i]}function nk(i,s){i.action=s}function l_(i){var s=jt(),h=pt;if(h!==null)return o_(s,h,i);jt(),s=s.memoizedState,h=jt();var g=h.queue.dispatch;return h.memoizedState=i,[s,g,!1]}function Fs(i,s,h,g){return i={tag:i,create:h,deps:g,inst:s,next:null},s=Pe.updateQueue,s===null&&(s=Ql(),Pe.updateQueue=s),h=s.lastEffect,h===null?s.lastEffect=i.next=i:(g=h.next,h.next=i,i.next=g,s.lastEffect=i),i}function c_(){return jt().memoizedState}function tc(i,s,h,g){var k=rn();Pe.flags|=i,k.memoizedState=Fs(1|s,{destroy:void 0},h,g===void 0?null:g)}function nc(i,s,h,g){var k=jt();g=g===void 0?null:g;var A=k.memoizedState.inst;pt!==null&&g!==null&&bf(g,pt.memoizedState.deps)?k.memoizedState=Fs(s,A,h,g):(Pe.flags|=i,k.memoizedState=Fs(1|s,A,h,g))}function u_(i,s){tc(8390656,8,i,s)}function Rf(i,s){nc(2048,8,i,s)}function ik(i){Pe.flags|=4;var s=Pe.updateQueue;if(s===null)s=Ql(),Pe.updateQueue=s,s.events=[i];else{var h=s.events;h===null?s.events=[i]:h.push(i)}}function h_(i){var s=jt().memoizedState;return ik({ref:s,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function f_(i,s){return nc(4,2,i,s)}function d_(i,s){return nc(4,4,i,s)}function p_(i,s){if(typeof s=="function"){i=i();var h=s(i);return function(){typeof h=="function"?h():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function g_(i,s,h){h=h!=null?h.concat([i]):null,nc(4,4,p_.bind(null,s,i),h)}function Df(){}function m_(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;return s!==null&&bf(s,g[1])?g[0]:(h.memoizedState=[i,s],i)}function __(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;if(s!==null&&bf(s,g[1]))return g[0];if(g=i(),Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g}function Mf(i,s,h){return h===void 0||(Ti&1073741824)!==0&&(Ke&261930)===0?i.memoizedState=s:(i.memoizedState=h,i=vv(),Pe.lanes|=i,hr|=i,h)}function v_(i,s,h,g){return yn(h,s)?h:Is.current!==null?(i=Mf(i,h,g),yn(i,s)||(It=!0),i):(Ti&42)===0||(Ti&1073741824)!==0&&(Ke&261930)===0?(It=!0,i.memoizedState=h):(i=vv(),Pe.lanes|=i,hr|=i,s)}function y_(i,s,h,g,k){var A=X.p;X.p=A!==0&&8>A?A:8;var I=G.T,W={};G.T=W,Of(i,!1,s,h);try{var J=k(),ce=G.S;if(ce!==null&&ce(W,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=QE(J,g);eo(i,s,me,En(i))}else eo(i,s,g,En(i))}catch(ve){eo(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&W.types!==null&&(I.types=W.types),G.T=I}}function rk(){}function jf(i,s,h,g){if(i.tag!==5)throw Error(r(476));var k=b_(i).queue;y_(i,k,s,K,h===null?rk:function(){return S_(i),h(g)})}function b_(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function S_(i){var s=b_(i);s.next===null&&(s=i.alternate.memoizedState),eo(i,s.next.queue,{},En())}function Lf(){return Xt(vo)}function x_(){return jt().memoizedState}function w_(){return jt().memoizedState}function sk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=sr(h);var g=ar(s,i,h);g!==null&&(dn(g,s,h),Xa(g,s,h)),s={cache:cf()},i.payload=s;return}s=s.return}}function ak(i,s,h){var g=En();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ic(i)?E_(s,h):(h=Zh(i,s,h,g),h!==null&&(dn(h,i,g),k_(h,s,g)))}function C_(i,s,h){var g=En();eo(i,s,h,g)}function eo(i,s,h,g){var k={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ic(i))E_(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,W=A(I,h);if(k.hasEagerState=!0,k.eagerState=W,yn(W,I))return Il(i,s,k,0),_t===null&&Bl(),!1}catch{}finally{}if(h=Zh(i,s,k,g),h!==null)return dn(h,i,g),k_(h,s,g),!0}return!1}function Of(i,s,h,g){if(g={lane:2,revertLane:dd(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ic(i)){if(s)throw Error(r(479))}else s=Zh(i,h,g,2),s!==null&&dn(s,i,2)}function ic(i){var s=i.alternate;return i===Pe||s!==null&&s===Pe}function E_(i,s){zs=Kl=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function k_(i,s,h){if((h&4194048)!==0){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}var to={readContext:Xt,use:Jl,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};to.useEffectEvent=Tt;var A_={readContext:Xt,use:Jl,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Xt,useEffect:u_,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,tc(4194308,4,p_.bind(null,s,i),h)},useLayoutEffect:function(i,s){return tc(4194308,4,i,s)},useInsertionEffect:function(i,s){tc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var g=i();if(Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g},useReducer:function(i,s,h){var g=rn();if(h!==void 0){var k=h(s);if(Gr){qt(!0);try{h(s)}finally{qt(!1)}}}else k=s;return g.memoizedState=g.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},g.queue=i,i=i.dispatch=ak.bind(null,Pe,i),[g.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Nf(i);var s=i.queue,h=C_.bind(null,Pe,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:Df,useDeferredValue:function(i,s){var h=rn();return Mf(h,i,s)},useTransition:function(){var i=Nf(!1);return i=y_.bind(null,Pe,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var g=Pe,k=rn();if(Qe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),_t===null)throw Error(r(349));(Ke&127)!==0||W0(g,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,u_(K0.bind(null,g,A,i),[i]),g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,A,h,s),null),h},useId:function(){var i=rn(),s=_t.identifierPrefix;if(Qe){var h=si,g=ri;h=(g&~(1<<32-st(g)-1)).toString(32)+h,s="_"+s+"R_"+h,h=Zl++,0<h&&(s+="H"+h.toString(32)),s+="_"}else h=JE++,s="_"+s+"r_"+h.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Lf,useFormState:s_,useActionState:s_,useOptimistic:function(i){var s=rn();s.memoizedState=s.baseState=i;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=h,s=Of.bind(null,Pe,!0,h),h.dispatch=s,[i,s]},useMemoCache:Ef,useCacheRefresh:function(){return rn().memoizedState=sk.bind(null,Pe)},useEffectEvent:function(i){var s=rn(),h={impl:i};return s.memoizedState=h,function(){if((ot&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Bf={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:ec,useRef:c_,useState:function(){return ec(Ri)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=ec(Ri)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:a_,useActionState:a_,useOptimistic:function(i,s){var h=jt();return J0(h,pt,i,s)},useMemoCache:Ef,useCacheRefresh:w_};Bf.useEffectEvent=h_;var N_={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:Af,useRef:c_,useState:function(){return Af(Ri)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return pt===null?Mf(h,i,s):v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=Af(Ri)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:l_,useActionState:l_,useOptimistic:function(i,s){var h=jt();return pt!==null?J0(h,pt,i,s):(h.baseState=i,[i,h.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:w_};N_.useEffectEvent=h_;function If(i,s,h,g){s=i.memoizedState,h=h(g,s),h=h==null?s:d({},s,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var zf={enqueueSetState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueReplaceState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.tag=1,k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var h=En(),g=sr(h);g.tag=2,s!=null&&(g.callback=s),s=ar(i,g,h),s!==null&&(dn(s,i,h),Xa(s,i,h))}};function T_(i,s,h,g,k,A,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,A,I):s.prototype&&s.prototype.isPureReactComponent?!Pa(h,g)||!Pa(k,A):!0}function R_(i,s,h,g){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(h,g),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(h,g),s.state!==i&&zf.enqueueReplaceState(s,s.state,null)}function qr(i,s){var h=s;if("ref"in s){h={};for(var g in s)g!=="ref"&&(h[g]=s[g])}if(i=i.defaultProps){h===s&&(h=d({},h));for(var k in i)h[k]===void 0&&(h[k]=i[k])}return h}function D_(i){Ol(i)}function M_(i){console.error(i)}function j_(i){Ol(i)}function rc(i,s){try{var h=i.onUncaughtError;h(s.value,{componentStack:s.stack})}catch(g){setTimeout(function(){throw g})}}function L_(i,s,h){try{var g=i.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Hf(i,s,h){return h=sr(h),h.tag=3,h.payload={element:null},h.callback=function(){rc(i,s)},h}function O_(i){return i=sr(i),i.tag=3,i}function B_(i,s,h,g){var k=h.type.getDerivedStateFromError;if(typeof k=="function"){var A=g.value;i.payload=function(){return k(A)},i.callback=function(){L_(s,h,g)}}var I=h.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){L_(s,h,g),typeof k!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var W=g.stack;this.componentDidCatch(g.value,{componentStack:W!==null?W:""})})}function ok(i,s,h,g,k){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(s=h.alternate,s!==null&&Ms(s,h,k,!0),h=Sn.current,h!==null){switch(h.tag){case 31:case 13:return Pn===null?mc():h.alternate===null&&Rt===0&&(Rt=3),h.flags&=-257,h.flags|=65536,h.lanes=k,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?h.updateQueue=new Set([g]):s.add(g),ud(i,g,k)),!1;case 22:return h.flags|=65536,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=s):(h=s.retryQueue,h===null?s.retryQueue=new Set([g]):h.add(g)),ud(i,g,k)),!1}throw Error(r(435,h.tag))}return ud(i,g,k),mc(),!1}if(Qe)return s=Sn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=k,g!==rf&&(i=Error(r(422),{cause:g}),Ga(In(i,h)))):(g!==rf&&(s=Error(r(423),{cause:g}),Ga(In(s,h))),i=i.current.alternate,i.flags|=65536,k&=-k,i.lanes|=k,g=In(g,h),k=Hf(i.stateNode,g,k),gf(i,k),Rt!==4&&(Rt=2)),!1;var A=Error(r(520),{cause:g});if(A=In(A,h),co===null?co=[A]:co.push(A),Rt!==4&&(Rt=2),s===null)return!0;g=In(g,h),h=s;do{switch(h.tag){case 3:return h.flags|=65536,i=k&-k,h.lanes|=i,i=Hf(h.stateNode,g,i),gf(h,i),!1;case 1:if(s=h.type,A=h.stateNode,(h.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(fr===null||!fr.has(A))))return h.flags|=65536,k&=-k,h.lanes|=k,k=O_(k),B_(k,i,h,g),gf(h,k),!1}h=h.return}while(h!==null);return!1}var Ff=Error(r(461)),It=!1;function Kt(i,s,h,g){s.child=i===null?F0(s,null,h,g):$r(s,i.child,h,g)}function I_(i,s,h,g,k){h=h.render;var A=s.ref;if("ref"in g){var I={};for(var W in g)W!=="ref"&&(I[W]=g[W])}else I=g;return Hr(s),g=Sf(i,s,h,I,A,k),W=xf(),i!==null&&!It?(wf(i,s,k),Di(i,s,k)):(Qe&&W&&tf(s),s.flags|=1,Kt(i,s,g,k),s.child)}function z_(i,s,h,g,k){if(i===null){var A=h.type;return typeof A=="function"&&!Qh(A)&&A.defaultProps===void 0&&h.compare===null?(s.tag=15,s.type=A,H_(i,s,A,g,k)):(i=Hl(h.type,null,g,s,s.mode,k),i.ref=s.ref,i.return=s,s.child=i)}if(A=i.child,!Wf(i,k)){var I=A.memoizedProps;if(h=h.compare,h=h!==null?h:Pa,h(I,g)&&i.ref===s.ref)return Di(i,s,k)}return s.flags|=1,i=Ei(A,g),i.ref=s.ref,i.return=s,s.child=i}function H_(i,s,h,g,k){if(i!==null){var A=i.memoizedProps;if(Pa(A,g)&&i.ref===s.ref)if(It=!1,s.pendingProps=g=A,Wf(i,k))(i.flags&131072)!==0&&(It=!0);else return s.lanes=i.lanes,Di(i,s,k)}return Pf(i,s,h,g,k)}function F_(i,s,h,g){var k=g.children,A=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((s.flags&128)!==0){if(A=A!==null?A.baseLanes|h:h,i!==null){for(g=s.child=i.child,k=0;g!==null;)k=k|g.lanes|g.childLanes,g=g.sibling;g=k&~A}else g=0,s.child=null;return P_(i,s,A,h,g)}if((h&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&$l(s,A!==null?A.cachePool:null),A!==null?$0(s,A):_f(),G0(s);else return g=s.lanes=536870912,P_(i,s,A!==null?A.baseLanes|h:h,h,g)}else A!==null?($l(s,A.cachePool),$0(s,A),lr(),s.memoizedState=null):(i!==null&&$l(s,null),_f(),lr());return Kt(i,s,k,h),s.child}function no(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function P_(i,s,h,g,k){var A=hf();return A=A===null?null:{parent:Ot._currentValue,pool:A},s.memoizedState={baseLanes:h,cachePool:A},i!==null&&$l(s,null),_f(),G0(s),i!==null&&Ms(i,s,g,!0),s.childLanes=k,null}function sc(i,s){return s=oc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function U_(i,s,h){return $r(s,i.child,null,h),i=sc(s,s.pendingProps),i.flags|=2,xn(s),s.memoizedState=null,i}function lk(i,s,h){var g=s.pendingProps,k=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Qe){if(g.mode==="hidden")return i=sc(s,g),s.lanes=536870912,no(null,i);if(yf(s),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return s.lanes=536870912,null}return sc(s,g)}var A=i.memoizedState;if(A!==null){var I=A.dehydrated;if(yf(s),k)if(s.flags&256)s.flags&=-257,s=U_(i,s,h);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(It||Ms(i,s,h,!1),k=(h&i.childLanes)!==0,It||k){if(g=_t,g!==null&&(I=gs(g,h),I!==0&&I!==A.retryLane))throw A.retryLane=I,Or(i,I),dn(g,i,I),Ff;mc(),s=U_(i,s,h)}else i=A.treeContext,St=Un(I.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=sc(s,g),s.flags|=4096;return s}return i=Ei(i.child,{mode:g.mode,children:g.children}),i.ref=s.ref,s.child=i,i.return=s,i}function ac(i,s){var h=s.ref;if(h===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(i===null||i.ref!==h)&&(s.flags|=4194816)}}function Pf(i,s,h,g,k){return Hr(s),h=Sf(i,s,h,g,void 0,k),g=xf(),i!==null&&!It?(wf(i,s,k),Di(i,s,k)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,k),s.child)}function $_(i,s,h,g,k,A){return Hr(s),s.updateQueue=null,h=V0(s,g,h,k),q0(i),g=xf(),i!==null&&!It?(wf(i,s,A),Di(i,s,A)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,A),s.child)}function G_(i,s,h,g,k){if(Hr(s),s.stateNode===null){var A=Ns,I=h.contextType;typeof I=="object"&&I!==null&&(A=Xt(I)),A=new h(g,A),s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=zf,s.stateNode=A,A._reactInternals=s,A=s.stateNode,A.props=g,A.state=s.memoizedState,A.refs={},df(s),I=h.contextType,A.context=typeof I=="object"&&I!==null?Xt(I):Ns,A.state=s.memoizedState,I=h.getDerivedStateFromProps,typeof I=="function"&&(If(s,h,I,g),A.state=s.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(I=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),I!==A.state&&zf.enqueueReplaceState(A,A.state,null),Za(s,g,A,k),Ka(),A.state=s.memoizedState),typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!0}else if(i===null){A=s.stateNode;var W=s.memoizedProps,J=qr(h,W);A.props=J;var ce=A.context,me=h.contextType;I=Ns,typeof me=="object"&&me!==null&&(I=Xt(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof A.getSnapshotBeforeUpdate=="function",W=s.pendingProps!==W,me||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(W||ce!==I)&&R_(s,A,g,I),rr=!1;var ue=s.memoizedState;A.state=ue,Za(s,g,A,k),Ka(),ce=s.memoizedState,W||ue!==ce||rr?(typeof ve=="function"&&(If(s,h,ve,g),ce=s.memoizedState),(J=rr||T_(s,h,J,g,ue,ce,I))?(me||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(s.flags|=4194308)):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=g,s.memoizedState=ce),A.props=g,A.state=ce,A.context=I,g=J):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!1)}else{A=s.stateNode,pf(i,s),I=s.memoizedProps,me=qr(h,I),A.props=me,ve=s.pendingProps,ue=A.context,ce=h.contextType,J=Ns,typeof ce=="object"&&ce!==null&&(J=Xt(ce)),W=h.getDerivedStateFromProps,(ce=typeof W=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==ve||ue!==J)&&R_(s,A,g,J),rr=!1,ue=s.memoizedState,A.state=ue,Za(s,g,A,k),Ka();var pe=s.memoizedState;I!==ve||ue!==pe||rr||i!==null&&i.dependencies!==null&&Pl(i.dependencies)?(typeof W=="function"&&(If(s,h,W,g),pe=s.memoizedState),(me=rr||T_(s,h,me,g,ue,pe,J)||i!==null&&i.dependencies!==null&&Pl(i.dependencies))?(ce||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,pe,J),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,pe,J)),typeof A.componentDidUpdate=="function"&&(s.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),s.memoizedProps=g,s.memoizedState=pe),A.props=g,A.state=pe,A.context=J,g=me):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),g=!1)}return A=g,ac(i,s),g=(s.flags&128)!==0,A||g?(A=s.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:A.render(),s.flags|=1,i!==null&&g?(s.child=$r(s,i.child,null,k),s.child=$r(s,null,h,k)):Kt(i,s,h,k),s.memoizedState=A.state,i=s.child):i=Di(i,s,k),i}function q_(i,s,h,g){return Ir(),s.flags|=256,Kt(i,s,h,g),s.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $f(i){return{baseLanes:i,cachePool:L0()}}function Gf(i,s,h){return i=i!==null?i.childLanes&~h:0,s&&(i|=Cn),i}function V_(i,s,h){var g=s.pendingProps,k=!1,A=(s.flags&128)!==0,I;if((I=A)||(I=i!==null&&i.memoizedState===null?!1:(Mt.current&2)!==0),I&&(k=!0,s.flags&=-129),I=(s.flags&32)!==0,s.flags&=-33,i===null){if(Qe){if(k?or(s):lr(),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return kd(i)?s.lanes=32:s.lanes=536870912,null}var W=g.children;return g=g.fallback,k?(lr(),k=s.mode,W=oc({mode:"hidden",children:W},k),g=Br(g,k,h,null),W.return=s,g.return=s,W.sibling=g,s.child=W,g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(null,g)):(or(s),qf(s,W))}var J=i.memoizedState;if(J!==null&&(W=J.dehydrated,W!==null)){if(A)s.flags&256?(or(s),s.flags&=-257,s=Vf(i,s,h)):s.memoizedState!==null?(lr(),s.child=i.child,s.flags|=128,s=null):(lr(),W=g.fallback,k=s.mode,g=oc({mode:"visible",children:g.children},k),W=Br(W,k,h,null),W.flags|=2,g.return=s,W.return=s,g.sibling=W,s.child=g,$r(s,i.child,null,h),g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,s=no(null,g));else if(or(s),kd(W)){if(I=W.nextSibling&&W.nextSibling.dataset,I)var ce=I.dgst;I=ce,g=Error(r(419)),g.stack="",g.digest=I,Ga({value:g,source:null,stack:null}),s=Vf(i,s,h)}else if(It||Ms(i,s,h,!1),I=(h&i.childLanes)!==0,It||I){if(I=_t,I!==null&&(g=gs(I,h),g!==0&&g!==J.retryLane))throw J.retryLane=g,Or(i,g),dn(I,i,g),Ff;Ed(W)||mc(),s=Vf(i,s,h)}else Ed(W)?(s.flags|=192,s.child=i.child,s=null):(i=J.treeContext,St=Un(W.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=qf(s,g.children),s.flags|=4096);return s}return k?(lr(),W=g.fallback,k=s.mode,J=i.child,ce=J.sibling,g=Ei(J,{mode:"hidden",children:g.children}),g.subtreeFlags=J.subtreeFlags&65011712,ce!==null?W=Ei(ce,W):(W=Br(W,k,h,null),W.flags|=2),W.return=s,g.return=s,g.sibling=W,s.child=g,no(null,g),g=s.child,W=i.child.memoizedState,W===null?W=$f(h):(k=W.cachePool,k!==null?(J=Ot._currentValue,k=k.parent!==J?{parent:J,pool:J}:k):k=L0(),W={baseLanes:W.baseLanes|h,cachePool:k}),g.memoizedState=W,g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(i.child,g)):(or(s),h=i.child,i=h.sibling,h=Ei(h,{mode:"visible",children:g.children}),h.return=s,h.sibling=null,i!==null&&(I=s.deletions,I===null?(s.deletions=[i],s.flags|=16):I.push(i)),s.child=h,s.memoizedState=null,h)}function qf(i,s){return s=oc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function oc(i,s){return i=bn(22,i,null,s),i.lanes=0,i}function Vf(i,s,h){return $r(s,i.child,null,h),i=qf(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Y_(i,s,h){i.lanes|=s;var g=i.alternate;g!==null&&(g.lanes|=s),of(i.return,s,h)}function Yf(i,s,h,g,k,A){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:k,treeForkCount:A}:(I.isBackwards=s,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=h,I.tailMode=k,I.treeForkCount=A)}function W_(i,s,h){var g=s.pendingProps,k=g.revealOrder,A=g.tail;g=g.children;var I=Mt.current,W=(I&2)!==0;if(W?(I=I&1|2,s.flags|=128):I&=1,U(Mt,I),Kt(i,s,g,h),g=Qe?$a:0,!W&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Y_(i,h,s);else if(i.tag===19)Y_(i,h,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(k){case"forwards":for(h=s.child,k=null;h!==null;)i=h.alternate,i!==null&&Xl(i)===null&&(k=h),h=h.sibling;h=k,h===null?(k=s.child,s.child=null):(k=h.sibling,h.sibling=null),Yf(s,!1,k,h,A,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,k=s.child,s.child=null;k!==null;){if(i=k.alternate,i!==null&&Xl(i)===null){s.child=k;break}i=k.sibling,k.sibling=h,h=k,k=i}Yf(s,!0,h,null,A,g);break;case"together":Yf(s,!1,null,null,void 0,g);break;default:s.memoizedState=null}return s.child}function Di(i,s,h){if(i!==null&&(s.dependencies=i.dependencies),hr|=s.lanes,(h&s.childLanes)===0)if(i!==null){if(Ms(i,s,h,!1),(h&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,h=Ei(i,i.pendingProps),s.child=h,h.return=s;i.sibling!==null;)i=i.sibling,h=h.sibling=Ei(i,i.pendingProps),h.return=s;h.sibling=null}return s.child}function Wf(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Pl(i)))}function ck(i,s,h){switch(s.tag){case 3:P(s,s.stateNode.containerInfo),ir(s,Ot,i.memoizedState.cache),Ir();break;case 27:case 5:ne(s);break;case 4:P(s,s.stateNode.containerInfo);break;case 10:ir(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,yf(s),null;break;case 13:var g=s.memoizedState;if(g!==null)return g.dehydrated!==null?(or(s),s.flags|=128,null):(h&s.child.childLanes)!==0?V_(i,s,h):(or(s),i=Di(i,s,h),i!==null?i.sibling:null);or(s);break;case 19:var k=(i.flags&128)!==0;if(g=(h&s.childLanes)!==0,g||(Ms(i,s,h,!1),g=(h&s.childLanes)!==0),k){if(g)return W_(i,s,h);s.flags|=128}if(k=s.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),U(Mt,Mt.current),g)break;return null;case 22:return s.lanes=0,F_(i,s,h,s.pendingProps);case 24:ir(s,Ot,i.memoizedState.cache)}return Di(i,s,h)}function X_(i,s,h){if(i!==null)if(i.memoizedProps!==s.pendingProps)It=!0;else{if(!Wf(i,h)&&(s.flags&128)===0)return It=!1,ck(i,s,h);It=(i.flags&131072)!==0}else It=!1,Qe&&(s.flags&1048576)!==0&&A0(s,$a,s.index);switch(s.lanes=0,s.tag){case 16:e:{var g=s.pendingProps;if(i=Pr(s.elementType),s.type=i,typeof i=="function")Qh(i)?(g=qr(i,g),s.tag=1,s=G_(null,s,i,g,h)):(s.tag=0,s=Pf(null,s,i,g,h));else{if(i!=null){var k=i.$$typeof;if(k===E){s.tag=11,s=I_(null,s,i,g,h);break e}else if(k===D){s.tag=14,s=z_(null,s,i,g,h);break e}}throw s=z(i)||i,Error(r(306,s,""))}}return s;case 0:return Pf(i,s,s.type,s.pendingProps,h);case 1:return g=s.type,k=qr(g,s.pendingProps),G_(i,s,g,k,h);case 3:e:{if(P(s,s.stateNode.containerInfo),i===null)throw Error(r(387));g=s.pendingProps;var A=s.memoizedState;k=A.element,pf(i,s),Za(s,g,null,h);var I=s.memoizedState;if(g=I.cache,ir(s,Ot,g),g!==A.cache&&lf(s,[Ot],h,!0),Ka(),g=I.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:I.cache},s.updateQueue.baseState=A,s.memoizedState=A,s.flags&256){s=q_(i,s,g,h);break e}else if(g!==k){k=In(Error(r(424)),s),Ga(k),s=q_(i,s,g,h);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(St=Un(i.firstChild),Wt=s,Qe=!0,tr=null,Fn=!0,h=F0(s,null,g,h),s.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Ir(),g===k){s=Di(i,s,h);break e}Kt(i,s,g,h)}s=s.child}return s;case 26:return ac(i,s),i===null?(h=ay(s.type,null,s.pendingProps,null))?s.memoizedState=h:Qe||(h=s.type,i=s.pendingProps,g=wc(ae.current).createElement(h),g[$t]=s,g[Qt]=i,Zt(g,h,i),Lt(g),s.stateNode=g):s.memoizedState=ay(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ne(s),i===null&&Qe&&(g=s.stateNode=iy(s.type,s.pendingProps,ae.current),Wt=s,Fn=!0,k=St,mr(s.type)?(Ad=k,St=Un(g.firstChild)):St=k),Kt(i,s,s.pendingProps.children,h),ac(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Qe&&((k=g=St)&&(g=Hk(g,s.type,s.pendingProps,Fn),g!==null?(s.stateNode=g,Wt=s,St=Un(g.firstChild),Fn=!1,k=!0):k=!1),k||nr(s)),ne(s),k=s.type,A=s.pendingProps,I=i!==null?i.memoizedProps:null,g=A.children,xd(k,A)?g=null:I!==null&&xd(k,I)&&(s.flags|=32),s.memoizedState!==null&&(k=Sf(i,s,ek,null,null,h),vo._currentValue=k),ac(i,s),Kt(i,s,g,h),s.child;case 6:return i===null&&Qe&&((i=h=St)&&(h=Fk(h,s.pendingProps,Fn),h!==null?(s.stateNode=h,Wt=s,St=null,i=!0):i=!1),i||nr(s)),null;case 13:return V_(i,s,h);case 4:return P(s,s.stateNode.containerInfo),g=s.pendingProps,i===null?s.child=$r(s,null,g,h):Kt(i,s,g,h),s.child;case 11:return I_(i,s,s.type,s.pendingProps,h);case 7:return Kt(i,s,s.pendingProps,h),s.child;case 8:return Kt(i,s,s.pendingProps.children,h),s.child;case 12:return Kt(i,s,s.pendingProps.children,h),s.child;case 10:return g=s.pendingProps,ir(s,s.type,g.value),Kt(i,s,g.children,h),s.child;case 9:return k=s.type._context,g=s.pendingProps.children,Hr(s),k=Xt(k),g=g(k),s.flags|=1,Kt(i,s,g,h),s.child;case 14:return z_(i,s,s.type,s.pendingProps,h);case 15:return H_(i,s,s.type,s.pendingProps,h);case 19:return W_(i,s,h);case 31:return lk(i,s,h);case 22:return F_(i,s,h,s.pendingProps);case 24:return Hr(s),g=Xt(Ot),i===null?(k=hf(),k===null&&(k=_t,A=cf(),k.pooledCache=A,A.refCount++,A!==null&&(k.pooledCacheLanes|=h),k=A),s.memoizedState={parent:g,cache:k},df(s),ir(s,Ot,k)):((i.lanes&h)!==0&&(pf(i,s),Za(s,null,null,h),Ka()),k=i.memoizedState,A=s.memoizedState,k.parent!==g?(k={parent:g,cache:g},s.memoizedState=k,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=k),ir(s,Ot,g)):(g=A.cache,ir(s,Ot,g),g!==k.cache&&lf(s,[Ot],h,!0))),Kt(i,s,s.pendingProps.children,h),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Mi(i){i.flags|=4}function Xf(i,s,h,g,k){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(k&335544128)===k)if(i.stateNode.complete)i.flags|=8192;else if(xv())i.flags|=8192;else throw Ur=ql,ff}else i.flags&=-16777217}function K_(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!hy(s))if(xv())i.flags|=8192;else throw Ur=ql,ff}function lc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?we():536870912,i.lanes|=s,Gs|=s)}function io(i,s){if(!Qe)switch(i.tailMode){case"hidden":s=i.tail;for(var h=null;s!==null;)s.alternate!==null&&(h=s),s=s.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,h=0,g=0;if(s)for(var k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags&65011712,g|=k.flags&65011712,k.return=i,k=k.sibling;else for(k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags,g|=k.flags,k.return=i,k=k.sibling;return i.subtreeFlags|=g,i.childLanes=h,s}function uk(i,s,h){var g=s.pendingProps;switch(nf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(s),null;case 1:return xt(s),null;case 3:return h=s.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),s.memoizedState.cache!==g&&(s.flags|=2048),Ni(Ot),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Ds(s)?Mi(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sf())),xt(s),null;case 26:var k=s.type,A=s.memoizedState;return i===null?(Mi(s),A!==null?(xt(s),K_(s,A)):(xt(s),Xf(s,k,null,g,h))):A?A!==i.memoizedState?(Mi(s),xt(s),K_(s,A)):(xt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==g&&Mi(s),xt(s),Xf(s,k,i,g,h)),null;case 27:if(ge(s),h=ae.current,k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}i=Q.current,Ds(s)?T0(s):(i=iy(k,g,h),s.stateNode=i,Mi(s))}return xt(s),null;case 5:if(ge(s),k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}if(A=Q.current,Ds(s))T0(s);else{var I=wc(ae.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?A.multiple=!0:g.size&&(A.size=g.size);break;default:A=typeof g.is=="string"?I.createElement(k,{is:g.is}):I.createElement(k)}}A[$t]=s,A[Qt]=g;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Zt(A,k,g),k){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Mi(s)}}return xt(s),Xf(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==g&&Mi(s);else{if(typeof g!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Ds(s)){if(i=s.stateNode,h=s.memoizedProps,g=null,k=Wt,k!==null)switch(k.tag){case 27:case 5:g=k.memoizedProps}i[$t]=s,i=!!(i.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||Vv(i.nodeValue,h)),i||nr(s,!0)}else i=wc(i).createTextNode(g),i[$t]=s,s.stateNode=i}return xt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(g=Ds(s),h!==null){if(i===null){if(!g)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),i=!1}else h=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return xt(s),null;case 13:if(g=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Ds(s),g!==null&&g.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),k=!1}else k=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=g!==null,i=i!==null&&i.memoizedState!==null,h&&(g=s.child,k=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(k=g.alternate.memoizedState.cachePool.pool),A=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(A=g.memoizedState.cachePool.pool),A!==k&&(g.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),lc(s,s.updateQueue),xt(s),null);case 4:return ee(),i===null&&_d(s.stateNode.containerInfo),xt(s),null;case 10:return Ni(s.type),xt(s),null;case 19:if($(Mt),g=s.memoizedState,g===null)return xt(s),null;if(k=(s.flags&128)!==0,A=g.rendering,A===null)if(k)io(g,!1);else{if(Rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Xl(i),A!==null){for(s.flags|=128,io(g,!1),i=A.updateQueue,s.updateQueue=i,lc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)C0(h,i),h=h.sibling;return U(Mt,Mt.current&1|2),Qe&&ki(s,g.treeForkCount),s.child}i=i.sibling}g.tail!==null&&Fe()>dc&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304)}else{if(!k)if(i=Xl(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,lc(s,i),io(g,!0),g.tail===null&&g.tailMode==="hidden"&&!A.alternate&&!Qe)return xt(s),null}else 2*Fe()-g.renderingStartTime>dc&&h!==536870912&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304);g.isBackwards?(A.sibling=s.child,s.child=A):(i=g.last,i!==null?i.sibling=A:s.child=A,g.last=A)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Fe(),i.sibling=null,h=Mt.current,U(Mt,k?h&1|2:h&1),Qe&&ki(s,g.treeForkCount),i):(xt(s),null);case 22:case 23:return xn(s),vf(),g=s.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(s.flags|=8192):g&&(s.flags|=8192),g?(h&536870912)!==0&&(s.flags&128)===0&&(xt(s),s.subtreeFlags&6&&(s.flags|=8192)):xt(s),h=s.updateQueue,h!==null&&lc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==h&&(s.flags|=2048),i!==null&&$(Fr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ni(Ot),xt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function hk(i,s){switch(nf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ni(Ot),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return $(Mt),null;case 4:return ee(),null;case 10:return Ni(s.type),null;case 22:case 23:return xn(s),vf(),i!==null&&$(Fr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ni(Ot),null;case 25:return null;default:return null}}function Z_(i,s){switch(nf(s),s.tag){case 3:Ni(Ot),ee();break;case 26:case 27:case 5:ge(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:$(Mt);break;case 10:Ni(s.type);break;case 22:case 23:xn(s),vf(),i!==null&&$(Fr);break;case 24:Ni(Ot)}}function ro(i,s){try{var h=s.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var k=g.next;h=k;do{if((h.tag&i)===i){g=void 0;var A=h.create,I=h.inst;g=A(),I.destroy=g}h=h.next}while(h!==k)}}catch(W){dt(s,s.return,W)}}function cr(i,s,h){try{var g=s.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&i)===i){var I=g.inst,W=I.destroy;if(W!==void 0){I.destroy=void 0,k=s;var J=h,ce=W;try{ce()}catch(me){dt(k,J,me)}}}g=g.next}while(g!==A)}}catch(me){dt(s,s.return,me)}}function Q_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{U0(s,h)}catch(g){dt(i,i.return,g)}}}function J_(i,s,h){h.props=qr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(g){dt(i,s,g)}}function so(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof h=="function"?i.refCleanup=h(g):h.current=g}}catch(k){dt(i,s,k)}}function ai(i,s){var h=i.ref,g=i.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(k){dt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){dt(i,s,k)}else h.current=null}function ev(i){var s=i.type,h=i.memoizedProps,g=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(k){dt(i,i.return,k)}}function Kf(i,s,h){try{var g=i.stateNode;jk(g,i.type,h,s),g[Qt]=s}catch(k){dt(i,i.return,k)}}function tv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function Zf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||tv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qf(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=wi));else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(Qf(i,s,h),i=i.sibling;i!==null;)Qf(i,s,h),i=i.sibling}function cc(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(cc(i,s,h),i=i.sibling;i!==null;)cc(i,s,h),i=i.sibling}function nv(i){var s=i.stateNode,h=i.memoizedProps;try{for(var g=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Zt(s,g,h),s[$t]=i,s[Qt]=h}catch(A){dt(i,i.return,A)}}var ji=!1,zt=!1,Jf=!1,iv=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function fk(i,s){if(i=i.containerInfo,bd=Rc,i=g0(i),qh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var k=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,W=-1,J=-1,ce=0,me=0,ve=i,ue=null;t:for(;;){for(var pe;ve!==h||k!==0&&ve.nodeType!==3||(W=I+k),ve!==A||g!==0&&ve.nodeType!==3||(J=I+g),ve.nodeType===3&&(I+=ve.nodeValue.length),(pe=ve.firstChild)!==null;)ue=ve,ve=pe;for(;;){if(ve===i)break t;if(ue===h&&++ce===k&&(W=I),ue===A&&++me===g&&(J=I),(pe=ve.nextSibling)!==null)break;ve=ue,ue=ve.parentNode}ve=pe}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Sd={focusedElem:i,selectionRange:h},Rc=!1,Vt=s;Vt!==null;)if(s=Vt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Vt=i;else for(;Vt!==null;){switch(s=Vt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h<i.length;h++)k=i[h],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&A!==null){i=void 0,h=s,k=A.memoizedProps,A=A.memoizedState,g=h.stateNode;try{var Te=qr(h.type,k);i=g.getSnapshotBeforeUpdate(Te,A),g.__reactInternalSnapshotBeforeUpdate=i}catch(Be){dt(h,h.return,Be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,h=i.nodeType,h===9)Cd(i);else if(h===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Cd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Vt=i;break}Vt=s.return}}function rv(i,s,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Oi(i,h),g&4&&ro(5,h);break;case 1:if(Oi(i,h),g&4)if(i=h.stateNode,s===null)try{i.componentDidMount()}catch(I){dt(h,h.return,I)}else{var k=qr(h.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(k,s,i.__reactInternalSnapshotBeforeUpdate)}catch(I){dt(h,h.return,I)}}g&64&&Q_(h),g&512&&so(h,h.return);break;case 3:if(Oi(i,h),g&64&&(i=h.updateQueue,i!==null)){if(s=null,h.child!==null)switch(h.child.tag){case 27:case 5:s=h.child.stateNode;break;case 1:s=h.child.stateNode}try{U0(i,s)}catch(I){dt(h,h.return,I)}}break;case 27:s===null&&g&4&&nv(h);case 26:case 5:Oi(i,h),s===null&&g&4&&ev(h),g&512&&so(h,h.return);break;case 12:Oi(i,h);break;case 31:Oi(i,h),g&4&&ov(i,h);break;case 13:Oi(i,h),g&4&&lv(i,h),g&64&&(i=h.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(h=Sk.bind(null,h),Pk(i,h))));break;case 22:if(g=h.memoizedState!==null||ji,!g){s=s!==null&&s.memoizedState!==null||zt,k=ji;var A=zt;ji=g,(zt=s)&&!A?Bi(i,h,(h.subtreeFlags&8772)!==0):Oi(i,h),ji=k,zt=A}break;case 30:break;default:Oi(i,h)}}function sv(i){var s=i.alternate;s!==null&&(i.alternate=null,sv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Na(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var kt=null,cn=!1;function Li(i,s,h){for(h=h.child;h!==null;)av(i,s,h),h=h.sibling}function av(i,s,h){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Nt,h)}catch{}switch(h.tag){case 26:zt||ai(h,s),Li(i,s,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:zt||ai(h,s);var g=kt,k=cn;mr(h.type)&&(kt=h.stateNode,cn=!1),Li(i,s,h),go(h.stateNode),kt=g,cn=k;break;case 5:zt||ai(h,s);case 6:if(g=kt,k=cn,kt=null,Li(i,s,h),kt=g,cn=k,kt!==null)if(cn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(h.stateNode)}catch(A){dt(h,s,A)}else try{kt.removeChild(h.stateNode)}catch(A){dt(h,s,A)}break;case 18:kt!==null&&(cn?(i=kt,Qv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,h.stateNode),Qs(i)):Qv(kt,h.stateNode));break;case 4:g=kt,k=cn,kt=h.stateNode.containerInfo,cn=!0,Li(i,s,h),kt=g,cn=k;break;case 0:case 11:case 14:case 15:cr(2,h,s),zt||cr(4,h,s),Li(i,s,h);break;case 1:zt||(ai(h,s),g=h.stateNode,typeof g.componentWillUnmount=="function"&&J_(h,s,g)),Li(i,s,h);break;case 21:Li(i,s,h);break;case 22:zt=(g=zt)||h.memoizedState!==null,Li(i,s,h),zt=g;break;default:Li(i,s,h)}}function ov(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Qs(i)}catch(h){dt(s,s.return,h)}}}function lv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Qs(i)}catch(h){dt(s,s.return,h)}}function dk(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new iv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new iv),s;default:throw Error(r(435,i.tag))}}function uc(i,s){var h=dk(i);s.forEach(function(g){if(!h.has(g)){h.add(g);var k=xk.bind(null,i,g);g.then(k,k)}})}function un(i,s){var h=s.deletions;if(h!==null)for(var g=0;g<h.length;g++){var k=h[g],A=i,I=s,W=I;e:for(;W!==null;){switch(W.tag){case 27:if(mr(W.type)){kt=W.stateNode,cn=!1;break e}break;case 5:kt=W.stateNode,cn=!1;break e;case 3:case 4:kt=W.stateNode.containerInfo,cn=!0;break e}W=W.return}if(kt===null)throw Error(r(160));av(A,I,k),kt=null,cn=!1,A=k.alternate,A!==null&&(A.return=null),k.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)cv(s,i),s=s.sibling}var Yn=null;function cv(i,s){var h=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),hn(i),g&4&&(cr(3,i,i.return),ro(3,i),cr(5,i,i.return));break;case 1:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&64&&ji&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(h=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var k=Yn;if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&4){var A=h!==null?h.memoizedState:null;if(g=i.memoizedState,h===null)if(g===null)if(i.stateNode===null){e:{g=i.type,h=i.memoizedProps,k=k.ownerDocument||k;t:switch(g){case"title":A=k.getElementsByTagName("title")[0],(!A||A[Rr]||A[$t]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=k.createElement(g),k.head.insertBefore(A,k.querySelector("head > title"))),Zt(A,g,h),A[$t]=i,Lt(A),g=A;break e;case"link":var I=cy("link","href",k).get(g+(h.href||""));if(I){for(var W=0;W<I.length;W++)if(A=I[W],A.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&A.getAttribute("rel")===(h.rel==null?null:h.rel)&&A.getAttribute("title")===(h.title==null?null:h.title)&&A.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;case"meta":if(I=cy("meta","content",k).get(g+(h.content||""))){for(W=0;W<I.length;W++)if(A=I[W],A.getAttribute("content")===(h.content==null?null:""+h.content)&&A.getAttribute("name")===(h.name==null?null:h.name)&&A.getAttribute("property")===(h.property==null?null:h.property)&&A.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&A.getAttribute("charset")===(h.charSet==null?null:h.charSet)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;default:throw Error(r(468,g))}A[$t]=i,Lt(A),g=A}i.stateNode=g}else uy(k,i.type,i.stateNode);else i.stateNode=ly(k,g,i.memoizedProps);else A!==g?(A===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):A.count--,g===null?uy(k,i.type,i.stateNode):ly(k,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Kf(i,i.memoizedProps,h.memoizedProps)}break;case 27:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),h!==null&&g&4&&Kf(i,i.memoizedProps,h.memoizedProps);break;case 5:if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),i.flags&32){k=i.stateNode;try{Ss(k,"")}catch(Te){dt(i,i.return,Te)}}g&4&&i.stateNode!=null&&(k=i.memoizedProps,Kf(i,k,h!==null?h.memoizedProps:k)),g&1024&&(Jf=!0);break;case 6:if(un(s,i),hn(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,h=i.stateNode;try{h.nodeValue=g}catch(Te){dt(i,i.return,Te)}}break;case 3:if(kc=null,k=Yn,Yn=Cc(s.containerInfo),un(s,i),Yn=k,hn(i),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Qs(s.containerInfo)}catch(Te){dt(i,i.return,Te)}Jf&&(Jf=!1,uv(i));break;case 4:g=Yn,Yn=Cc(i.stateNode.containerInfo),un(s,i),hn(i),Yn=g;break;case 12:un(s,i),hn(i);break;case 31:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 13:un(s,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(fc=Fe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 22:k=i.memoizedState!==null;var J=h!==null&&h.memoizedState!==null,ce=ji,me=zt;if(ji=ce||k,zt=me||J,un(s,i),zt=me,ji=ce,hn(i),g&8192)e:for(s=i.stateNode,s._visibility=k?s._visibility&-2:s._visibility|1,k&&(h===null||J||ji||zt||Vr(i)),h=null,s=i;;){if(s.tag===5||s.tag===26){if(h===null){J=h=s;try{if(A=J.stateNode,k)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{W=J.stateNode;var ve=J.memoizedProps.style,ue=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;W.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===6){if(h===null){J=s;try{J.stateNode.nodeValue=k?"":J.memoizedProps}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===18){if(h===null){J=s;try{var pe=J.stateNode;k?Jv(pe,!0):Jv(J.stateNode,!1)}catch(Te){dt(J,J.return,Te)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;h===s&&(h=null),s=s.return}h===s&&(h=null),s.sibling.return=s.return,s=s.sibling}g&4&&(g=i.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,uc(i,h))));break;case 19:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 30:break;case 21:break;default:un(s,i),hn(i)}}function hn(i){var s=i.flags;if(s&2){try{for(var h,g=i.return;g!==null;){if(tv(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var k=h.stateNode,A=Zf(i);cc(i,A,k);break;case 5:var I=h.stateNode;h.flags&32&&(Ss(I,""),h.flags&=-33);var W=Zf(i);cc(i,W,I);break;case 3:case 4:var J=h.stateNode.containerInfo,ce=Zf(i);Qf(i,ce,J);break;default:throw Error(r(161))}}catch(me){dt(i,i.return,me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function uv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;uv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Oi(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)rv(i,s.alternate,s),s=s.sibling}function Vr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:cr(4,s,s.return),Vr(s);break;case 1:ai(s,s.return);var h=s.stateNode;typeof h.componentWillUnmount=="function"&&J_(s,s.return,h),Vr(s);break;case 27:go(s.stateNode);case 26:case 5:ai(s,s.return),Vr(s);break;case 22:s.memoizedState===null&&Vr(s);break;case 30:Vr(s);break;default:Vr(s)}i=i.sibling}}function Bi(i,s,h){for(h=h&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var g=s.alternate,k=i,A=s,I=A.flags;switch(A.tag){case 0:case 11:case 15:Bi(k,A,h),ro(4,A);break;case 1:if(Bi(k,A,h),g=A,k=g.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(ce){dt(g,g.return,ce)}if(g=A,k=g.updateQueue,k!==null){var W=g.stateNode;try{var J=k.shared.hiddenCallbacks;if(J!==null)for(k.shared.hiddenCallbacks=null,k=0;k<J.length;k++)P0(J[k],W)}catch(ce){dt(g,g.return,ce)}}h&&I&64&&Q_(A),so(A,A.return);break;case 27:nv(A);case 26:case 5:Bi(k,A,h),h&&g===null&&I&4&&ev(A),so(A,A.return);break;case 12:Bi(k,A,h);break;case 31:Bi(k,A,h),h&&I&4&&ov(k,A);break;case 13:Bi(k,A,h),h&&I&4&&lv(k,A);break;case 22:A.memoizedState===null&&Bi(k,A,h),so(A,A.return);break;case 30:break;default:Bi(k,A,h)}s=s.sibling}}function ed(i,s){var h=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==h&&(i!=null&&i.refCount++,h!=null&&qa(h))}function td(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i))}function Wn(i,s,h,g){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hv(i,s,h,g),s=s.sibling}function hv(i,s,h,g){var k=s.flags;switch(s.tag){case 0:case 11:case 15:Wn(i,s,h,g),k&2048&&ro(9,s);break;case 1:Wn(i,s,h,g);break;case 3:Wn(i,s,h,g),k&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i)));break;case 12:if(k&2048){Wn(i,s,h,g),i=s.stateNode;try{var A=s.memoizedProps,I=A.id,W=A.onPostCommit;typeof W=="function"&&W(I,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(J){dt(s,s.return,J)}}else Wn(i,s,h,g);break;case 31:Wn(i,s,h,g);break;case 13:Wn(i,s,h,g);break;case 23:break;case 22:A=s.stateNode,I=s.alternate,s.memoizedState!==null?A._visibility&2?Wn(i,s,h,g):ao(i,s):A._visibility&2?Wn(i,s,h,g):(A._visibility|=2,Ps(i,s,h,g,(s.subtreeFlags&10256)!==0||!1)),k&2048&&ed(I,s);break;case 24:Wn(i,s,h,g),k&2048&&td(s.alternate,s);break;default:Wn(i,s,h,g)}}function Ps(i,s,h,g,k){for(k=k&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var A=i,I=s,W=h,J=g,ce=I.flags;switch(I.tag){case 0:case 11:case 15:Ps(A,I,W,J,k),ro(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?Ps(A,I,W,J,k):ao(A,I):(me._visibility|=2,Ps(A,I,W,J,k)),k&&ce&2048&&ed(I.alternate,I);break;case 24:Ps(A,I,W,J,k),k&&ce&2048&&td(I.alternate,I);break;default:Ps(A,I,W,J,k)}s=s.sibling}}function ao(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var h=i,g=s,k=g.flags;switch(g.tag){case 22:ao(h,g),k&2048&&ed(g.alternate,g);break;case 24:ao(h,g),k&2048&&td(g.alternate,g);break;default:ao(h,g)}s=s.sibling}}var oo=8192;function Us(i,s,h){if(i.subtreeFlags&oo)for(i=i.child;i!==null;)fv(i,s,h),i=i.sibling}function fv(i,s,h){switch(i.tag){case 26:Us(i,s,h),i.flags&oo&&i.memoizedState!==null&&Jk(h,Yn,i.memoizedState,i.memoizedProps);break;case 5:Us(i,s,h);break;case 3:case 4:var g=Yn;Yn=Cc(i.stateNode.containerInfo),Us(i,s,h),Yn=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=oo,oo=16777216,Us(i,s,h),oo=g):Us(i,s,h));break;default:Us(i,s,h)}}function dv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function lo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(i),i=i.sibling}function pv(i){switch(i.tag){case 0:case 11:case 15:lo(i),i.flags&2048&&cr(9,i,i.return);break;case 3:lo(i);break;case 12:lo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,hc(i)):lo(i);break;default:lo(i)}}function hc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:cr(8,s,s.return),hc(s);break;case 22:h=s.stateNode,h._visibility&2&&(h._visibility&=-3,hc(s));break;default:hc(s)}i=i.sibling}}function gv(i,s){for(;Vt!==null;){var h=Vt;switch(h.tag){case 0:case 11:case 15:cr(8,h,s);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:qa(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Vt=g;else e:for(h=i;Vt!==null;){g=Vt;var k=g.sibling,A=g.return;if(sv(g),g===h){Vt=null;break e}if(k!==null){k.return=A,Vt=k;break e}Vt=A}}}var pk={getCacheForType:function(i){var s=Xt(Ot),h=s.data.get(i);return h===void 0&&(h=i(),s.data.set(i,h)),h},cacheSignal:function(){return Xt(Ot).controller.signal}},gk=typeof WeakMap=="function"?WeakMap:Map,ot=0,_t=null,Ye=null,Ke=0,ft=0,wn=null,ur=!1,$s=!1,nd=!1,Ii=0,Rt=0,hr=0,Yr=0,id=0,Cn=0,Gs=0,co=null,fn=null,rd=!1,fc=0,mv=0,dc=1/0,pc=null,fr=null,Gt=0,dr=null,qs=null,zi=0,sd=0,ad=null,_v=null,uo=0,od=null;function En(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:G.T!==null?dd():yl()}function vv(){if(Cn===0)if((Ke&536870912)===0||Qe){var i=_i;_i<<=1,(_i&3932160)===0&&(_i=262144),Cn=i}else Cn=536870912;return i=Sn.current,i!==null&&(i.flags|=32),Cn}function dn(i,s,h){(i===_t&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),pr(i,Ke,Cn,!1)),qe(i,h),((ot&2)===0||i!==_t)&&(i===_t&&((ot&2)===0&&(Yr|=h),Rt===4&&pr(i,Ke,Cn,!1)),oi(i))}function yv(i,s,h){if((ot&6)!==0)throw Error(r(327));var g=!h&&(s&127)===0&&(s&i.expiredLanes)===0||ni(i,s),k=g?vk(i,s):cd(i,s,!0),A=g;do{if(k===0){$s&&!g&&pr(i,s,0,!1);break}else{if(h=i.current.alternate,A&&!mk(h)){k=cd(i,s,!1),A=!1;continue}if(k===2){if(A=s,i.errorRecoveryDisabledLanes&A)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){s=I;e:{var W=i;k=co;var J=W.current.memoizedState.isDehydrated;if(J&&(Vs(W,I).flags|=256),I=cd(W,I,!1),I!==2){if(nd&&!J){W.errorRecoveryDisabledLanes|=A,Yr|=A,k=4;break e}A=fn,fn=k,A!==null&&(fn===null?fn=A:fn.push.apply(fn,A))}k=I}if(A=!1,k!==2)continue}}if(k===1){Vs(i,0),pr(i,s,0,!0);break}e:{switch(g=i,A=k,A){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:pr(g,s,Cn,!ur);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(k=fc+300-Fe(),10<k)){if(pr(g,s,Cn,!ur),yi(g,0,!0)!==0)break e;zi=s,g.timeoutHandle=Kv(bv.bind(null,g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,"Throttled",-0,0),k);break e}bv(g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,null,-0,0)}}break}while(!0);oi(i)}function bv(i,s,h,g,k,A,I,W,J,ce,me,ve,ue,pe){if(i.timeoutHandle=-1,ve=s.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},fv(s,A,ve);var Te=(A&62914560)===A?fc-Fe():(A&4194048)===A?mv-Fe():0;if(Te=eA(ve,Te),Te!==null){zi=A,i.cancelPendingCommit=Te(Nv.bind(null,i,s,A,h,g,k,I,W,J,me,ve,null,ue,pe)),pr(i,A,I,!ce);return}}Nv(i,s,A,h,g,k,I,W,J)}function mk(i){for(var s=i;;){var h=s.tag;if((h===0||h===11||h===15)&&s.flags&16384&&(h=s.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var k=h[g],A=k.getSnapshot;k=k.value;try{if(!yn(A(),k))return!1}catch{return!1}}if(h=s.child,s.subtreeFlags&16384&&h!==null)h.return=s,s=h;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function pr(i,s,h,g){s&=~id,s&=~Yr,i.suspendedLanes|=s,i.pingedLanes&=~s,g&&(i.warmLanes|=s),g=i.expirationTimes;for(var k=s;0<k;){var A=31-st(k),I=1<<A;g[A]=-1,k&=~I}h!==0&&bi(i,h,s)}function gc(){return(ot&6)===0?(ho(0),!1):!0}function ld(){if(Ye!==null){if(ft===0)var i=Ye.return;else i=Ye,Ai=zr=null,Cf(i),Bs=null,Ya=0,i=Ye;for(;i!==null;)Z_(i.alternate,i),i=i.return;Ye=null}}function Vs(i,s){var h=i.timeoutHandle;h!==-1&&(i.timeoutHandle=-1,Bk(h)),h=i.cancelPendingCommit,h!==null&&(i.cancelPendingCommit=null,h()),zi=0,ld(),_t=i,Ye=h=Ei(i.current,null),Ke=s,ft=0,wn=null,ur=!1,$s=ni(i,s),nd=!1,Gs=Cn=id=Yr=hr=Rt=0,fn=co=null,rd=!1,(s&8)!==0&&(s|=s&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=s;0<g;){var k=31-st(g),A=1<<k;s|=i[k],g&=~A}return Ii=s,Bl(),h}function Sv(i,s){Pe=null,G.H=to,s===Os||s===Gl?(s=I0(),ft=3):s===ff?(s=I0(),ft=4):ft=s===Ff?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wn=s,Ye===null&&(Rt=1,rc(i,In(s,i.current)))}function xv(){var i=Sn.current;return i===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?i===Pn:!1}function wv(){var i=G.H;return G.H=to,i===null?to:i}function Cv(){var i=G.A;return G.A=pk,i}function mc(){Rt=4,ur||(Ke&4194048)!==Ke&&Sn.current!==null||($s=!0),(hr&134217727)===0&&(Yr&134217727)===0||_t===null||pr(_t,Ke,Cn,!1)}function cd(i,s,h){var g=ot;ot|=2;var k=wv(),A=Cv();(_t!==i||Ke!==s)&&(pc=null,Vs(i,s)),s=!1;var I=Rt;e:do try{if(ft!==0&&Ye!==null){var W=Ye,J=wn;switch(ft){case 8:ld(),I=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(s=!0);var ce=ft;if(ft=0,wn=null,Ys(i,W,J,ce),h&&$s){I=0;break e}break;default:ce=ft,ft=0,wn=null,Ys(i,W,J,ce)}}_k(),I=Rt;break}catch(me){Sv(i,me)}while(!0);return s&&i.shellSuspendCounter++,Ai=zr=null,ot=g,G.H=k,G.A=A,Ye===null&&(_t=null,Ke=0,Bl()),I}function _k(){for(;Ye!==null;)Ev(Ye)}function vk(i,s){var h=ot;ot|=2;var g=wv(),k=Cv();_t!==i||Ke!==s?(pc=null,dc=Fe()+500,Vs(i,s)):$s=ni(i,s);e:do try{if(ft!==0&&Ye!==null){s=Ye;var A=wn;t:switch(ft){case 1:ft=0,wn=null,Ys(i,s,A,1);break;case 2:case 9:if(O0(A)){ft=0,wn=null,kv(s);break}s=function(){ft!==2&&ft!==9||_t!==i||(ft=7),oi(i)},A.then(s,s);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:O0(A)?(ft=0,wn=null,kv(s)):(ft=0,wn=null,Ys(i,s,A,7));break;case 5:var I=null;switch(Ye.tag){case 26:I=Ye.memoizedState;case 5:case 27:var W=Ye;if(I?hy(I):W.stateNode.complete){ft=0,wn=null;var J=W.sibling;if(J!==null)Ye=J;else{var ce=W.return;ce!==null?(Ye=ce,_c(ce)):Ye=null}break t}}ft=0,wn=null,Ys(i,s,A,5);break;case 6:ft=0,wn=null,Ys(i,s,A,6);break;case 8:ld(),Rt=6;break e;default:throw Error(r(462))}}yk();break}catch(me){Sv(i,me)}while(!0);return Ai=zr=null,G.H=g,G.A=k,ot=h,Ye!==null?0:(_t=null,Ke=0,Bl(),Rt)}function yk(){for(;Ye!==null&&!Pt();)Ev(Ye)}function Ev(i){var s=X_(i.alternate,i,Ii);i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function kv(i){var s=i,h=s.alternate;switch(s.tag){case 15:case 0:s=$_(h,s,s.pendingProps,s.type,void 0,Ke);break;case 11:s=$_(h,s,s.pendingProps,s.type.render,s.ref,Ke);break;case 5:Cf(s);default:Z_(h,s),s=Ye=C0(s,Ii),s=X_(h,s,Ii)}i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function Ys(i,s,h,g){Ai=zr=null,Cf(s),Bs=null,Ya=0;var k=s.return;try{if(ok(i,k,s,h,Ke)){Rt=1,rc(i,In(h,i.current)),Ye=null;return}}catch(A){if(k!==null)throw Ye=k,A;Rt=1,rc(i,In(h,i.current)),Ye=null;return}s.flags&32768?(Qe||g===1?i=!0:$s||(Ke&536870912)!==0?i=!1:(ur=i=!0,(g===2||g===9||g===3||g===6)&&(g=Sn.current,g!==null&&g.tag===13&&(g.flags|=16384))),Av(s,i)):_c(s)}function _c(i){var s=i;do{if((s.flags&32768)!==0){Av(s,ur);return}i=s.return;var h=uk(s.alternate,s,Ii);if(h!==null){Ye=h;return}if(s=s.sibling,s!==null){Ye=s;return}Ye=s=i}while(s!==null);Rt===0&&(Rt=5)}function Av(i,s){do{var h=hk(i.alternate,i);if(h!==null){h.flags&=32767,Ye=h;return}if(h=i.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!s&&(i=i.sibling,i!==null)){Ye=i;return}Ye=i=h}while(i!==null);Rt=6,Ye=null}function Nv(i,s,h,g,k,A,I,W,J){i.cancelPendingCommit=null;do vc();while(Gt!==0);if((ot&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(A=s.lanes|s.childLanes,A|=Kh,at(i,h,A,I,W,J),i===_t&&(Ye=_t=null,Ke=0),qs=s,dr=i,zi=h,sd=A,ad=k,_v=g,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,wk(Se,function(){return jv(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||g){g=G.T,G.T=null,k=X.p,X.p=2,I=ot,ot|=4;try{fk(i,s,h)}finally{ot=I,X.p=k,G.T=g}}Gt=1,Tv(),Rv(),Dv()}}function Tv(){if(Gt===1){Gt=0;var i=dr,s=qs,h=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||h){h=G.T,G.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{cv(s,i);var A=Sd,I=g0(i.containerInfo),W=A.focusedElem,J=A.selectionRange;if(I!==W&&W&&W.ownerDocument&&p0(W.ownerDocument.documentElement,W)){if(J!==null&&qh(W)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in W)W.selectionStart=ce,W.selectionEnd=Math.min(me,W.value.length);else{var ve=W.ownerDocument||document,ue=ve&&ve.defaultView||window;if(ue.getSelection){var pe=ue.getSelection(),Te=W.textContent.length,Be=Math.min(J.start,Te),mt=J.end===void 0?Be:Math.min(J.end,Te);!pe.extend&&Be>mt&&(I=mt,mt=Be,Be=I);var se=d0(W,Be),te=d0(W,mt);if(se&&te&&(pe.rangeCount!==1||pe.anchorNode!==se.node||pe.anchorOffset!==se.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var le=ve.createRange();le.setStart(se.node,se.offset),pe.removeAllRanges(),Be>mt?(pe.addRange(le),pe.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),pe.addRange(le))}}}}for(ve=[],pe=W;pe=pe.parentNode;)pe.nodeType===1&&ve.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<ve.length;W++){var _e=ve[W];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Rc=!!bd,Sd=bd=null}finally{ot=k,X.p=g,G.T=h}}i.current=s,Gt=2}}function Rv(){if(Gt===2){Gt=0;var i=dr,s=qs,h=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||h){h=G.T,G.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{rv(i,s.alternate,s)}finally{ot=k,X.p=g,G.T=h}}Gt=3}}function Dv(){if(Gt===4||Gt===3){Gt=0,ht();var i=dr,s=qs,h=zi,g=_v;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gt=5:(Gt=0,qs=dr=null,Mv(i,i.pendingLanes));var k=i.pendingLanes;if(k===0&&(fr=null),Aa(h),s=s.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Nt,s,void 0,(s.current.flags&128)===128)}catch{}if(g!==null){s=G.T,k=X.p,X.p=2,G.T=null;try{for(var A=i.onRecoverableError,I=0;I<g.length;I++){var W=g[I];A(W.value,{componentStack:W.stack})}}finally{G.T=s,X.p=k}}(zi&3)!==0&&vc(),oi(i),k=i.pendingLanes,(h&261930)!==0&&(k&42)!==0?i===od?uo++:(uo=0,od=i):uo=0,ho(0)}}function Mv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,qa(s)))}function vc(){return Tv(),Rv(),Dv(),jv()}function jv(){if(Gt!==5)return!1;var i=dr,s=sd;sd=0;var h=Aa(zi),g=G.T,k=X.p;try{X.p=32>h?32:h,G.T=null,h=ad,ad=null;var A=dr,I=zi;if(Gt=0,qs=dr=null,zi=0,(ot&6)!==0)throw Error(r(331));var W=ot;if(ot|=4,pv(A.current),hv(A,A.current,I,h),ot=W,ho(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Nt,A)}catch{}return!0}finally{X.p=k,G.T=g,Mv(i,s)}}function Lv(i,s,h){s=In(h,s),s=Hf(i.stateNode,s,2),i=ar(i,s,2),i!==null&&(qe(i,2),oi(i))}function dt(i,s,h){if(i.tag===3)Lv(i,i,h);else for(;s!==null;){if(s.tag===3){Lv(s,i,h);break}else if(s.tag===1){var g=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(fr===null||!fr.has(g))){i=In(h,i),h=O_(2),g=ar(s,h,2),g!==null&&(B_(h,g,s,i),qe(g,2),oi(g));break}}s=s.return}}function ud(i,s,h){var g=i.pingCache;if(g===null){g=i.pingCache=new gk;var k=new Set;g.set(s,k)}else k=g.get(s),k===void 0&&(k=new Set,g.set(s,k));k.has(h)||(nd=!0,k.add(h),i=bk.bind(null,i,s,h),s.then(i,i))}function bk(i,s,h){var g=i.pingCache;g!==null&&g.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,_t===i&&(Ke&h)===h&&(Rt===4||Rt===3&&(Ke&62914560)===Ke&&300>Fe()-fc?(ot&2)===0&&Vs(i,0):id|=h,Gs===Ke&&(Gs=0)),oi(i)}function Ov(i,s){s===0&&(s=we()),i=Or(i,s),i!==null&&(qe(i,s),oi(i))}function Sk(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),Ov(i,h)}function xk(i,s){var h=0;switch(i.tag){case 31:case 13:var g=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(s),Ov(i,h)}function wk(i,s){return Ge(i,s)}var yc=null,Ws=null,hd=!1,bc=!1,fd=!1,gr=0;function oi(i){i!==Ws&&i.next===null&&(Ws===null?yc=Ws=i:Ws=Ws.next=i),bc=!0,hd||(hd=!0,Ek())}function ho(i,s){if(!fd&&bc){fd=!0;do for(var h=!1,g=yc;g!==null;){if(i!==0){var k=g.pendingLanes;if(k===0)var A=0;else{var I=g.suspendedLanes,W=g.pingedLanes;A=(1<<31-st(42|i)+1)-1,A&=k&~(I&~W),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Hv(g,A))}else A=Ke,A=yi(g,g===_t?A:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(A&3)===0||ni(g,A)||(h=!0,Hv(g,A));g=g.next}while(h);fd=!1}}function Ck(){Bv()}function Bv(){bc=hd=!1;var i=0;gr!==0&&Ok()&&(i=gr);for(var s=Fe(),h=null,g=yc;g!==null;){var k=g.next,A=Iv(g,s);A===0?(g.next=null,h===null?yc=k:h.next=k,k===null&&(Ws=h)):(h=g,(i!==0||(A&3)!==0)&&(bc=!0)),g=k}Gt!==0&&Gt!==5||ho(i),gr!==0&&(gr=0)}function Iv(i,s){for(var h=i.suspendedLanes,g=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0<A;){var I=31-st(A),W=1<<I,J=k[I];J===-1?((W&h)===0||(W&g)!==0)&&(k[I]=oe(W,s)):J<=s&&(i.expiredLanes|=W),A&=~W}if(s=_t,h=Ke,h=yi(i,i===s?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,h===0||i===s&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&ct(g),i.callbackNode=null,i.callbackPriority=0;if((h&3)===0||ni(i,h)){if(s=h&-h,s===i.callbackPriority)return s;switch(g!==null&&ct(g),Aa(h)){case 2:case 8:h=de;break;case 32:h=Se;break;case 268435456:h=De;break;default:h=Se}return g=zv.bind(null,i),h=Ge(h,g),i.callbackPriority=s,i.callbackNode=h,s}return g!==null&&g!==null&&ct(g),i.callbackPriority=2,i.callbackNode=null,2}function zv(i,s){if(Gt!==0&&Gt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var h=i.callbackNode;if(vc()&&i.callbackNode!==h)return null;var g=Ke;return g=yi(i,i===_t?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(yv(i,g,s),Iv(i,Fe()),i.callbackNode!=null&&i.callbackNode===h?zv.bind(null,i):null)}function Hv(i,s){if(vc())return null;yv(i,s,!0)}function Ek(){Ik(function(){(ot&6)!==0?Ge(ie,Ck):Bv()})}function dd(){if(gr===0){var i=js;i===0&&(i=mi,mi<<=1,(mi&261888)===0&&(mi=256)),gr=i}return gr}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Nl(""+i)}function Pv(i,s){var h=s.ownerDocument.createElement("input");return h.name=s.name,h.value=s.value,i.id&&h.setAttribute("form",i.id),s.parentNode.insertBefore(h,s),i=new FormData(i),h.parentNode.removeChild(h),i}function kk(i,s,h,g,k){if(s==="submit"&&h&&h.stateNode===k){var A=Fv((k[Qt]||null).action),I=g.submitter;I&&(s=(s=I[Qt]||null)?Fv(s.formAction):I.getAttribute("formAction"),s!==null&&(A=s,I=null));var W=new Ml("action","action",null,g,k);i.push({event:W,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(gr!==0){var J=I?Pv(k,I):new FormData(k);jf(h,{pending:!0,data:J,method:k.method,action:A},null,J)}}else typeof A=="function"&&(W.preventDefault(),J=I?Pv(k,I):new FormData(k),jf(h,{pending:!0,data:J,method:k.method,action:A},A,J))},currentTarget:k}]})}}for(var pd=0;pd<Xh.length;pd++){var gd=Xh[pd],Ak=gd.toLowerCase(),Nk=gd[0].toUpperCase()+gd.slice(1);Vn(Ak,"on"+Nk)}Vn(v0,"onAnimationEnd"),Vn(y0,"onAnimationIteration"),Vn(b0,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(GE,"onTransitionRun"),Vn(qE,"onTransitionStart"),Vn(VE,"onTransitionCancel"),Vn(S0,"onTransitionEnd"),Zi("onMouseEnter",["mouseout","mouseover"]),Zi("onMouseLeave",["mouseout","mouseover"]),Zi("onPointerEnter",["pointerout","pointerover"]),Zi("onPointerLeave",["pointerout","pointerover"]),xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function Uv(i,s){s=(s&4)!==0;for(var h=0;h<i.length;h++){var g=i[h],k=g.event;g=g.listeners;e:{var A=void 0;if(s)for(var I=g.length-1;0<=I;I--){var W=g[I],J=W.instance,ce=W.currentTarget;if(W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}else for(I=0;I<g.length;I++){if(W=g[I],J=W.instance,ce=W.currentTarget,W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}}}}function We(i,s){var h=s[ms];h===void 0&&(h=s[ms]=new Set);var g=i+"__bubble";h.has(g)||($v(s,i,2,!1),h.add(g))}function md(i,s,h){var g=0;s&&(g|=4),$v(h,i,g,s)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function _d(i){if(!i[Sc]){i[Sc]=!0,wl.forEach(function(h){h!=="selectionchange"&&(Tk.has(h)||md(h,!1,i),md(h,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Sc]||(s[Sc]=!0,md("selectionchange",!1,s))}}function $v(i,s,h,g){switch(vy(s)){case 2:var k=iA;break;case 8:k=rA;break;default:k=Md}h=k.bind(null,s,h,i),k=void 0,!Bh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(k=!0),g?k!==void 0?i.addEventListener(s,h,{capture:!0,passive:k}):i.addEventListener(s,h,!0):k!==void 0?i.addEventListener(s,h,{passive:k}):i.addEventListener(s,h,!1)}function vd(i,s,h,g,k){var A=g;if((s&1)===0&&(s&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var W=g.stateNode.containerInfo;if(W===k)break;if(I===4)for(I=g.return;I!==null;){var J=I.tag;if((J===3||J===4)&&I.stateNode.containerInfo===k)return;I=I.return}for(;W!==null;){if(I=Yi(W),I===null)return;if(J=I.tag,J===5||J===6||J===26||J===27){g=A=I;continue e}W=W.parentNode}}g=g.return}Wm(function(){var ce=A,me=Lh(h),ve=[];e:{var ue=x0.get(i);if(ue!==void 0){var pe=Ml,Te=i;switch(i){case"keypress":if(Rl(h)===0)break e;case"keydown":case"keyup":pe=xE;break;case"focusin":Te="focus",pe=Fh;break;case"focusout":Te="blur",pe=Fh;break;case"beforeblur":case"afterblur":pe=Fh;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=uE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=EE;break;case v0:case y0:case b0:pe=dE;break;case S0:pe=AE;break;case"scroll":case"scrollend":pe=lE;break;case"wheel":pe=TE;break;case"copy":case"cut":case"paste":pe=gE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Jm;break;case"toggle":case"beforetoggle":pe=DE}var Be=(s&4)!==0,mt=!Be&&(i==="scroll"||i==="scrollend"),se=Be?ue!==null?ue+"Capture":null:ue;Be=[];for(var te=ce,le;te!==null;){var _e=te;if(le=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||le===null||se===null||(_e=La(te,se),_e!=null&&Be.push(po(te,_e,le))),mt)break;te=te.return}0<Be.length&&(ue=new pe(ue,Te,null,h,me),ve.push({event:ue,listeners:Be}))}}if((s&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",ue&&h!==jh&&(Te=h.relatedTarget||h.fromElement)&&(Yi(Te)||Te[Si]))break e;if((pe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,pe?(Te=h.relatedTarget||h.toElement,pe=ce,Te=Te?Yi(Te):null,Te!==null&&(mt=l(Te),Be=Te.tag,Te!==mt||Be!==5&&Be!==27&&Be!==6)&&(Te=null)):(pe=null,Te=ce),pe!==Te)){if(Be=Zm,_e="onMouseLeave",se="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(Be=Jm,_e="onPointerLeave",se="onPointerEnter",te="pointer"),mt=pe==null?ue:Xi(pe),le=Te==null?ue:Xi(Te),ue=new Be(_e,te+"leave",pe,h,me),ue.target=mt,ue.relatedTarget=le,_e=null,Yi(me)===ce&&(Be=new Be(se,te+"enter",Te,h,me),Be.target=le,Be.relatedTarget=mt,_e=Be),mt=_e,pe&&Te)t:{for(Be=Rk,se=pe,te=Te,le=0,_e=se;_e;_e=Be(_e))le++;_e=0;for(var Le=te;Le;Le=Be(Le))_e++;for(;0<le-_e;)se=Be(se),le--;for(;0<_e-le;)te=Be(te),_e--;for(;le--;){if(se===te||te!==null&&se===te.alternate){Be=se;break t}se=Be(se),te=Be(te)}Be=null}else Be=null;pe!==null&&Gv(ve,ue,pe,Be,!1),Te!==null&&mt!==null&&Gv(ve,mt,Te,Be,!0)}}e:{if(ue=ce?Xi(ce):window,pe=ue.nodeName&&ue.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ue.type==="file")var nt=o0;else if(s0(ue))if(l0)nt=PE;else{nt=HE;var Re=zE}else pe=ue.nodeName,!pe||pe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Mh(ce.elementType)&&(nt=o0):nt=FE;if(nt&&(nt=nt(i,ce))){a0(ve,nt,h,me);break e}Re&&Re(i,ue,ce),i==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Ma(ue,"number",ue.value)}switch(Re=ce?Xi(ce):window,i){case"focusin":(s0(Re)||Re.contentEditable==="true")&&(Es=Re,Vh=ce,Ua=null);break;case"focusout":Ua=Vh=Es=null;break;case"mousedown":Yh=!0;break;case"contextmenu":case"mouseup":case"dragend":Yh=!1,m0(ve,h,me);break;case"selectionchange":if($E)break;case"keydown":case"keyup":m0(ve,h,me)}var Ue;if(Uh)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Cs?i0(i,h)&&(Ze="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ze="onCompositionStart");Ze&&(e0&&h.locale!=="ko"&&(Cs||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Cs&&(Ue=Xm()):(Ji=me,Ih="value"in Ji?Ji.value:Ji.textContent,Cs=!0)),Re=xc(ce,Ze),0<Re.length&&(Ze=new Qm(Ze,i,null,h,me),ve.push({event:Ze,listeners:Re}),Ue?Ze.data=Ue:(Ue=r0(h),Ue!==null&&(Ze.data=Ue)))),(Ue=jE?LE(i,h):OE(i,h))&&(Ze=xc(ce,"onBeforeInput"),0<Ze.length&&(Re=new Qm("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:Ze}),Re.data=Ue)),kk(ve,i,ce,h,me)}Uv(ve,s)})}function po(i,s,h){return{instance:i,listener:s,currentTarget:h}}function xc(i,s){for(var h=s+"Capture",g=[];i!==null;){var k=i,A=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||A===null||(k=La(i,h),k!=null&&g.unshift(po(i,k,A)),k=La(i,s),k!=null&&g.push(po(i,k,A))),i.tag===3)return g;i=i.return}return[]}function Rk(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gv(i,s,h,g,k){for(var A=s._reactName,I=[];h!==null&&h!==g;){var W=h,J=W.alternate,ce=W.stateNode;if(W=W.tag,J!==null&&J===g)break;W!==5&&W!==26&&W!==27||ce===null||(J=ce,k?(ce=La(h,A),ce!=null&&I.unshift(po(h,ce,J))):k||(ce=La(h,A),ce!=null&&I.push(po(h,ce,J)))),h=h.return}I.length!==0&&i.push({event:s,listeners:I})}var Dk=/\r\n?/g,Mk=/\u0000|\uFFFD/g;function qv(i){return(typeof i=="string"?i:""+i).replace(Dk,` +`).replace(Mk,"")}function Vv(i,s){return s=qv(s),qv(i)===s}function gt(i,s,h,g,k,A){switch(h){case"children":typeof g=="string"?s==="body"||s==="textarea"&&g===""||Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&s!=="body"&&Ss(i,""+g);break;case"className":vs(i,"class",g);break;case"tabIndex":vs(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,h,g);break;case"style":Vm(i,g,A);break;case"data":if(s!=="object"){vs(i,"data",g);break}case"src":case"href":if(g===""&&(s!=="a"||h!=="href")){i.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(h==="formAction"?(s!=="input"&>(i,s,"name",k.name,k,null),gt(i,s,"formEncType",k.formEncType,k,null),gt(i,s,"formMethod",k.formMethod,k,null),gt(i,s,"formTarget",k.formTarget,k,null)):(gt(i,s,"encType",k.encType,k,null),gt(i,s,"method",k.method,k,null),gt(i,s,"target",k.target,k,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"onClick":g!=null&&(i.onclick=wi);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}h=Nl(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""+g):i.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""):i.removeAttribute(h);break;case"capture":case"download":g===!0?i.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,g):i.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(h,g):i.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(h):i.setAttribute(h,g);break;case"popover":We("beforetoggle",i),We("toggle",i),_s(i,"popover",g);break;case"xlinkActuate":qn(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":qn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":qn(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":qn(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":qn(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":qn(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":qn(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":qn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":qn(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":_s(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=aE.get(h)||h,_s(i,h,g))}}function yd(i,s,h,g,k,A){switch(h){case"style":Vm(i,g,A);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"children":typeof g=="string"?Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&Ss(i,""+g);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"onClick":g!=null&&(i.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cl.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(k=h.endsWith("Capture"),s=h.slice(2,k?h.length-7:void 0),A=i[Qt]||null,A=A!=null?A[h]:null,typeof A=="function"&&i.removeEventListener(s,A,k),typeof g=="function")){typeof A!="function"&&A!==null&&(h in i?i[h]=null:i.hasAttribute(h)&&i.removeAttribute(h)),i.addEventListener(s,g,k);break e}h in i?i[h]=g:g===!0?i.setAttribute(h,""):_s(i,h,g)}}}function Zt(i,s,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var g=!1,k=!1,A;for(A in h)if(h.hasOwnProperty(A)){var I=h[A];if(I!=null)switch(A){case"src":g=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,A,I,h,null)}}k&>(i,s,"srcSet",h.srcSet,h,null),g&>(i,s,"src",h.src,h,null);return;case"input":We("invalid",i);var W=A=I=k=null,J=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":k=me;break;case"type":I=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":A=me;break;case"defaultValue":W=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:gt(i,s,g,me,h,null)}}bs(i,A,W,J,ce,I,k,!1);return;case"select":We("invalid",i),g=I=A=null;for(k in h)if(h.hasOwnProperty(k)&&(W=h[k],W!=null))switch(k){case"value":A=W;break;case"defaultValue":I=W;break;case"multiple":g=W;default:gt(i,s,k,W,h,null)}s=A,h=I,i.multiple=!!g,s!=null?Qi(i,!!g,s,!1):h!=null&&Qi(i,!!g,h,!0);return;case"textarea":We("invalid",i),A=k=g=null;for(I in h)if(h.hasOwnProperty(I)&&(W=h[I],W!=null))switch(I){case"value":g=W;break;case"defaultValue":k=W;break;case"children":A=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:gt(i,s,I,W,h,null)}Gm(i,g,k,A);return;case"option":for(J in h)if(h.hasOwnProperty(J)&&(g=h[J],g!=null))switch(J){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:gt(i,s,J,g,h,null)}return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(g=0;g<fo.length;g++)We(fo[g],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,ce,g,h,null)}return;default:if(Mh(s)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&yd(i,s,me,g,h,void 0));return}}for(W in h)h.hasOwnProperty(W)&&(g=h[W],g!=null&>(i,s,W,g,h,null))}function jk(i,s,h,g){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,A=null,I=null,W=null,J=null,ce=null,me=null;for(pe in h){var ve=h[pe];if(h.hasOwnProperty(pe)&&ve!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":J=ve;default:g.hasOwnProperty(pe)||gt(i,s,pe,null,g,ve)}}for(var ue in g){var pe=g[ue];if(ve=h[ue],g.hasOwnProperty(ue)&&(pe!=null||ve!=null))switch(ue){case"type":A=pe;break;case"name":k=pe;break;case"checked":ce=pe;break;case"defaultChecked":me=pe;break;case"value":I=pe;break;case"defaultValue":W=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,s));break;default:pe!==ve&>(i,s,ue,pe,g,ve)}}Da(i,I,W,J,ce,me,A,k);return;case"select":pe=I=W=ue=null;for(A in h)if(J=h[A],h.hasOwnProperty(A)&&J!=null)switch(A){case"value":break;case"multiple":pe=J;default:g.hasOwnProperty(A)||gt(i,s,A,null,g,J)}for(k in g)if(A=g[k],J=h[k],g.hasOwnProperty(k)&&(A!=null||J!=null))switch(k){case"value":ue=A;break;case"defaultValue":W=A;break;case"multiple":I=A;default:A!==J&>(i,s,k,A,g,J)}s=W,h=I,g=pe,ue!=null?Qi(i,!!h,ue,!1):!!g!=!!h&&(s!=null?Qi(i,!!h,s,!0):Qi(i,!!h,h?[]:"",!1));return;case"textarea":pe=ue=null;for(W in h)if(k=h[W],h.hasOwnProperty(W)&&k!=null&&!g.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:gt(i,s,W,null,g,k)}for(I in g)if(k=g[I],A=h[I],g.hasOwnProperty(I)&&(k!=null||A!=null))switch(I){case"value":ue=k;break;case"defaultValue":pe=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==A&>(i,s,I,k,g,A)}ja(i,ue,pe);return;case"option":for(var Te in h)if(ue=h[Te],h.hasOwnProperty(Te)&&ue!=null&&!g.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,s,Te,null,g,ue)}for(J in g)if(ue=g[J],pe=h[J],g.hasOwnProperty(J)&&ue!==pe&&(ue!=null||pe!=null))switch(J){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:gt(i,s,J,ue,g,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in h)ue=h[Be],h.hasOwnProperty(Be)&&ue!=null&&!g.hasOwnProperty(Be)&>(i,s,Be,null,g,ue);for(ce in g)if(ue=g[ce],pe=h[ce],g.hasOwnProperty(ce)&&ue!==pe&&(ue!=null||pe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:gt(i,s,ce,ue,g,pe)}return;default:if(Mh(s)){for(var mt in h)ue=h[mt],h.hasOwnProperty(mt)&&ue!==void 0&&!g.hasOwnProperty(mt)&&yd(i,s,mt,void 0,g,ue);for(me in g)ue=g[me],pe=h[me],!g.hasOwnProperty(me)||ue===pe||ue===void 0&&pe===void 0||yd(i,s,me,ue,g,pe);return}}for(var se in h)ue=h[se],h.hasOwnProperty(se)&&ue!=null&&!g.hasOwnProperty(se)&>(i,s,se,null,g,ue);for(ve in g)ue=g[ve],pe=h[ve],!g.hasOwnProperty(ve)||ue===pe||ue==null&&pe==null||gt(i,s,ve,ue,g,pe)}function Yv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lk(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var k=h[g],A=k.transferSize,I=k.initiatorType,W=k.duration;if(A&&W&&Yv(I)){for(I=0,W=k.responseEnd,g+=1;g<h.length;g++){var J=h[g],ce=J.startTime;if(ce>W)break;var me=J.transferSize,ve=J.initiatorType;me&&Yv(ve)&&(J=J.responseEnd,I+=me*(J<W?1:(W-ce)/(J-ce)))}if(--g,s+=8*(A+I)/(k.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var bd=null,Sd=null;function wc(i){return i.nodeType===9?i:i.ownerDocument}function Wv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function xd(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wd=null;function Ok(){var i=window.event;return i&&i.type==="popstate"?i===wd?!1:(wd=i,!0):(wd=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,Bk=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,Ik=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(i){return Zv.resolve(null).then(i).catch(zk)}:Kv;function zk(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Qv(i,s){var h=s,g=0;do{var k=h.nextSibling;if(i.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"||h==="/&"){if(g===0){i.removeChild(k),Qs(s);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")go(i.ownerDocument.documentElement);else if(h==="head"){h=i.ownerDocument.head,go(h);for(var A=h.firstChild;A;){var I=A.nextSibling,W=A.nodeName;A[Rr]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&A.rel.toLowerCase()==="stylesheet"||h.removeChild(A),A=I}}else h==="body"&&go(i.ownerDocument.body);h=k}while(h);Qs(s)}function Jv(i,s){var h=i;i=0;do{var g=h.nextSibling;if(h.nodeType===1?s?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(s?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(i===0)break;i--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||i++;h=g}while(h)}function Cd(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var h=s;switch(s=s.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Cd(h),Na(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}i.removeChild(h)}}function Hk(i,s,h,g){for(;i.nodeType===1;){var k=h;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Rr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(A=i.getAttribute("rel"),A==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(A!==k.rel||i.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||i.getAttribute("title")!==(k.title==null?null:k.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(A=i.getAttribute("src"),(A!==(k.src==null?null:k.src)||i.getAttribute("type")!==(k.type==null?null:k.type)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&A&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var A=k.name==null?null:""+k.name;if(k.type==="hidden"&&i.getAttribute("name")===A)return i}else return i;if(i=Un(i.nextSibling),i===null)break}return null}function Fk(i,s,h){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!h||(i=Un(i.nextSibling),i===null))return null;return i}function ey(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Un(i.nextSibling),i===null))return null;return i}function Ed(i){return i.data==="$?"||i.data==="$~"}function kd(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Pk(i,s){var h=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||h.readyState!=="loading")s();else{var g=function(){s(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Un(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Ad=null;function ty(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"||h==="/&"){if(s===0)return Un(i.nextSibling);s--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||s++}i=i.nextSibling}return null}function ny(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(s===0)return i;s--}else h!=="/$"&&h!=="/&"||s++}i=i.previousSibling}return null}function iy(i,s,h){switch(s=wc(h),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function go(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Na(i)}var $n=new Map,ry=new Set;function Cc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Hi=X.d;X.d={f:Uk,r:$k,D:Gk,C:qk,L:Vk,m:Yk,X:Xk,S:Wk,M:Kk};function Uk(){var i=Hi.f(),s=gc();return i||s}function $k(i){var s=Wi(i);s!==null&&s.tag===5&&s.type==="form"?S_(s):Hi.r(i)}var Xs=typeof document>"u"?null:document;function sy(i,s,h){var g=Xs;if(g&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),ry.has(k)||(ry.add(k),i={rel:i,crossOrigin:h,href:s},g.querySelector(k)===null&&(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Gk(i){Hi.D(i),sy("dns-prefetch",i,null)}function qk(i,s){Hi.C(i,s),sy("preconnect",i,s)}function Vk(i,s,h){Hi.L(i,s,h);var g=Xs;if(g&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=Ks(i);break;case"script":A=Zs(i)}$n.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),$n.set(A,i),g.querySelector(k)!==null||s==="style"&&g.querySelector(mo(A))||s==="script"&&g.querySelector(_o(A))||(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Yk(i,s){Hi.m(i,s);var h=Xs;if(h&&i){var g=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(g)+'"][href="'+on(i)+'"]',A=k;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Zs(i)}if(!$n.has(A)&&(i=d({rel:"modulepreload",href:i},s),$n.set(A,i),h.querySelector(k)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(_o(A)))return}g=h.createElement("link"),Zt(g,"link",i),Lt(g),h.head.appendChild(g)}}}function Wk(i,s,h){Hi.S(i,s,h);var g=Xs;if(g&&i){var k=Ki(g).hoistableStyles,A=Ks(i);s=s||"default";var I=k.get(A);if(!I){var W={loading:0,preload:null};if(I=g.querySelector(mo(A)))W.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=$n.get(A))&&Nd(i,h);var J=I=g.createElement("link");Lt(J),Zt(J,"link",i),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){W.loading|=1}),J.addEventListener("error",function(){W.loading|=2}),W.loading|=4,Ec(I,s,g)}I={type:"stylesheet",instance:I,count:1,state:W},k.set(A,I)}}}function Xk(i,s){Hi.X(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function Kk(i,s){Hi.M(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function ay(i,s,h,g){var k=(k=ae.current)?Cc(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=Ks(h.href),h=Ki(k).hoistableStyles,g=h.get(s),g||(g={type:"style",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Ks(h.href);var A=Ki(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(mo(i)))&&!A._p&&(I.instance=A,I.state.loading=5),$n.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},$n.set(i,h),A||Zk(k,i,h,I.state))),s&&g===null)throw Error(r(528,""));return I}if(s&&g!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Zs(h),h=Ki(k).hoistableScripts,g=h.get(s),g||(g={type:"script",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+on(i)+'"'}function mo(i){return'link[rel="stylesheet"]['+i+"]"}function oy(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function Zk(i,s,h,g){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?g.loading=1:(s=i.createElement("link"),g.preload=s,s.addEventListener("load",function(){return g.loading|=1}),s.addEventListener("error",function(){return g.loading|=2}),Zt(s,"link",h),Lt(s),i.head.appendChild(s))}function Zs(i){return'[src="'+on(i)+'"]'}function _o(i){return"script[async]"+i}function ly(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var g=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(g)return s.instance=g,Lt(g),g;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Lt(g),Zt(g,"style",k),Ec(g,h.precedence,i),s.instance=g;case"stylesheet":k=Ks(h.href);var A=i.querySelector(mo(k));if(A)return s.state.loading|=4,s.instance=A,Lt(A),A;g=oy(h),(k=$n.get(k))&&Nd(g,k),A=(i.ownerDocument||i).createElement("link"),Lt(A);var I=A;return I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),s.state.loading|=4,Ec(A,h.precedence,i),s.instance=A;case"script":return A=Zs(h.src),(k=i.querySelector(_o(A)))?(s.instance=k,Lt(k),k):(g=h,(k=$n.get(A))&&(g=d({},h),Td(g,k)),i=i.ownerDocument||i,k=i.createElement("script"),Lt(k),Zt(k,"link",g),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(g=s.instance,s.state.loading|=4,Ec(g,h.precedence,i));return s.instance}function Ec(i,s,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=g.length?g[g.length-1]:null,A=k,I=0;I<g.length;I++){var W=g[I];if(W.dataset.precedence===s)A=W;else if(A!==k)break}A?A.parentNode.insertBefore(i,A.nextSibling):(s=h.nodeType===9?h.head:h,s.insertBefore(i,s.firstChild))}function Nd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Td(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var kc=null;function cy(i,s,h){if(kc===null){var g=new Map,k=kc=new Map;k.set(h,g)}else k=kc,g=k.get(h),g||(g=new Map,k.set(h,g));if(g.has(i))return g;for(g.set(i,null),h=h.getElementsByTagName(i),k=0;k<h.length;k++){var A=h[k];if(!(A[Rr]||A[$t]||i==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(s)||"";I=i+I;var W=g.get(I);W?W.push(A):g.set(I,[A])}}return g}function uy(i,s,h){i=i.ownerDocument||i,i.head.insertBefore(h,s==="title"?i.querySelector("head > title"):null)}function Qk(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function hy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Jk(i,s,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=Ks(g.href),A=s.querySelector(mo(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ac.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Lt(A);return}A=s.ownerDocument||s,g=oy(g),(k=$n.get(k))&&Nd(g,k),A=A.createElement("link"),Lt(A);var I=A;I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Ac.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Rd=0;function eA(i,s){return i.stylesheets&&i.count===0&&Tc(i,i.stylesheets),0<i.count||0<i.imgCount?function(h){var g=setTimeout(function(){if(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend){var A=i.unsuspend;i.unsuspend=null,A()}},6e4+s);0<i.imgBytes&&Rd===0&&(Rd=62500*Lk());var k=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend)){var A=i.unsuspend;i.unsuspend=null,A()}},(i.imgBytes>Rd?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(k)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Nc=null;function Tc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Nc=new Map,s.forEach(tA,i),Nc=null,Ac.call(i))}function tA(i,s){if(!(s.state.loading&4)){var h=Nc.get(i);if(h)var g=h.get(null);else{h=new Map,Nc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<k.length;A++){var I=k[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(h.set(I.dataset.precedence,I),g=I)}g&&h.set(null,g)}k=s.instance,I=k.getAttribute("data-precedence"),A=h.get(I)||g,A===g&&h.set(null,k),h.set(I,k),this.count++,g=Ac.bind(this),k.addEventListener("load",g),k.addEventListener("error",g),A?A.parentNode.insertBefore(k,A.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(k,i.firstChild)),s.state.loading|=4}}var vo={$$typeof:y,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function nA(i,s,h,g,k,A,I,W,J){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=g,this.onUncaughtError=k,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function fy(i,s,h,g,k,A,I,W,J,ce,me,ve){return i=new nA(i,s,h,I,J,ce,me,ve,W),s=1,A===!0&&(s|=24),A=bn(3,null,null,s),i.current=A,A.stateNode=i,s=cf(),s.refCount++,i.pooledCache=s,s.refCount++,A.memoizedState={element:g,isDehydrated:h,cache:s},df(A),i}function dy(i){return i?(i=Ns,i):Ns}function py(i,s,h,g,k,A){k=dy(k),g.context===null?g.context=k:g.pendingContext=k,g=sr(s),g.payload={element:h},A=A===void 0?null:A,A!==null&&(g.callback=A),h=ar(i,g,s),h!==null&&(dn(h,i,s),Xa(h,i,s))}function gy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<s?h:s}}function Dd(i,s){gy(i,s),(i=i.alternate)&&gy(i,s)}function my(i){if(i.tag===13||i.tag===31){var s=Or(i,67108864);s!==null&&dn(s,i,67108864),Dd(i,67108864)}}function _y(i){if(i.tag===13||i.tag===31){var s=En();s=ka(s);var h=Or(i,s);h!==null&&dn(h,i,s),Dd(i,s)}}var Rc=!0;function iA(i,s,h,g){var k=G.T;G.T=null;var A=X.p;try{X.p=2,Md(i,s,h,g)}finally{X.p=A,G.T=k}}function rA(i,s,h,g){var k=G.T;G.T=null;var A=X.p;try{X.p=8,Md(i,s,h,g)}finally{X.p=A,G.T=k}}function Md(i,s,h,g){if(Rc){var k=jd(g);if(k===null)vd(i,s,g,Dc,h),yy(i,g);else if(aA(k,i,s,h,g))g.stopPropagation();else if(yy(i,g),s&4&&-1<sA.indexOf(i)){for(;k!==null;){var A=Wi(k);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=On(A.pendingLanes);if(I!==0){var W=A;for(W.pendingLanes|=2,W.entangledLanes|=2;I;){var J=1<<31-st(I);W.entanglements[1]|=J,I&=~J}oi(A),(ot&6)===0&&(dc=Fe()+500,ho(0))}}break;case 31:case 13:W=Or(A,2),W!==null&&dn(W,A,2),gc(),Dd(A,2)}if(A=jd(g),A===null&&vd(i,s,g,Dc,h),A===k)break;k=A}k!==null&&g.stopPropagation()}else vd(i,s,g,null,h)}}function jd(i){return i=Lh(i),Ld(i)}var Dc=null;function Ld(i){if(Dc=null,i=Yi(i),i!==null){var s=l(i);if(s===null)i=null;else{var h=s.tag;if(h===13){if(i=u(s),i!==null)return i;i=null}else if(h===31){if(i=o(s),i!==null)return i;i=null}else if(h===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dc=i,null}function vy(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case ie:return 2;case de:return 8;case Se:case Ae:return 32;case De:return 268435456;default:return 32}default:return 32}}var Od=!1,_r=null,vr=null,yr=null,yo=new Map,bo=new Map,br=[],sA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yy(i,s){switch(i){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":yo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(s.pointerId)}}function So(i,s,h,g,k,A){return i===null||i.nativeEvent!==A?(i={blockedOn:s,domEventName:h,eventSystemFlags:g,nativeEvent:A,targetContainers:[k]},s!==null&&(s=Wi(s),s!==null&&my(s)),i):(i.eventSystemFlags|=g,s=i.targetContainers,k!==null&&s.indexOf(k)===-1&&s.push(k),i)}function aA(i,s,h,g,k){switch(s){case"focusin":return _r=So(_r,i,s,h,g,k),!0;case"dragenter":return vr=So(vr,i,s,h,g,k),!0;case"mouseover":return yr=So(yr,i,s,h,g,k),!0;case"pointerover":var A=k.pointerId;return yo.set(A,So(yo.get(A)||null,i,s,h,g,k)),!0;case"gotpointercapture":return A=k.pointerId,bo.set(A,So(bo.get(A)||null,i,s,h,g,k)),!0}return!1}function by(i){var s=Yi(i.target);if(s!==null){var h=l(s);if(h!==null){if(s=h.tag,s===13){if(s=u(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===31){if(s=o(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var h=jd(i.nativeEvent);if(h===null){h=i.nativeEvent;var g=new h.constructor(h.type,h);jh=g,h.target.dispatchEvent(g),jh=null}else return s=Wi(h),s!==null&&my(s),i.blockedOn=h,!1;s.shift()}return!0}function Sy(i,s,h){Mc(i)&&h.delete(s)}function oA(){Od=!1,_r!==null&&Mc(_r)&&(_r=null),vr!==null&&Mc(vr)&&(vr=null),yr!==null&&Mc(yr)&&(yr=null),yo.forEach(Sy),bo.forEach(Sy)}function jc(i,s){i.blockedOn===s&&(i.blockedOn=null,Od||(Od=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,oA)))}var Lc=null;function xy(i){Lc!==i&&(Lc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lc===i&&(Lc=null);for(var s=0;s<i.length;s+=3){var h=i[s],g=i[s+1],k=i[s+2];if(typeof g!="function"){if(Ld(g||h)===null)continue;break}var A=Wi(h);A!==null&&(i.splice(s,3),s-=3,jf(A,{pending:!0,data:k,method:h.method,action:g},g,k))}}))}function Qs(i){function s(J){return jc(J,i)}_r!==null&&jc(_r,i),vr!==null&&jc(vr,i),yr!==null&&jc(yr,i),yo.forEach(s),bo.forEach(s);for(var h=0;h<br.length;h++){var g=br[h];g.blockedOn===i&&(g.blockedOn=null)}for(;0<br.length&&(h=br[0],h.blockedOn===null);)by(h),h.blockedOn===null&&br.shift();if(h=(i.ownerDocument||i).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var k=h[g],A=h[g+1],I=k[Qt]||null;if(typeof A=="function")I||xy(h);else if(I){var W=null;if(A&&A.hasAttribute("formAction")){if(k=A,I=A[Qt]||null)W=I.formAction;else if(Ld(k)!==null)continue}else W=I.action;typeof W=="function"?h[g+1]=W:(h.splice(g,3),g-=3),xy(h)}}}function wy(){function i(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return k=I})},focusReset:"manual",scroll:"manual"})}function s(){k!==null&&(k(),k=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,k=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),k!==null&&(k(),k=null)}}}function Bd(i){this._internalRoot=i}Oc.prototype.render=Bd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var h=s.current,g=En();py(h,g,i,s,null,null)},Oc.prototype.unmount=Bd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;py(i.current,2,null,i,null,null),gc(),s[Si]=null}};function Oc(i){this._internalRoot=i}Oc.prototype.unstable_scheduleHydration=function(i){if(i){var s=yl();i={blockedOn:null,target:i,priority:s};for(var h=0;h<br.length&&s!==0&&s<br[h].priority;h++);br.splice(h,0,i),h===0&&by(i)}};var Cy=t.version;if(Cy!=="19.2.7")throw Error(r(527,Cy,"19.2.7"));X.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var lA={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{Nt=Bc.inject(lA),Et=Bc}catch{}}return wo.createRoot=function(i,s){if(!a(i))throw Error(r(299));var h=!1,g="",k=D_,A=M_,I=j_;return s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(k=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(I=s.onRecoverableError)),s=fy(i,1,!1,null,null,h,g,null,k,A,I,wy),i[Si]=s.current,_d(i),new Bd(s)},wo.hydrateRoot=function(i,s,h){if(!a(i))throw Error(r(299));var g=!1,k="",A=D_,I=M_,W=j_,J=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onUncaughtError!==void 0&&(A=h.onUncaughtError),h.onCaughtError!==void 0&&(I=h.onCaughtError),h.onRecoverableError!==void 0&&(W=h.onRecoverableError),h.formState!==void 0&&(J=h.formState)),s=fy(i,1,!0,s,h??null,g,k,J,A,I,W,wy),s.context=dy(null),h=s.current,g=En(),g=ka(g),k=sr(g),k.callback=null,ar(h,k,g),h=g,s.current.lanes=h,qe(s,h),oi(s),i[Si]=s.current,_d(i),new Oc(s)},wo.version="19.2.7",wo}var Ly;function vA(){if(Ly)return Hd.exports;Ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hd.exports=_A(),Hd.exports}var yA=vA();/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oy=e=>{const t=SA(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var $d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},wA=q.createContext({}),CA=()=>q.useContext(wA),EA=q.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:_="currentColor",className:v=""}=CA()??{},w=r??d?Number(n??p)*24/Number(t??f):n??p;return q.createElement("svg",{ref:c,...$d,width:t??f??$d.width,height:t??f??$d.height,stroke:e??_,strokeWidth:w,className:PS("lucide",v,a),...!l&&!xA(o)&&{"aria-hidden":"true"},...o},[...u.map(([C,b])=>q.createElement(C,b)),...Array.isArray(l)?l:[l]])});/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $e=(e,t)=>{const n=q.forwardRef(({className:r,...a},l)=>q.createElement(EA,{ref:l,iconNode:t,className:PS(`lucide-${bA(Oy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Oy(e),n};/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jo=$e("arrow-left",kA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ic=$e("arrow-right",AA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],TA=$e("blocks",NA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RA=[["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"}]],DA=$e("boxes",RA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_n=$e("check",MA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cs=$e("chevron-down",jA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=$e("chevron-right",LA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],BA=$e("circle-stop",OA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],zA=$e("cloud",IA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],FA=$e("code",HA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yg=$e("copy",PA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],US=$e("corner-down-left",UA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $A=[["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"}]],GA=$e("cpu",$A);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],VA=$e("ellipsis",qA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YA=[["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"}]],$S=$e("external-link",YA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],GS=$e("file-code",WA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],KA=$e("file-text",XA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],QA=$e("file",ZA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JA=[["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"}]],eN=$e("flask-conical",JA);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tN=[["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"}]],qS=$e("folder-open",tN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nN=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],VS=$e("folder-tree",nN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iN=[["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"}]],rN=$e("folder",iN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],$u=$e("git-branch",sN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],oN=$e("hard-drive",aN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cN=$e("info",lN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],hN=$e("laptop",uN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fN=[["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"}]],dN=$e("lock",fN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],gN=$e("maximize-2",pN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],_N=$e("minimize-2",mN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],YS=$e("panel-left",vN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bg=$e("plus",yN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bN=[["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"}]],Su=$e("refresh-cw",bN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SN=[["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"}]],Sg=$e("rotate-cw",SN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],WS=$e("scroll-text",xN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ap=$e("server",wN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CN=[["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"}]],EN=$e("sliders-horizontal",CN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kN=[["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"}]],AN=$e("square-terminal",kN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],XS=$e("terminal",NN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TN=[["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"}]],Gu=$e("trash-2",TN);/** + * @license lucide-react v1.24.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fo=$e("x",RN);async function us(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const ut=e=>fetch(e).then(t=>us(t)),Dt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>us(n)),KS=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>us(n)),DN=()=>ut("/api/projects").then(e=>e.projects),MN=e=>Dt("/api/projects",e).then(t=>t.project),jN=e=>ut(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),LN=e=>ut(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),ON=e=>Dt(`/api/projects/${e}/open`).then(t=>t.project),BN=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),IN=e=>ut(`/api/projects/${e}/experiments`).then(t=>t.experiments),zN=e=>ut(`/api/projects/${e}/runs`).then(t=>t.runs),HN=()=>ut("/api/instances").then(e=>e.instances),ZS=e=>Dt(`/api/runs/${e}/cancel`),FN=(e,t)=>ut(`/api/runs/${e}/log?offset=${t}`),PN=e=>ut(`/api/experiments/${e}/commits`).then(t=>t.commits),UN=(e,t)=>ut(`/api/experiments/${e}/commits/${t}/diff`),By=e=>ut(`/api/projects/${e}/working-tree`),QS=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),$N=(e,t,n={})=>ut(`/api/projects/${e}/file?${QS(n,new URLSearchParams({path:t}))}`),GN=(e,t={})=>{const n=QS(t).toString();return ut(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},xg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,qN=()=>ut("/api/settings/hf"),VN=e=>Dt("/api/settings/hf",{token:e}),YN=()=>ut("/api/settings/k8s"),WN=e=>Dt("/api/settings/k8s",e),XN=()=>ut("/api/settings/modal"),KN=()=>Dt("/api/settings/modal/provision"),ZN=()=>ut("/api/settings/env").then(e=>e.vars),JS=(e,t)=>Dt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),QN=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>us(t)).then(t=>t.vars),ex=()=>ut("/api/settings/data-dir"),JN=e=>Dt("/api/settings/data-dir/validate",{path:e}),eT=e=>Dt("/api/settings/data-dir",{path:e}),tT=e=>Dt("/api/settings/data-dir/move",{path:e}),nT=()=>ut("/api/settings/ssh").then(e=>e.hosts),iT=e=>Dt("/api/settings/ssh/preflight",{host:e}),rT=()=>ut("/api/settings/slurm"),sT=e=>Dt("/api/settings/slurm",e),aT=e=>Dt("/api/settings/slurm/preflight",{host:e}),oT=()=>ut("/api/settings/compute"),tx=e=>Dt("/api/settings/compute/default",e),lT=()=>ut("/api/settings/local"),cT=()=>ut("/api/settings/openresearch"),Iy=e=>ut(`/api/projects/${e}/files`),uT=(e,t)=>ut(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),hT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>us(n)),Np=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,nx=()=>ut("/api/settings/git"),fT=e=>Dt("/api/settings/git",e),dT=e=>Dt("/api/settings/git/token",{token:e}),pT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>us(e)),gT=()=>ut("/api/settings/telemetry"),mT=e=>Dt("/api/settings/telemetry",{enabled:e}),_T=e=>Dt("/api/settings/telemetry/consent",{enabled:e}),wg=(e=!1)=>ut(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),vT=()=>ut("/api/skills").then(e=>e.skills);function xu(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const zy=e=>ut(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),yT=(e,t,n={})=>Dt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),bT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>us(t)),ST=(e,t)=>KS(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),xT=(e,t)=>KS(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Hy=e=>ut(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),wT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,CT=(e,t,n={},r)=>Dt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),ET=e=>Dt(`/api/chat/sessions/${e}/interrupt`),kT=(e,t)=>Dt(`/api/chat/sessions/${e}/respond`,t);function Sa(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Fy(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ns(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return r===0?`${e} B`:`${n.toFixed(1)} ${t[r]}`}function Tp(e){return e.length>10?`${e.slice(0,10)}…`:e}function ix(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function rx(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const cu=new Map;function AT(e,t){let n=cu.get(e);return n||(n=new Set,cu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&cu.delete(e)}}function NT(e){var t;(t=cu.get(e.runId))==null||t.forEach(n=>n(e))}const Rp=new Set;function TT(e){return Rp.add(e),()=>{Rp.delete(e)}}function zc(e){Rp.forEach(t=>t(e))}const Dp=new Set;function RT(e){return Dp.add(e),()=>{Dp.delete(e)}}function Gd(e){Dp.forEach(t=>t(e))}function DT(e){const t=q.useRef(e);t.current=e,q.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&NT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&zc({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&zc({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Gd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Gd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Gd({type:"error",error:l.error})}),()=>n.close()},[])}function Py(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function MT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OT={};function Uy(e,t){return(OT.jsx?LT:jT).test(e)}const BT=/[ \t\n\f\r]/g;function IT(e){return typeof e=="object"?e.type==="text"?$y(e.value):!1:$y(e)}function $y(e){return e.replace(BT,"")===""}class ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ol.prototype.normal={};ol.prototype.property={};ol.prototype.space=void 0;function sx(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ol(n,r,t)}function Po(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let zT=0;const ze=hs(),Ht=hs(),Mp=hs(),xe=hs(),vt=hs(),Jr=hs(),kn=hs();function hs(){return 2**++zT}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ht,commaOrSpaceSeparated:kn,commaSeparated:Jr,number:xe,overloadedBoolean:Mp,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),qd=Object.keys(jp);class Cg extends vn{constructor(t,n,r,a){let l=-1;if(super(t,n),Gy(this,"space",a),typeof r=="number")for(;++l<qd.length;){const u=qd[l];Gy(this,qd[l],(r&jp[u])===jp[u])}}}Cg.prototype.defined=!0;function Gy(e,t,n){n&&(e[t]=n)}function xa(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new Cg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Po(r)]=r,n[Po(l.attribute)]=r}return new ol(t,n,e.space)}const ax=xa({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:vt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:xe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:vt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ht,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ox(e,t){return t in e?e[t]:t}function lx(e,t){return ox(e,t.toLowerCase())}const HT=xa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jr,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,closedBy:null,colorSpace:null,cols:xe,colSpan:xe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:ze,controlsList:vt,coords:xe|Jr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Mp,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:xe,hidden:Mp,high:xe,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:xe,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:xe,rowSpan:xe,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ht,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:Jr,part:vt,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:lx}),FT=xa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jr,g2:Jr,glyphName:Jr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ox}),cx=xa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ux=xa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:lx}),hx=xa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),PT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},UT=/[A-Z]/g,qy=/-[a-z]/g,$T=/^data[-\w.:]+$/i;function fx(e,t){const n=Po(t);let r=t,a=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$T.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(qy,qT);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!qy.test(l)){let u=l.replace(UT,GT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Cg}return new a(r,t)}function GT(e){return"-"+e.toLowerCase()}function qT(e){return e.charAt(1).toUpperCase()}const dx=sx([ax,HT,cx,ux,hx],"html"),qu=sx([ax,FT,cx,ux,hx],"svg");function Vy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function VT(e){return e.join(" ").trim()}var Js={},Vd,Yy;function YT(){if(Yy)return Vd;Yy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` +`,f="/",p="*",d="",_="comment",v="declaration";function w(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var x=1,y=1;function E(z){var V=z.match(t);V&&(x+=V.length);var G=z.lastIndexOf(c);y=~G?z.length-G:y+z.length}function R(){var z={line:x,column:y};return function(V){return V.position=new N(z),j(),V}}function N(z){this.start=z,this.end={line:x,column:y},this.source=S.source}N.prototype.content=b;function D(z){var V=new Error(S.source+":"+x+":"+y+": "+z);if(V.reason=z,V.filename=S.source,V.line=x,V.column=y,V.source=b,!S.silent)throw V}function T(z){var V=z.exec(b);if(V){var G=V[0];return E(G),b=b.slice(G.length),V}}function j(){T(n)}function B(z){var V;for(z=z||[];V=F();)V!==!1&&z.push(V);return z}function F(){var z=R();if(!(f!=b.charAt(0)||p!=b.charAt(1))){for(var V=2;d!=b.charAt(V)&&(p!=b.charAt(V)||f!=b.charAt(V+1));)++V;if(V+=2,d===b.charAt(V-1))return D("End of comment missing");var G=b.slice(2,V-2);return y+=2,E(G),b=b.slice(V),y+=2,z({type:_,comment:G})}}function Y(){var z=R(),V=T(r);if(V){if(F(),!T(a))return D("property missing ':'");var G=T(l),X=z({type:v,property:C(V[0].replace(e,d)),value:G?C(G[0].replace(e,d)):d});return T(u),X}}function H(){var z=[];B(z);for(var V;V=Y();)V!==!1&&(z.push(V),B(z));return z}return j(),H()}function C(b){return b?b.replace(o,d):d}return Vd=w,Vd}var Wy;function WT(){if(Wy)return Js;Wy=1;var e=Js&&Js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.default=n;const t=e(YT());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return Js}var Co={},Xy;function XT(){if(Xy)return Co;Xy=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return Co.camelCase=c,Co}var Eo,Ky;function KT(){if(Ky)return Eo;Ky=1;var e=Eo&&Eo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(WT()),n=XT();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Eo=r,Eo}var ZT=KT();const QT=Pu(ZT),px=gx("end"),Eg=gx("start");function gx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function JT(e){const t=Eg(e),n=px(e);if(t&&n)return{start:t,end:n}}function Lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zy(e.position):"start"in e||"end"in e?Zy(e):"line"in e||"column"in e?Lp(e):""}function Lp(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Zy(e){return Lp(e&&e.start)+"-"+Lp(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Lo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const kg={}.hasOwnProperty,e3=new Map,t3=/[A-Z]/g,n3=new Set(["table","tbody","thead","tfoot","tr"]),i3=new Set(["td","th"]),mx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function r3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=f3(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=h3(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qu:dx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=_x(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function _x(e,t,n){if(t.type==="element")return s3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return a3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return l3(e,t,n);if(t.type==="mdxjsEsm")return o3(e,t);if(t.type==="root")return c3(e,t,n);if(t.type==="text")return u3(e,t)}function s3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=yx(e,t.tagName,!1),u=d3(e,t);let o=Ng(e,t);return n3.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!IT(c):!0})),vx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function a3(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uo(e,t.position)}function o3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uo(e,t.position)}function l3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:yx(e,t.name,!0),u=p3(e,t),o=Ng(e,t);return vx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function c3(e,t,n){const r={};return Ag(r,Ng(e,t)),e.create(t,e.Fragment,r,n)}function u3(e,t){return t.value}function vx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ag(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function h3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function f3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Eg(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function d3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&kg.call(t.properties,a)){const l=g3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&i3.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function p3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Uo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Uo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Ng(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:e3;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const f=a.get(c)||0;u=c+"-"+f,a.set(c,f+1)}}const o=_x(e,l,u);o!==void 0&&n.push(o)}return n}function g3(e,t,n){const r=fx(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?MT(n):VT(n)),r.property==="style"){let a=typeof n=="object"?n:m3(e,String(n));return e.stylePropertyNameCase==="css"&&(a=_3(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?PT[r.property]||r.property:r.attribute,n]}}function m3(e,t){try{return QT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=mx+"#cannot-parse-style-attribute",a}}function yx(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const o=Uy(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=u}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return kg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(e,t){const n=new tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mx+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _3(e){const t={};let n;for(n in e)kg.call(e,n)&&(t[v3(n)]=e[n]);return t}function v3(e){let t=e.replace(t3,y3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function y3(e){return"-"+e.toLowerCase()}const Yd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},b3={};function Tg(e,t){const n=b3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bx(e,r,a)}function bx(e,t,n){if(S3(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,n)}return Array.isArray(e)?Jy(e,t,n):""}function Jy(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=bx(e[a],t,n);return r.join("")}function S3(e){return!!(e&&typeof e=="object")}const e1=document.createElement("i");function $o(e){const t="&"+e+";";e1.innerHTML=t;const n=e1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tn(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Gn(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const t1={}.hasOwnProperty;function Sx(e){const t={};let n=-1;for(;++n<e.length;)x3(t,e[n]);return t}function x3(e,t){let n;for(n in t){const a=(t1.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){t1.call(a,u)||(a[u]=[]);const o=l[u];w3(a[u],Array.isArray(o)?o:o?[o]:[])}}}function w3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tn(e,0,0,r)}function xx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Nr(/[A-Za-z]/),en=Nr(/[\dA-Za-z]/),C3=Nr(/[#-'*+\--9=?A-Z^-~]/);function wu(e){return e!==null&&(e<32||e===127)}const Op=Nr(/\d/),E3=Nr(/[\dA-Fa-f]/),k3=Nr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const Vu=Nr(new RegExp("\\p{P}|\\p{S}","u")),is=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wa(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&en(e.charCodeAt(n+1))&&en(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function et(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Xe(c)?(e.enter(n),o(c)):t(c)}function o(c){return Xe(c)&&l++<a?(e.consume(c),o):(e.exit(n),t(c))}}const A3={tokenize:N3};function N3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),u)}}const T3={tokenize:R3},n1={tokenize:D3};function R3(e){const t=this,n=[];let r=0,a,l,u;return o;function o(y){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,c,f)(y)}return f(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const E=t.events.length;let R=E,N;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){N=t.events[R][1].end;break}S(r);let D=E;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return Tn(t.events,R+1,0,t.events.slice(E)),t.events.length=D,f(y)}return o(y)}function f(y){if(r===n.length){if(!a)return _(y);if(a.currentConstruct&&a.currentConstruct.concrete)return w(y);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(n1,p,d)(y)}function p(y){return a&&x(),S(r),_(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(y)}function _(y){return t.containerState={},e.attempt(n1,v,w)(y)}function v(y){return r++,n.push([t.currentConstruct,t.containerState]),_(y)}function w(y){if(y===null){a&&x(),S(0),e.consume(y);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),C(y)}function C(y){if(y===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(y);return}return Oe(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),C)}function b(y,E){const R=t.sliceStream(y);if(E&&R.push(null),y.previous=l,l&&(l.next=y),l=y,a.defineSkip(y.start),a.write(R),t.parser.lazy[y.start.line]){let N=a.events.length;for(;N--;)if(a.events[N][1].start.offset<u&&(!a.events[N][1].end||a.events[N][1].end.offset>u))return;const D=t.events.length;let T=D,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(S(r),N=D;N<t.events.length;)t.events[N][1].end={...B},N++;Tn(t.events,T+1,0,t.events.slice(D)),t.events.length=N}}function S(y){let E=n.length;for(;E-- >y;){const R=n[E];t.containerState=R[1],R[0].exit.call(t,e)}n.length=y}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function D3(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fa(e){if(e===null||yt(e)||is(e))return 1;if(Vu(e))return 2}function Yu(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Bp={name:"attention",resolveAll:M3,tokenize:j3};function M3(e,t){let n=-1,r,a,l,u,o,c,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},_={...e[n][1].start};i1(d,-c),i1(_,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,Yu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function j3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=fa(r);let l;return u;function u(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const f=e.exit("attentionSequence"),p=fa(c),d=!p||p===2&&a||n.includes(c),_=!a||a===2&&p||n.includes(r);return f._open=!!(l===42?d:d&&(a||!_)),f._close=!!(l===42?_:_&&(p||!d)),t(c)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const L3={name:"autolink",tokenize:O3};function O3(e,t,n){let r=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return sn(v)?(e.consume(v),u):v===64?n(v):f(v)}function u(v){return v===43||v===45||v===46||en(v)?(r=1,o(v)):f(v)}function o(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||en(v))&&r++<32?(e.consume(v),o):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||wu(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),p):C3(v)?(e.consume(v),f):n(v)}function p(v){return en(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):_(v)}function _(v){if((v===45||en(v))&&r++<63){const w=v===45?_:d;return e.consume(v),w}return n(v)}}const ll={partial:!0,tokenize:B3};function B3(e,t,n){return r;function r(l){return Xe(l)?et(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Oe(l)?t(l):n(l)}}const wx={continuation:{tokenize:z3},exit:H3,name:"blockQuote",tokenize:I3};function I3(e,t,n){const r=this;return a;function a(u){if(u===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function z3(e,t,n){const r=this;return a;function a(u){return Xe(u)?et(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(wx,t,n)(u)}}function H3(e){e.exit("blockQuote")}const Cx={name:"characterEscape",tokenize:F3};function F3(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return k3(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const Ex={name:"characterReference",tokenize:P3};function P3(e,t,n){const r=this;let a=0,l,u;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),l=31,u=en,p(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=E3,p):(e.enter("characterReferenceValue"),l=7,u=Op,p(d))}function p(d){if(d===59&&a){const _=e.exit("characterReferenceValue");return u===en&&!$o(r.sliceSerialize(_))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(d)&&a++<l?(e.consume(d),p):n(d)}}const r1={partial:!0,tokenize:$3},s1={concrete:!0,name:"codeFenced",tokenize:U3};function U3(e,t,n){const r=this,a={partial:!0,tokenize:R};let l=0,u=0,o;return c;function c(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===o?(u++,e.consume(N),p):u<3?n(N):(e.exit("codeFencedFenceSequence"),Xe(N)?et(e,d,"whitespace")(N):d(N))}function d(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(r1,C,E)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(N))}function _(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):Xe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,v,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),_)}function v(N){return N===null||Oe(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===o?n(N):(e.consume(N),w)}function C(N){return e.attempt(a,E,b)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),S}function S(N){return l>0&&Xe(N)?et(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Oe(N)?e.check(r1,C,E)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),y)}function E(N){return e.exit("codeFenced"),t(N)}function R(N,D,T){let j=0;return B;function B(V){return N.enter("lineEnding"),N.consume(V),N.exit("lineEnding"),F}function F(V){return N.enter("codeFencedFence"),Xe(V)?et(N,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Y(V)}function Y(V){return V===o?(N.enter("codeFencedFenceSequence"),H(V)):T(V)}function H(V){return V===o?(j++,N.consume(V),H):j>=u?(N.exit("codeFencedFenceSequence"),Xe(V)?et(N,z,"whitespace")(V):z(V)):T(V)}function z(V){return V===null||Oe(V)?(N.exit("codeFencedFence"),D(V)):T(V)}}}function $3(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Wd={name:"codeIndented",tokenize:q3},G3={partial:!0,tokenize:V3};function q3(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),et(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Oe(f)?e.attempt(G3,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Oe(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function V3(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):et(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Oe(u)?a(u):n(u)}}const Y3={name:"codeText",previous:X3,resolve:W3,tokenize:K3};function W3(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function X3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function K3(e,t,n){let r=0,a,l;return u;function u(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(l=e.enter("codeTextSequence"),a=0,p(d)):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||Oe(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function p(d){return d===96?(e.consume(d),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",f(d))}}class Z3{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&ko(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ko(this.left,n.reverse())}}}function ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kx(e){const t={};let n=-1,r,a,l,u,o,c,f;const p=new Z3(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Q3(p,n)),n=t[n],f=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},o=p.slice(a,n),o.unshift(r),p.splice(a,n-a+1,o))}}return Tn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Q3(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],f={};let p,d,_=-1,v=n,w=0,C=0;const b=[C];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),d&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++_<o.length;)o[_][0]==="exit"&&o[_-1][0]==="enter"&&o[_][1].type===o[_-1][1].type&&o[_][1].start.line!==o[_][1].end.line&&(C=_+1,b.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):b.pop(),_=b.length;_--;){const S=o.slice(b[_],b[_+1]),x=l.pop();c.push([x,x+S.length-1]),e.splice(x,2,S)}for(c.reverse(),_=-1;++_<c.length;)f[w+c[_][0]]=w+c[_][1],w+=c[_][1]-c[_][0]-1;return f}const J3={resolve:t5,tokenize:n5},e5={partial:!0,tokenize:i5};function t5(e){return kx(e),e}function n5(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?l(o):Oe(o)?e.check(e5,u,l)(o):(e.consume(o),a)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function u(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function i5(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,l,"linePrefix")}function l(u){if(u===null||Oe(u))return n(u);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Ax(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(S){return S===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(S),e.exit(l),_):S===null||S===32||S===41||wu(S)?n(S):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),C(S))}function _(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(o),_(S)):S===null||S===60||Oe(S)?n(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||yt(S))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||wu(S)?n(S):(e.consume(S),S===92?b:C)}function b(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function Nx(e,t,n,r,a,l){const u=this;let o=0,c;return f;function f(v){return e.enter(r),e.enter(a),e.consume(v),e.exit(a),e.enter(l),p}function p(v){return o>999||v===null||v===91||v===93&&!c||v===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||Oe(v)||o++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Xe(v)),v===92?_:d)}function _(v){return v===91||v===92||v===93?(e.consume(v),o++,d):d(v)}}function Tx(e,t,n,r,a,l){let u;return o;function o(_){return _===34||_===39||_===40?(e.enter(r),e.enter(a),e.consume(_),e.exit(a),u=_===40?41:_,c):n(_)}function c(_){return _===u?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):(e.enter(l),f(_))}function f(_){return _===u?(e.exit(l),c(u)):_===null?n(_):Oe(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),et(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===u||_===null||Oe(_)?(e.exit("chunkString"),f(_)):(e.consume(_),_===92?d:p)}function d(_){return _===u||_===92?(e.consume(_),p):p(_)}}function Oo(e,t){let n;return r;function r(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Xe(a)?et(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const r5={name:"definition",tokenize:a5},s5={partial:!0,tokenize:o5};function a5(e,t,n){const r=this;let a;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return Nx.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function o(v){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return yt(v)?Oo(e,f)(v):f(v)}function f(v){return Ax(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(s5,d,d)(v)}function d(v){return Xe(v)?et(e,_,"whitespace")(v):_(v)}function _(v){return v===null||Oe(v)?(e.exit("definition"),r.parser.defined.push(a),t(v)):n(v)}}function o5(e,t,n){return r;function r(o){return yt(o)?Oo(e,a)(o):n(o)}function a(o){return Tx(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Xe(o)?et(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Oe(o)?t(o):n(o)}}const l5={name:"hardBreakEscape",tokenize:c5};function c5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Oe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const u5={name:"headingAtx",resolve:h5,tokenize:f5};function h5(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function f5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||yt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(e.exit("atxHeading"),t(p)):Xe(p)?et(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||yt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const d5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a1=["pre","script","style","textarea"],p5={concrete:!0,name:"htmlFlow",resolveTo:_5,tokenize:v5},g5={partial:!0,tokenize:b5},m5={partial:!0,tokenize:y5};function _5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function v5(e,t,n){const r=this;let a,l,u,o,c;return f;function f(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),_):U===47?(e.consume(U),l=!0,C):U===63?(e.consume(U),a=3,r.interrupt?t:M):sn(U)?(e.consume(U),u=String.fromCharCode(U),b):n(U)}function _(U){return U===45?(e.consume(U),a=2,v):U===91?(e.consume(U),a=5,o=0,w):sn(U)?(e.consume(U),a=4,r.interrupt?t:M):n(U)}function v(U){return U===45?(e.consume(U),r.interrupt?t:M):n(U)}function w(U){const Q="CDATA[";return U===Q.charCodeAt(o++)?(e.consume(U),o===Q.length?r.interrupt?t:Y:w):n(U)}function C(U){return sn(U)?(e.consume(U),u=String.fromCharCode(U),b):n(U)}function b(U){if(U===null||U===47||U===62||yt(U)){const Q=U===47,re=u.toLowerCase();return!Q&&!l&&a1.includes(re)?(a=1,r.interrupt?t(U):Y(U)):d5.includes(u.toLowerCase())?(a=6,Q?(e.consume(U),S):r.interrupt?t(U):Y(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):l?x(U):y(U))}return U===45||en(U)?(e.consume(U),u+=String.fromCharCode(U),b):n(U)}function S(U){return U===62?(e.consume(U),r.interrupt?t:Y):n(U)}function x(U){return Xe(U)?(e.consume(U),x):B(U)}function y(U){return U===47?(e.consume(U),B):U===58||U===95||sn(U)?(e.consume(U),E):Xe(U)?(e.consume(U),y):B(U)}function E(U){return U===45||U===46||U===58||U===95||en(U)?(e.consume(U),E):R(U)}function R(U){return U===61?(e.consume(U),N):Xe(U)?(e.consume(U),R):y(U)}function N(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),c=U,D):Xe(U)?(e.consume(U),N):T(U)}function D(U){return U===c?(e.consume(U),c=null,j):U===null||Oe(U)?n(U):(e.consume(U),D)}function T(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||yt(U)?R(U):(e.consume(U),T)}function j(U){return U===47||U===62||Xe(U)?y(U):n(U)}function B(U){return U===62?(e.consume(U),F):n(U)}function F(U){return U===null||Oe(U)?Y(U):Xe(U)?(e.consume(U),F):n(U)}function Y(U){return U===45&&a===2?(e.consume(U),G):U===60&&a===1?(e.consume(U),X):U===62&&a===4?(e.consume(U),O):U===63&&a===3?(e.consume(U),M):U===93&&a===5?(e.consume(U),L):Oe(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(g5,$,H)(U)):U===null||Oe(U)?(e.exit("htmlFlowData"),H(U)):(e.consume(U),Y)}function H(U){return e.check(m5,z,$)(U)}function z(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),V}function V(U){return U===null||Oe(U)?H(U):(e.enter("htmlFlowData"),Y(U))}function G(U){return U===45?(e.consume(U),M):Y(U)}function X(U){return U===47?(e.consume(U),u="",K):Y(U)}function K(U){if(U===62){const Q=u.toLowerCase();return a1.includes(Q)?(e.consume(U),O):Y(U)}return sn(U)&&u.length<8?(e.consume(U),u+=String.fromCharCode(U),K):Y(U)}function L(U){return U===93?(e.consume(U),M):Y(U)}function M(U){return U===62?(e.consume(U),O):U===45&&a===2?(e.consume(U),M):Y(U)}function O(U){return U===null||Oe(U)?(e.exit("htmlFlowData"),$(U)):(e.consume(U),O)}function $(U){return e.exit("htmlFlow"),t(U)}}function y5(e,t,n){const r=this;return a;function a(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function b5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ll,t,n)}}const S5={name:"htmlText",tokenize:x5};function x5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),R):M===63?(e.consume(M),y):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,w):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),_):Oe(M)?(u=d,X(M)):(e.consume(M),d)}function _(M){return M===45?(e.consume(M),v):d(M)}function v(M){return M===62?G(M):M===45?_(M):d(M)}function w(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?C:w):n(M)}function C(M){return M===null?n(M):M===93?(e.consume(M),b):Oe(M)?(u=C,X(M)):(e.consume(M),C)}function b(M){return M===93?(e.consume(M),S):C(M)}function S(M){return M===62?G(M):M===93?(e.consume(M),S):C(M)}function x(M){return M===null||M===62?G(M):Oe(M)?(u=x,X(M)):(e.consume(M),x)}function y(M){return M===null?n(M):M===63?(e.consume(M),E):Oe(M)?(u=y,X(M)):(e.consume(M),y)}function E(M){return M===62?G(M):y(M)}function R(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||en(M)?(e.consume(M),N):D(M)}function D(M){return Oe(M)?(u=D,X(M)):Xe(M)?(e.consume(M),D):G(M)}function T(M){return M===45||en(M)?(e.consume(M),T):M===47||M===62||yt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),G):M===58||M===95||sn(M)?(e.consume(M),B):Oe(M)?(u=j,X(M)):Xe(M)?(e.consume(M),j):G(M)}function B(M){return M===45||M===46||M===58||M===95||en(M)?(e.consume(M),B):F(M)}function F(M){return M===61?(e.consume(M),Y):Oe(M)?(u=F,X(M)):Xe(M)?(e.consume(M),F):j(M)}function Y(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,H):Oe(M)?(u=Y,X(M)):Xe(M)?(e.consume(M),Y):(e.consume(M),z)}function H(M){return M===a?(e.consume(M),a=void 0,V):M===null?n(M):Oe(M)?(u=H,X(M)):(e.consume(M),H)}function z(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||yt(M)?j(M):(e.consume(M),z)}function V(M){return M===47||M===62||yt(M)?j(M):n(M)}function G(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Xe(M)?et(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const Rg={name:"labelEnd",resolveAll:k5,resolveTo:A5,tokenize:N5},w5={tokenize:T5},C5={tokenize:R5},E5={tokenize:D5};function k5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Tn(e,0,e.length,n),e}function A5(e,t){let n=e.length,r=0,a,l,u,o;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,t],["enter",f,t]],o=Gn(o,e.slice(l+1,l+r+3)),o=Gn(o,[["enter",p,t]]),o=Gn(o,Yu(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),o=Gn(o,[["exit",p,t],e[u-2],e[u-1],["exit",f,t]]),o=Gn(o,e.slice(u+1)),o=Gn(o,[["exit",c,t]]),Tn(e,l,e.length,o),e}function N5(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return o;function o(_){return l?l._inactive?d(_):(u=r.parser.defined.includes(Jn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),c):n(_)}function c(_){return _===40?e.attempt(w5,p,u?p:d)(_):_===91?e.attempt(C5,p,u?f:d)(_):u?p(_):d(_)}function f(_){return e.attempt(E5,p,d)(_)}function p(_){return t(_)}function d(_){return l._balanced=!0,n(_)}}function T5(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),a}function a(d){return yt(d)?Oo(e,l)(d):l(d)}function l(d){return d===41?p(d):Ax(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function u(d){return yt(d)?Oo(e,c)(d):p(d)}function o(d){return n(d)}function c(d){return d===34||d===39||d===40?Tx(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function f(d){return yt(d)?Oo(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function R5(e,t,n){const r=this;return a;function a(o){return Nx.call(r,e,l,u,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function u(o){return n(o)}}function D5(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const M5={name:"labelStartImage",resolveAll:Rg.resolveAll,tokenize:j5};function j5(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):n(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const L5={name:"labelStartLink",resolveAll:Rg.resolveAll,tokenize:O5};function O5(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Xd={name:"lineEnding",tokenize:B5};function B5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,t,"linePrefix")}}const uu={name:"thematicBreak",tokenize:I5};function I5(e,t,n){let r=0,a;return l;function l(f){return e.enter("thematicBreak"),u(f)}function u(f){return a=f,o(f)}function o(f){return f===a?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||Oe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Xe(f)?et(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:P5},exit:$5,name:"list",tokenize:F5},z5={partial:!0,tokenize:G5},H5={partial:!0,tokenize:U5};function F5(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Op(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(uu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return Op(v)&&++u<10?(e.consume(v),c):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(ll,r.interrupt?n:p,e.attempt(z5,_,d))}function p(v){return r.containerState.initialBlankLine=!0,l++,_(v)}function d(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),_):n(v)}function _(v){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function P5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ll,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(H5,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function U5(e,t,n){const r=this;return et(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function $5(e){e.exit(this.containerState.type)}function G5(e,t,n){const r=this;return et(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const o1={name:"setextUnderline",resolveTo:q5,tokenize:V5};function q5(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function V5(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Xe(f)?et(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Oe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Y5={tokenize:W5};function W5(e){const t=this,n=e.attempt(ll,r,e.attempt(this.parser.constructs.flowInitial,a,et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(J3,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const X5={resolveAll:Dx()},K5=Rx("string"),Z5=Rx("text");function Rx(e){return{resolveAll:Dx(e==="text"?Q5:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let _=-1;if(d)for(;++_<d.length;){const v=d[_];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Dx(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function Q5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,o=0,c;for(;l--;){const f=a[l];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(f===-2)c=!0,o++;else if(f!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const f={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const J5={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:wx},e4={91:r5},t4={[-2]:Wd,[-1]:Wd,32:Wd},n4={35:u5,42:uu,45:[o1,uu],60:p5,61:o1,95:uu,96:s1,126:s1},i4={38:Ex,92:Cx},r4={[-5]:Xd,[-4]:Xd,[-3]:Xd,33:M5,38:Ex,42:Bp,60:[L3,S5],91:L5,92:[l5,Cx],93:Rg,95:Bp,96:Y3},s4={null:[Bp,X5]},a4={null:[42,95]},o4={null:[]},l4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:a4,contentInitial:e4,disable:o4,document:J5,flow:n4,flowInitial:t4,insideSpan:s4,string:i4,text:r4},Symbol.toStringTag,{value:"Module"}));function c4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],o=[];const c={attempt:D(R),check:D(N),consume:x,enter:y,exit:E,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:v,write:d};let p=t.tokenize.call(f,c);return t.resolveAll&&l.push(t),f;function d(F){return u=Gn(u,F),b(),u[u.length-1]!==null?[]:(T(t,0),f.events=Yu(l,f.events,f),f.events)}function _(F,Y){return h4(v(F),Y)}function v(F){return u4(u,F)}function w(){const{_bufferIndex:F,_index:Y,line:H,column:z,offset:V}=r;return{_bufferIndex:F,_index:Y,line:H,column:z,offset:V}}function C(F){a[F.line]=F.column,B()}function b(){let F;for(;r._index<u.length;){const Y=u[r._index];if(typeof Y=="string")for(F=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===F&&r._bufferIndex<Y.length;)S(Y.charCodeAt(r._bufferIndex));else S(Y)}}function S(F){p=p(F)}function x(F){Oe(F)?(r.line++,r.column=1,r.offset+=F===-3?2:1,B()):F!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=F}function y(F,Y){const H=Y||{};return H.type=F,H.start=w(),f.events.push(["enter",H,f]),o.push(H),H}function E(F){const Y=o.pop();return Y.end=w(),f.events.push(["exit",Y,f]),Y}function R(F,Y){T(F,Y.from)}function N(F,Y){Y.restore()}function D(F,Y){return H;function H(z,V,G){let X,K,L,M;return Array.isArray(z)?$(z):"tokenize"in z?$([z]):O(z);function O(ae){return Z;function Z(P){const ee=P!==null&&ae[P],ne=P!==null&&ae.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return $(ge)(P)}}function $(ae){return X=ae,K=0,ae.length===0?G:U(ae[K])}function U(ae){return Z;function Z(P){return M=j(),L=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(Y?Object.assign(Object.create(f),Y):f,c,Q,re)(P)}}function Q(ae){return F(L,M),V}function re(ae){return M.restore(),++K<X.length?U(X[K]):G}}}function T(F,Y){F.resolveAll&&!l.includes(F)&&l.push(F),F.resolve&&Tn(f.events,Y,f.events.length-Y,F.resolve(f.events.slice(Y),f)),F.resolveTo&&(f.events=F.resolveTo(f.events,f))}function j(){const F=w(),Y=f.previous,H=f.currentConstruct,z=f.events.length,V=Array.from(o);return{from:z,restore:G};function G(){r=F,f.previous=Y,f.currentConstruct=H,f.events.length=z,o=V,B()}}function B(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function u4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function h4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=` +`;break}case-3:{u=`\r +`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function f4(e){const r={constructs:Sx([l4,...(e||{}).extensions||[]]),content:a(A3),defined:[],document:a(T3),flow:a(Y5),lazy:{},string:a(K5),text:a(Z5)};return r;function a(l){return u;function u(o){return c4(r,l,o)}}}function d4(e){for(;!kx(e););return e}const l1=/[\0\t\n\r]/g;function p4(){let e=1,t="",n=!0,r;return a;function a(l,u,o){const c=[];let f,p,d,_,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),d=0,t="",n&&(l.charCodeAt(0)===65279&&d++,n=void 0);d<l.length;){if(l1.lastIndex=d,f=l1.exec(l),_=f&&f.index!==void 0?f.index:l.length,v=l.charCodeAt(_),!f){t=l.slice(d);break}if(v===10&&d===_&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<_&&(c.push(l.slice(d,_)),e+=_-d),v){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=_+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const g4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m4(e){return e.replace(g4,_4)}function _4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return xx(n.slice(l?2:1),l?16:10)}return $o(n)||e}const Mx={}.hasOwnProperty;function v4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),y4(n)(d4(f4(n).document().write(p4()(e,t,!0))))}function y4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(bt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(ke),blockQuote:l(ne),characterEscape:j,characterReference:j,codeFenced:l(ge),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(ge,u),codeText:l(he,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(ye),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(be),hardBreakEscape:l(Ee),hardBreakTrailing:l(Ee),htmlFlow:l(Ce,u),htmlFlowData:j,htmlText:l(Ce,u),htmlTextData:j,image:l(rt),label:u,link:l(bt),listItem:l(ct),listItemValue:_,listOrdered:l(Ge,d),listUnordered:l(Ge),paragraph:l(Pt),reference:U,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ke),strong:l(ht),thematicBreak:l(fe)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:ee,autolinkProtocol:P,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:Z,codeFenced:c(b),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:c(S),codeText:c(V),codeTextData:B,data:B,definition:c(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(Y),hardBreakTrailing:c(Y),htmlFlow:c(H),htmlFlowData:B,htmlText:c(z),htmlTextData:B,image:c(X),label:L,labelText:K,lineEnding:F,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:M,resourceTitleString:O,resource:$,setextHeading:c(T),setextHeadingLineSequence:D,setextHeadingText:N,strong:c(),thematicBreak:c()}};jx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let de={type:"root",children:[]};const Se={stack:[de],tokenStack:[],config:t,enter:o,exit:f,buffer:u,resume:p,data:n},Ae=[];let De=-1;for(;++De<ie.length;)if(ie[De][1].type==="listOrdered"||ie[De][1].type==="listUnordered")if(ie[De][0]==="enter")Ae.push(De);else{const Ve=Ae.pop();De=a(ie,Ve,De)}for(De=-1;++De<ie.length;){const Ve=t[ie[De][0]];Mx.call(Ve,ie[De][1].type)&&Ve[ie[De][1].type].call(Object.assign({sliceSerialize:ie[De][2].sliceSerialize},Se),ie[De][1])}if(Se.tokenStack.length>0){const Ve=Se.tokenStack[Se.tokenStack.length-1];(Ve[1]||c1).call(Se,void 0,Ve[0])}for(de.position={start:xr(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:xr(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De<t.transforms.length;)de=t.transforms[De](de)||de;return de}function a(ie,de,Se){let Ae=de-1,De=-1,Ve=!1,Ie,Nt,Et,qt;for(;++Ae<=Se;){const st=ie[Ae];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?De++:De--,qt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Ie&&!qt&&!De&&!Et&&(Et=Ae),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!De&&st[0]==="enter"&&st[1].type==="listItemPrefix"||De===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Ie){let Ln=Ae;for(Nt=void 0;Ln--;){const Ut=ie[Ln];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Nt&&(ie[Nt][1].type="lineEndingBlank",Ve=!0),Ut[1].type="lineEnding",Nt=Ln}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}Et&&(!Nt||Et<Nt)&&(Ie._spread=!0),Ie.end=Object.assign({},Nt?ie[Nt][1].start:st[1].end),ie.splice(Nt||Ae,0,["exit",Ie,st[2]]),Ae++,Se++}if(st[1].type==="listItemPrefix"){const Ln={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Ie=Ln,ie.splice(Ae,0,["enter",Ln,st[2]]),Ae++,Se++,Et=void 0,qt=!0}}}return ie[de][1]._spread=Ve,Se}function l(ie,de){return Se;function Se(Ae){o.call(this,ie(Ae),Ae),de&&de.call(this,Ae)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(ie,de,Se){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([de,Se||void 0]),ie.position={start:xr(de.start),end:void 0}}function c(ie){return de;function de(Se){ie&&ie.call(this,Se),f.call(this,Se)}}function f(ie,de){const Se=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ie.type&&(de?de.call(this,ie,Ae[0]):(Ae[1]||c1).call(this,ie,Ae[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Lo({start:ie.start,end:ie.end})+"): it’s not open");Se.position.end=xr(ie.end)}function p(){return Tg(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function _(ie){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.lang=ie}function w(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/(\r?\n|\r)$/g,"")}function x(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase()}function y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function E(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function R(ie){const de=this.stack[this.stack.length-1];if(!de.depth){const Se=this.sliceSerialize(ie).length;de.depth=Se}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ie){const Se=this.stack[this.stack.length-1].children;let Ae=Se[Se.length-1];(!Ae||Ae.type!=="text")&&(Ae=Fe(),Ae.position={start:xr(ie.start),end:void 0},Se.push(Ae)),this.stack.push(Ae)}function B(ie){const de=this.stack.pop();de.value+=this.sliceSerialize(ie),de.position.end=xr(ie.end)}function F(ie){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=de.children[de.children.length-1];Se.position.end=xr(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(j.call(this,ie),B.call(this,ie))}function Y(){this.data.atHardBreak=!0}function H(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function z(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function V(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function G(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const de=this.sliceSerialize(ie),Se=this.stack[this.stack.length-2];Se.label=m4(de),Se.identifier=Jn(de).toLowerCase()}function L(){const ie=this.stack[this.stack.length-1],de=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ae=ie.children;Se.children=Ae}else Se.alt=de}function M(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function O(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function $(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function Q(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function re(ie){this.data.characterReferenceType=ie.type}function ae(ie){const de=this.sliceSerialize(ie),Se=this.data.characterReferenceType;let Ae;Se?(Ae=xx(de,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=$o(de);const De=this.stack[this.stack.length-1];De.value+=Ae}function Z(ie){const de=this.stack.pop();de.position.end=xr(ie.end)}function P(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ie)}function ee(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ie)}function ne(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ct(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function ht(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function jx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jx(e,r):b4(e,r)}}function b4(e,t){let n;for(n in t)if(Mx.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function c1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is still open")}function S4(e){const t=this;t.parser=n;function n(r){return v4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function x4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function w4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`}]}function C4(e,t){const n=t.value?t.value+` +`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function E4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wa(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function N4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lx(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function R4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lx(e,t);const a={src:wa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function D4(e,t){const n={src:wa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function M4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function j4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lx(e,t);const a={href:wa(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function L4(e,t){const n={href:wa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function O4(e,t,n){const r=e.all(t),a=n?B4(n):Ox(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(a||o!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:` +`}),p.type==="element"&&p.tagName==="p"&&!a?u.push(...p.children):u.push(p)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&u.push({type:"text",value:` +`});const f={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,f),e.applyData(t,f)}function B4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ox(n[r])}return t}function Ox(e){const t=e.spread;return t??e.children.length>1}function I4(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function z4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function F4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P4(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Eg(t.children[1]),c=px(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function U4(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c<o;){const d=t.children[c],_={},v=u?u[c]:void 0;v&&(_.align=v);let w={type:"element",tagName:l,properties:_,children:[]};d&&(w.children=e.all(d),e.patch(d,w),w=e.applyData(d,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function $4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const u1=9,h1=32;function G4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(f1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(f1(t.slice(a),a>0,!1)),l.join("")}function f1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===u1||l===h1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===u1||l===h1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function q4(e,t){const n={type:"text",value:G4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function V4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Y4={blockquote:x4,break:w4,code:C4,delete:E4,emphasis:k4,footnoteReference:A4,heading:N4,html:T4,imageReference:R4,image:D4,inlineCode:M4,linkReference:j4,link:L4,listItem:O4,list:I4,paragraph:z4,root:H4,strong:F4,table:P4,tableCell:$4,tableRow:U4,text:q4,thematicBreak:V4,toml:Hc,yaml:Hc,definition:Hc,footnoteDefinition:Hc};function Hc(){}const Bx=-1,Wu=0,Bo=1,Cu=2,Dg=3,Mg=4,jg=5,Lg=6,Ix=7,zx=8,Hx=typeof self=="object"?self:globalThis,d1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Hx[e](t)},W4=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case Wu:case Bx:return n(u,a);case Bo:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Cu:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case Dg:return n(new Date(u),a);case Mg:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case jg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case Lg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Ix:{const{name:o,message:c}=u;return n(typeof Hx[o]=="function"?d1(o,c):new Error(c),a)}case zx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(d1(l,u),a)};return r},p1=e=>W4(new Map,e)(0),Xr="",{toString:X4}={},{keys:K4}=Object,Ao=e=>{const t=typeof e;if(t!=="object"||!e)return[Wu,t];const n=X4.call(e).slice(8,-1);switch(n){case"Array":return[Bo,Xr];case"Object":return[Cu,Xr];case"Date":return[Dg,Xr];case"RegExp":return[Mg,Xr];case"Map":return[jg,Xr];case"Set":return[Lg,Xr];case"DataView":return[Bo,n]}return n.includes("Array")?[Bo,n]:e instanceof Error?[Ix,e.name||"Error"]:[Cu,n]},Fc=([e,t])=>e===Wu&&(t==="function"||t==="symbol"),Z4=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=Ao(u);switch(o){case Wu:{let p=u;switch(c){case"bigint":o=zx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Bx],u)}return a([o,p],u)}case Bo:{if(c){let _=u;return c==="DataView"?_=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(_=new Uint8Array(u)),a([c,[..._]],u)}const p=[],d=a([o,p],u);for(const _ of u)p.push(l(_));return d}case Cu:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const _ of K4(u))(e||!Fc(Ao(u[_])))&&p.push([l(_),l(u[_])]);return d}case Dg:return a([o,isNaN(u.getTime())?Xr:u.toISOString()],u);case Mg:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case jg:{const p=[],d=a([o,p],u);for(const[_,v]of u)(e||!(Fc(Ao(_))||Fc(Ao(v))))&&p.push([l(_),l(v)]);return d}case Lg:{const p=[],d=a([o,p],u);for(const _ of u)(e||!Fc(Ao(_)))&&p.push(l(_));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},g1=(e,{json:t,lossy:n}={})=>{const r=[];return Z4(!(t||n),!!t,new Map,r)(e),r},Eu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?p1(g1(e,t)):structuredClone(e):(e,t)=>p1(g1(e,t));function Q4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function J4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Q4,r=e.options.footnoteBackLabel||J4,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const p=e.all(f),d=String(f.identifier).toUpperCase(),_=wa(d.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(d);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,v);typeof x=="string"&&(x={type:"text",value:x}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(f,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Eu(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` +`}]}}const Xu=(function(e){if(e==null)return rR;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?tR(e):nR(e);if(typeof e=="string")return iR(e);throw new Error("Expected function, string, or object as test")});function tR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Ku(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function nR(e){const t=e;return Ku(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function iR(e){return Ku(t);function t(n){return n&&n.type===e}}function Ku(e){return t;function t(n,r,a){return!!(sR(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function rR(){return!0}function sR(e){return e!==null&&typeof e=="object"&&"type"in e}const Fx=[],aR=!0,Ip=!1,oR="skip";function Px(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=Xu(a),u=r?-1:1;o(e,void 0,[])();function o(c,f,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=Fx,w,C,b;if((!t||l(c,f,p[p.length-1]||void 0))&&(v=lR(n(c,p)),v[0]===Ip))return v;if("children"in c&&c.children){const S=c;if(S.children&&v[0]!==oR)for(C=(r?S.children.length:-1)+u,b=p.concat(S);C>-1&&C<S.children.length;){const x=S.children[C];if(w=o(x,C,b)(),w[0]===Ip)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function lR(e){return Array.isArray(e)?e:typeof e=="number"?[aR,e]:e==null?Fx:[e]}function Og(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),Px(e,l,o,a);function o(c,f){const p=f[f.length-1],d=p?p.children.indexOf(c):void 0;return u(c,d,p)}}const zp={}.hasOwnProperty,cR={};function uR(e,t){const n=t||cR,r=new Map,a=new Map,l=new Map,u={...Y4,...n.handlers},o={all:f,applyData:fR,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:c,options:n,patch:hR,wrap:pR};return Og(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:a,_=String(p.identifier).toUpperCase();d.has(_)||d.set(_,p)}}),o;function c(p,d){const _=p.type,v=o.handlers[_];if(zp.call(o.handlers,_)&&v)return v(o,p,d);if(o.options.passThrough&&o.options.passThrough.includes(_)){if("children"in p){const{children:C,...b}=p,S=Eu(b);return S.children=o.all(p),S}return Eu(p)}return(o.options.unknownHandler||dR)(o,p,d)}function f(p){const d=[];if("children"in p){const _=p.children;let v=-1;for(;++v<_.length;){const w=o.one(_[v],p);if(w){if(v&&_[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=m1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=m1(C.value))}Array.isArray(w)?d.push(...w):d.push(w)}}}return d}}function hR(e,t){e.position&&(t.position=JT(e))}function fR(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,Eu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function dR(e,t){const n=t.data||{},r="value"in t&&!(zp.call(n,"hProperties")||zp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pR(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:` +`});++r<e.length;)r&&n.push({type:"text",value:` +`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:` +`}),n}function m1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _1(e,t){const n=uR(e,t),r=n.one(e,void 0),a=eR(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` +`},a),l}function gR(e,t){return e&&"run"in e?async function(n,r){const a=_1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return _1(n,{file:r,...e||t})}}function v1(e){if(e)throw e}var Kd,y1;function mR(){if(y1)return Kd;y1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var _;for(_ in f);return typeof _>"u"||e.call(f,_)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Kd=function c(){var f,p,d,_,v,w,C=arguments[0],b=1,S=arguments.length,x=!1;for(typeof C=="boolean"&&(x=C,C=arguments[1]||{},b=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});b<S;++b)if(f=arguments[b],f!=null)for(p in f)d=o(C,p),_=o(f,p),C!==_&&(x&&_&&(l(_)||(v=a(_)))?(v?(v=!1,w=d&&a(d)?d:[]):w=d&&l(d)?d:{},u(C,{name:p,newValue:c(x,w,_)})):typeof _<"u"&&u(C,{name:p,newValue:_}));return C},Kd}var _R=mR();const Zd=Pu(_R);function Hp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vR(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...a);function o(c,...f){const p=e[++l];let d=-1;if(c){u(c);return}for(;++d<a.length;)(f[d]===null||f[d]===void 0)&&(f[d]=a[d]);a=f,p?yR(p,o)(...f):u(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function yR(e,t){let n;return r;function r(...u){const o=e.length>u.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const li={basename:bR,dirname:SR,extname:xR,join:wR,sep:"/"};function bR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function SR(e){if(cl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function xR(e){cl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function wR(...e){let t=-1,n;for(;++t<e.length;)cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":CR(n)}function CR(e){cl(e);const t=e.codePointAt(0)===47;let n=ER(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ER(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kR={cwd:AR};function AR(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NR(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return TR(e)}function TR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Qd=["history","path","basename","stem","extname","dirname"];class Ux{constructor(t){let n;t?Fp(t)?n={path:t}:typeof t=="string"||RR(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qd.length;){const l=Qd[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Qd.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){ep(t,"basename"),Jd(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){b1(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(Jd(t,"extname"),b1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fp(t)&&(t=NR(t)),ep(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){ep(t,"stem"),Jd(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new tn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Jd(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function ep(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function b1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function RR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DR=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),MR={}.hasOwnProperty;class Bg extends DR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vR()}copy(){const t=new Bg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ip("data",this.frozen),this.namespace[t]=n,this):MR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ip("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pc(t),r=this.parser||this.Parser;return tp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tp("process",this.parser||this.Parser),np("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const o=Pc(t),c=r.parse(o);r.run(c,o,function(p,d,_){if(p||!d||!_)return f(p);const v=d,w=r.stringify(v,_);OR(w)?_.value=w:_.result=w,f(p,_)});function f(p,d){p||!d?u(p):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),tp("processSync",this.parser||this.Parser),np("processSync",this.compiler||this.Compiler),this.process(t,a),x1("processSync","process",n),r;function a(l,u){n=!0,v1(l),r=u}}run(t,n,r){S1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,o){const c=Pc(n);a.run(t,c,f);function f(p,d,_){const v=d||t;p?o(p):u?u(v):r(void 0,v,_)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),x1("runSync","run",r),a;function l(u,o){v1(u),a=o,r=!0}}stringify(t,n){this.freeze();const r=Pc(n),a=this.compiler||this.Compiler;return np("stringify",a),S1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(ip("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...d]=f;c(p,d)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(f.plugins),f.settings&&(a.settings=Zd(!0,a.settings,f.settings))}function o(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const d=f[p];l(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,p){let d=-1,_=-1;for(;++d<r.length;)if(r[d][0]===f){_=d;break}if(_===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const C=r[_][1];Hp(C)&&Hp(v)&&(v=Zd(!0,C,v)),r[_]=[f,v,...w]}}}}const jR=new Bg().freeze();function tp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function np(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ip(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!Hp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pc(e){return LR(e)?e:new Ux(e)}function LR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function OR(e){return typeof e=="string"||BR(e)}function BR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const IR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],C1={allowDangerousHtml:!0},zR=/^(https?|ircs?|mailto|xmpp)$/i,HR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $x(e){const t=FR(e),n=PR(e);return UR(t.runSync(t.parse(n),n),e)}function FR(e){const t=e.rehypePlugins||w1,n=e.remarkPlugins||w1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return jR().use(S4).use(n).use(gR,r).use(t)}function PR(e){const t=e.children||"",n=new Ux;return typeof t=="string"&&(n.value=t),n}function UR(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||$R;for(const p of HR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+IR+p.id,void 0);return Og(e,f),r3(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,d,_){if(p.type==="raw"&&_&&typeof d=="number")return u?_.children.splice(d,1):_.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let v;for(v in Yd)if(Object.hasOwn(Yd,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=Yd[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=c(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(p,d,_)),v&&_&&typeof d=="number")return o&&p.children?_.children.splice(d,1,...p.children):_.children.splice(d,1),d}}}function $R(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||zR.test(e.slice(0,t))?e:""}function E1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function GR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qR(e,t,n){const a=Xu((n||{}).ignore||[]),l=VR(t);let u=-1;for(;++u<l.length;)Px(e,"text",o);function o(f,p){let d=-1,_;for(;++d<p.length;){const v=p[d],w=_?_.children:void 0;if(a(v,w?w.indexOf(v):void 0,_))return;_=v}if(_)return c(f,p)}function c(f,p){const d=p[p.length-1],_=l[u][0],v=l[u][1];let w=0;const b=d.children.indexOf(f);let S=!1,x=[];_.lastIndex=0;let y=_.exec(f.value);for(;y;){const E=y.index,R={index:y.index,input:y.input,stack:[...p,f]};let N=v(...y,R);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?_.lastIndex=E+1:(w!==E&&x.push({type:"text",value:f.value.slice(w,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),w=E+y[0].length,S=!0),!_.global)break;y=_.exec(f.value)}return S?(w<f.value.length&&x.push({type:"text",value:f.value.slice(w)}),d.children.splice(b,1,...x)):x=[f],b+x.length}}function VR(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([YR(a[0]),WR(a[1])])}return t}function YR(e){return typeof e=="string"?new RegExp(GR(e),"g"):e}function WR(e){return typeof e=="function"?e:function(){return e}}const rp="phrasing",sp=["autolink","link","image","label"];function XR(){return{transforms:[nD],enter:{literalAutolink:ZR,literalAutolinkEmail:ap,literalAutolinkHttp:ap,literalAutolinkWww:ap},exit:{literalAutolink:tD,literalAutolinkEmail:eD,literalAutolinkHttp:QR,literalAutolinkWww:JR}}}function KR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:sp}]}}function ZR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ap(e){this.config.enter.autolinkProtocol.call(this,e)}function QR(e){this.config.exit.autolinkProtocol.call(this,e)}function JR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function eD(e){this.config.exit.autolinkEmail.call(this,e)}function tD(e){this.exit(e)}function nD(e){qR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,iD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),rD]],{ignore:["link","linkReference"]})}function iD(e,t,n,r,a){let l="";if(!Gx(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!sD(n)))return!1;const u=aD(n+r);if(!u[0])return!1;const o={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function rD(e,t,n,r){return!Gx(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function sD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function aD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=E1(e,"(");let l=E1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Gx(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||Vu(n))&&(!t||n!==47)}qx.peek=gD;function oD(){this.buffer()}function lD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cD(){this.buffer()}function uD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fD(e){this.exit(e)}function dD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pD(e){this.exit(e)}function gD(){return"["}function qx(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function mD(){return{enter:{gfmFootnoteCallString:oD,gfmFootnoteCall:lD,gfmFootnoteDefinitionLabelString:cD,gfmFootnoteDefinition:uD},exit:{gfmFootnoteCallString:hD,gfmFootnoteCall:fD,gfmFootnoteDefinitionLabelString:dD,gfmFootnoteDefinition:pD}}}function _D(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` +`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Vx:vD))),f(),c}}function vD(e,t,n){return t===0?e:Vx(e,t,n)}function Vx(e,t,n){return(n?"":" ")+e}const yD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yx.peek=CD;function bD(){return{canContainEols:["delete"],enter:{strikethrough:xD},exit:{strikethrough:wD}}}function SD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yD}],handlers:{delete:Yx}}}function xD(e){this.enter({type:"delete",children:[]},e)}function wD(e){this.exit(e)}function Yx(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function CD(){return"~"}function ED(e){return e.length}function kD(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||ED,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++p<e.length;){const C=[],b=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const x=AD(e[p][S]);if(n.alignDelimiters!==!1){const y=a(x);b[S]=y,(c[S]===void 0||y>c[S])&&(c[S]=y)}C.push(x)}u[p]=C,o[p]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)l[d]=k1(r[d]);else{const C=k1(r);for(;++d<f;)l[d]=C}d=-1;const _=[],v=[];for(;++d<f;){const C=l[d];let b="",S="";C===99?(b=":",S=":"):C===108?b=":":C===114&&(S=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-b.length-S.length);const y=b+"-".repeat(x)+S;n.alignDelimiters!==!1&&(x=b.length+x+S.length,x>c[d]&&(c[d]=x),v[d]=x),_[d]=y}u.splice(1,0,_),o.splice(1,0,v),p=-1;const w=[];for(;++p<u.length;){const C=u[p],b=o[p];d=-1;const S=[];for(;++d<f;){const x=C[d]||"";let y="",E="";if(n.alignDelimiters!==!1){const R=c[d]-(b[d]||0),N=l[d];N===114?y=" ".repeat(R):N===99?R%2?(y=" ".repeat(R/2+.5),E=" ".repeat(R/2-.5)):(y=" ".repeat(R/2),E=y):E=" ".repeat(R)}n.delimiterStart!==!1&&!d&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&S.push(" "),n.alignDelimiters!==!1&&S.push(y),S.push(x),n.alignDelimiters!==!1&&S.push(E),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(` +`)}function AD(e){return e==null?"":String(e)}function k1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ND(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),TD);return a(),u}function TD(e,t,n){return">"+(n?"":" ")+e}function RD(e,t){return A1(e,t.inConstruct,!0)&&!A1(e,t.notInConstruct,!1)}function A1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function N1(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===` +`&&RD(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\ +`}function DD(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function MD(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function jD(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function LD(e,t,n,r){const a=jD(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(MD(e,n)){const d=n.enter("codeIndented"),_=n.indentLines(l,OD);return d(),_}const o=n.createTracker(r),c=a.repeat(Math.max(DD(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` +`,encode:["`"],...o.current()})),d()}return p+=o.move(` +`),l&&(p+=o.move(l+` +`)),p+=o.move(c),f(),p}function OD(e,t,n){return(n?"":" ")+e}function Ig(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function BD(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function ID(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ku(e,t,n){const r=fa(e),a=fa(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wx.peek=zD;function Wx(e,t,n,r){const a=ID(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function zD(e,t,n){return n.options.emphasis||"*"}function HD(e,t){let n=!1;return Og(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&Tg(e)&&(t.options.setext||n))}function FD(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(HD(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:` +`,after:` +`});return d(),p(),_+` +`+(a===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(` +`))+1))}const u="#".repeat(a),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(u+" ");let f=n.containerPhrasing(e,{before:"# ",after:` +`,...l.current()});return/^[\t ]/.test(f)&&(f=Go(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}Xx.peek=PD;function Xx(e){return e.value||""}function PD(){return"<"}Kx.peek=UD;function Kx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function UD(){return"!"}Zx.peek=$D;function Zx(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $D(){return"!"}Qx.peek=GD;function Qx(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],o=n.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return a+r+a}function GD(){return"`"}function Jx(e,t){const n=Tg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ew.peek=qD;function ew(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(Jx(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function qD(e,t,n){return Jx(e,n)?"<":"["}tw.peek=VD;function tw(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function VD(){return"["}function zg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YD(e){const t=zg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function WD(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function nw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XD(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?WD(n):zg(n);const o=e.ordered?u==="."?")":".":YD(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),nw(n)===u&&p){let d=-1;for(;++d<e.children.length;){const _=e.children[d];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),f}function KD(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function ZD(e,t,n,r){const a=KD(n);let l=n.bulletCurrent||zg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,_,v){return _?(v?"":" ".repeat(u))+d:(v?l:l+" ".repeat(u-l.length))+d}}function QD(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const JD=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function eM(e,t,n,r){return(e.children.some(function(u){return JD(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function tM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iw.peek=nM;function iw(e,t,n,r){const a=tM(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function nM(e,t,n){return n.options.strong||"*"}function iM(e,t,n,r){return n.safe(e.value,r)}function rM(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sM(e,t,n){const r=(nw(n)+(n.options.ruleSpaces?" ":"")).repeat(rM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const rw={blockquote:ND,break:N1,code:LD,definition:BD,emphasis:Wx,hardBreak:N1,heading:FD,html:Xx,image:Kx,imageReference:Zx,inlineCode:Qx,link:ew,linkReference:tw,list:XD,listItem:ZD,paragraph:QD,root:eM,strong:iw,text:iM,thematicBreak:sM};function aM(){return{enter:{table:oM,tableData:T1,tableHeader:T1,tableRow:cM},exit:{codeText:uM,table:lM,tableData:op,tableHeader:op,tableRow:op}}}function oM(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function lM(e){this.exit(e),this.data.inTable=void 0}function cM(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function T1(e){this.enter({type:"tableCell",children:[]},e)}function uM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function hM(e,t){return t==="|"?t:e}function fM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:u,tableCell:c,tableRow:o}};function u(v,w,C,b){return f(p(v,C,b),v.align)}function o(v,w,C,b){const S=d(v,C,b),x=f([S]);return x.slice(0,x.indexOf(` +`))}function c(v,w,C,b){const S=C.enter("tableCell"),x=C.enter("phrasing"),y=C.containerPhrasing(v,{...b,before:l,after:l});return x(),S(),y}function f(v,w){return kD(v,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function p(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("table");for(;++S<b.length;)x[S]=d(b[S],w,C);return y(),x}function d(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("tableRow");for(;++S<b.length;)x[S]=c(b[S],v,w,C);return y(),x}function _(v,w,C){let b=rw.inlineCode(v,w,C);return C.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function dM(){return{exit:{taskListCheckValueChecked:R1,taskListCheckValueUnchecked:R1,paragraph:gM}}}function pM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mM}}}function R1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function gM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const o=a[l];if(o.type==="paragraph"){u=o;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function mM(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(u);let c=rw.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(p){return p+u}}function _M(){return[XR(),mD(),bD(),aM(),dM()]}function vM(e){return{extensions:[KR(),_D(e),SD(),fM(e),pM()]}}const yM={tokenize:EM,partial:!0},sw={tokenize:kM,partial:!0},aw={tokenize:AM,partial:!0},ow={tokenize:NM,partial:!0},bM={tokenize:TM,partial:!0},lw={name:"wwwAutolink",tokenize:wM,previous:uw},cw={name:"protocolAutolink",tokenize:CM,previous:hw},qi={name:"emailAutolink",tokenize:xM,previous:fw},fi={};function SM(){return{text:fi}}let Wr=48;for(;Wr<123;)fi[Wr]=qi,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);fi[43]=qi;fi[45]=qi;fi[46]=qi;fi[95]=qi;fi[72]=[qi,cw];fi[104]=[qi,cw];fi[87]=[qi,lw];fi[119]=[qi,lw];function xM(e,t,n){const r=this;let a,l;return u;function u(d){return!Pp(d)||!fw.call(r,r.previous)||Hg(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Pp(d)?(e.consume(d),o):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(bM,p,f)(d):d===45||d===95||en(d)?(l=!0,e.consume(d),c):p(d)}function f(d){return e.consume(d),a=!0,c}function p(d){return l&&a&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function wM(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!uw.call(r,r.previous)||Hg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yM,e.attempt(sw,e.attempt(aw,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function CM(e,t,n){const r=this;let a="",l=!1;return u;function u(d){return(d===72||d===104)&&hw.call(r,r.previous)&&!Hg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(sn(d)&&a.length<5)return a+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const _=a.toLowerCase();if(_==="http"||_==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),l?f:(l=!0,c)):n(d)}function f(d){return d===null||wu(d)||yt(d)||is(d)||Vu(d)?n(d):e.attempt(sw,e.attempt(aw,p),n)(d)}function p(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function EM(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function kM(e,t,n){let r,a,l;return u;function u(f){return f===46||f===95?e.check(ow,c,o)(f):f===null||yt(f)||is(f)||f!==45&&Vu(f)?c(f):(l=!0,e.consume(f),u)}function o(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),u}function c(f){return a||r||!l?n(f):t(f)}}function AM(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(ow,t,l)(u):u===null||yt(u)||is(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function NM(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),a):o===60||o===null||yt(o)||is(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||yt(o)||is(o)?t(o):r(o)}function l(o){return sn(o)?u(o):n(o)}function u(o){return o===59?(e.consume(o),r):sn(o)?(e.consume(o),u):n(o)}}function TM(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return en(l)?n(l):t(l)}}function uw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function hw(e){return!sn(e)}function fw(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||en(e)}function Hg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const RM={tokenize:zM,partial:!0};function DM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OM,continuation:{tokenize:BM},exit:IM}},text:{91:{name:"gfmFootnoteCall",tokenize:LM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:MM,resolveTo:jM}}}}function MM(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function jM(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function LM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||yt(d))return n(d);if(d===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return yt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function OM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(u>999||w===93&&!o||w===null||w===91||yt(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(w)||(o=!0),u++,e.consume(w),w===92?d:p}function d(w){return w===91||w===92||w===93?(e.consume(w),u++,p):p(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(l)||a.push(l),et(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function BM(e,t,n){return e.check(ll,t,e.attempt(RM,t,n))}function IM(e){e.exit("gfmFootnoteDefinition")}function zM(e,t,n){const r=this;return et(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function HM(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let f=c;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[c][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[c][1].end)},d={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[c][1].start)},_=[["enter",p,o],["enter",u[f][1],o],["exit",u[f][1],o],["enter",d,o]],v=o.parser.constructs.insideSpan.null;v&&Tn(_,_.length,0,Yu(v,u.slice(f+1,c),o)),Tn(_,_.length,0,[["exit",d,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",p,o]]),Tn(u,f-1,c-f+3,_),c=f+_.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function l(u,o,c){const f=this.previous,p=this.events;let d=0;return _;function _(w){return f===126&&p[p.length-1][1].type!=="characterEscape"?c(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const C=fa(f);if(w===126)return d>1?c(w):(u.consume(w),d++,v);if(d<2&&!n)return c(w);const b=u.exit("strikethroughSequenceTemporary"),S=fa(w);return b._open=!S||S===2&&!!C,b._close=!C||C===2&&!!S,o(w)}}}class FM{constructor(){this.map=[]}add(t,n,r){PM(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function PM(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function UM(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function $M(){return{flow:{null:{name:"table",tokenize:GM,resolveAll:qM}}}}function GM(e,t,n){const r=this;let a=0,l=0,u;return o;function o(B){let F=r.events.length-1;for(;F>-1;){const z=r.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}const Y=F>-1?r.events[F][1].type:null,H=Y==="tableHead"||Y==="tableRow"?N:c;return H===N&&r.parser.lazy[r.now().line]?n(B):H(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Oe(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):n(B):Xe(B)?et(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||yt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?_:d)}function _(B){return B===92||B===124?(e.consume(B),d):d(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Xe(B)?et(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?b(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),C):R(B)}function C(B){return Xe(B)?et(e,b,"whitespace")(B):b(B)}function b(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(l+=1,S(B)):B===null||Oe(B)?E(B):R(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):R(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(B))}function y(B){return Xe(B)?et(e,E,"whitespace")(B):E(B)}function E(B){return B===124?w(B):B===null||Oe(B)?!u||a!==l?R(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):R(B)}function R(B){return n(B)}function N(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||Oe(B)?(e.exit("tableRow"),t(B)):Xe(B)?et(e,D,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||yt(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function qM(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const _=new FM;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(o=!1,c!==0&&(D1(_,t,c,f,p),p=void 0,c=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],u=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",p,t]])),a=w.type==="tableDelimiterRow"?2:p?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(o=!0,c=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(c=n,l[1]!==0?(u[0]=u[1],d=Uc(_,t,l,a,n,d)):u[1]!==0&&(d=Uc(_,t,u,a,n,d)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(c!==0&&D1(_,t,c,f,p),_.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=UM(t.events,n))}return e}function Uc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},na(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=na(t.events,n[1]);if(l={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const f=na(t.events,n[2]),p=na(t.events,n[3]),d={type:o,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const _=t.events[n[2]],v=t.events[n[3]];if(_[1].end=Object.assign({},v[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},na(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function D1(e,t,n,r,a){const l=[],u=na(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function na(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const VM={name:"tasklistCheck",tokenize:WM};function YM(){return{text:{91:VM}}}function WM(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return yt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Oe(c)?t(c):Xe(c)?e.check({tokenize:XM},t,n)(c):n(c)}}function XM(e,t,n){return et(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function KM(e){return Sx([SM(),DM(),HM(e),$M(),YM()])}const ZM={};function dw(e){const t=this,n=e||ZM,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(KM(n)),l.push(_M()),u.push(vM(n))}const QM={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},JM={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Up(e){const t=e.trim().toLowerCase();return QM[t]??t}function pw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=JM[t];if(n)return Up(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Up(t.slice(r+1))}di.displayName="clike";di.aliases=[];function di(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}ul.displayName="c";ul.aliases=[];function ul(e){e.register(di),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Zu.displayName="cpp";Zu.aliases=[];function Zu(e){e.register(ul),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Fg.displayName="arduino";Fg.aliases=["ino"];function Fg(e){e.register(Zu),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Pg.displayName="bash";Pg.aliases=["sh","shell"];function Pg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o<l.length;o++)u[l[o]]=t.languages.bash[l[o]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}Ug.displayName="csharp";Ug.aliases=["cs","dotnet"];function Ug(e){e.register(di),(function(t){function n(M,O){return M.replace(/<<(\d+)>>/g,function($,U){return"(?:"+O[+U]+")"})}function r(M,O,$){return RegExp(n(M,O),"")}function a(M,O){for(var $=0;$<O;$++)M=M.replace(/<<self>>/g,function(){return"(?:"+M+")"});return M.replace(/<<self>>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),_=a(/\((?:[^()]|<<self>>)*\)/.source,2),v=/@?\b[A-Za-z_]\w*\b/.source,w=n(/<<0>>(?:\s*<<1>>)?/.source,[v,d]),C=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,w]),b=/\[\s*(?:,\s*)*\]/.source,S=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[C,b]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,_,b]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,C,b]),R={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,D=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[D]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[v,E]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[v]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:R},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\bwhere\s+)<<0>>/.source,[v]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[S]),lookbehind:!0,inside:R},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,v]),inside:R}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[v]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[v]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[_]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,C]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[v,d]),inside:{function:r(/^<<0>>/.source,[v]),generic:{pattern:RegExp(d),alias:"class-name",inside:R}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,w,v,E,c.source,_,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,_]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=D+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),F=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),Y=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,H=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[C,F]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[Y,H]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[Y]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[F]),inside:t.languages.csharp},"class-name":{pattern:RegExp(C),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var z=/:[^}\r\n]+/.source,V=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),G=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[V,z]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,z]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,z]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[G]),lookbehind:!0,greedy:!0,inside:L(G,V)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}hl.displayName="markup";hl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function hl(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ca.displayName="css";Ca.aliases=[];function Ca(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}$g.displayName="diff";$g.aliases=[];function $g(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r +?| +|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Gg.displayName="go";Gg.aliases=[];function Gg(e){e.register(di),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}qg.displayName="ini";qg.aliases=[];function qg(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}Vg.displayName="java";Vg.aliases=[];function Vg(e){e.register(di),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Yg.displayName="regex";Yg.aliases=[];function Yg(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(e)}Qu.displayName="javascript";Qu.aliases=["js"];function Qu(e){e.register(di),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}Wg.displayName="json";Wg.aliases=["webmanifest"];function Wg(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}Xg.displayName="kotlin";Xg.aliases=["kt","kts"];function Xg(e){e.register(di),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}Kg.displayName="less";Kg.aliases=[];function Kg(e){e.register(Ca),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}Zg.displayName="lua";Zg.aliases=[];function Zg(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}Qg.displayName="makefile";Qg.aliases=[];function Qg(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}Jg.displayName="yaml";Jg.aliases=["yml"];function Jg(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}em.displayName="markdown";em.aliases=["md"];function em(e){e.register(hl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p<d;p++){var _=f[p];if(_.type!=="code"){c(_.content);continue}var v=_.content[1],w=_.content[3];if(v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"){var C=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var b="language-"+C;w.alias?typeof w.alias=="string"?w.alias=[w.alias,b]:w.alias.push(b):w.alias=[b]}}}c(o.tokens)}),t.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",f=0,p=o.classes.length;f<p;f++){var d=o.classes[f],_=/language-(.+)/.exec(d);if(_){c=_[1];break}}var v=t.languages[c];if(v)o.content=t.highlight(o.content.value,v,c);else if(c&&c!=="none"&&t.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);o.attributes.id=w,t.plugins.autoloader.loadLanguages(c,function(){var C=document.getElementById(w);C&&(C.innerHTML=t.highlight(C.textContent,t.languages[c],c))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}tm.displayName="objectivec";tm.aliases=["objc"];function tm(e){e.register(ul),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}nm.displayName="perl";nm.aliases=[];function nm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ju.displayName="markup-templating";Ju.aliases=[];function Ju(e){e.register(hl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f<c.length&&!(l>=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],_=r.tokenStack[d],v=typeof p=="string"?p:p.content,w=n(a,d),C=v.indexOf(w);if(C>-1){++l;var b=v.substring(0,C),S=new t.Token(a,t.tokenize(_,r.grammar),"language-"+a,_),x=v.substring(C+w.length),y=[];b&&y.push.apply(y,o([b])),y.push(S),x&&y.push.apply(y,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(y)):p.content=y}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}im.displayName="php";im.aliases=[];function im(e){e.register(Ju),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}rm.displayName="python";rm.aliases=["py"];function rm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}sm.displayName="r";sm.aliases=[];function sm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}am.displayName="ruby";am.aliases=["rb"];function am(e){e.register(di),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}om.displayName="rust";om.aliases=[];function om(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}lm.displayName="sass";lm.aliases=[];function lm(e){e.register(Ca),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}cm.displayName="scss";cm.aliases=[];function cm(e){e.register(Ca),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}um.displayName="sql";um.aliases=[];function um(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}hm.displayName="swift";hm.aliases=[];function hm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}fm.displayName="typescript";fm.aliases=["ts"];function fm(e){e.register(Qu),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}eh.displayName="basic";eh.aliases=[];function eh(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}dm.displayName="vbnet";dm.aliases=[];function dm(e){e.register(eh),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const M1=/[#.]/g;function ej(e,t){const n=e||"",r={};let a=0,l,u;for(;a<n.length;){M1.lastIndex=a;const o=M1.exec(n),c=n.slice(a,o?o.index:n.length);c&&(l?l==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:u=c,a+=c.length),o&&(l=o[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function gw(e,t,n){const r=n?rj(n):void 0;function a(l,u,...o){let c;if(l==null){c={type:"root",children:[]};const f=u;o.unshift(f)}else{c=ej(l,t);const f=c.tagName.toLowerCase(),p=r?r.get(f):void 0;if(c.tagName=p||f,tj(u))o.unshift(u);else for(const[d,_]of Object.entries(u))nj(e,c.properties,d,_)}for(const f of o)$p(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return a}function tj(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const l=a;for(const u of l)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function nj(e,t,n,r){const a=fx(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?a.spaceSeparated?l=Vy(r):a.commaSeparated?l=Py(r):a.commaOrSpaceSeparated?l=Vy(Py(r).join(" ")):l=j1(a,a.property,r):Array.isArray(r)?l=[...r]:l=a.property==="style"?ij(r):String(r);if(Array.isArray(l)){const u=[];for(const o of l)u.push(j1(a,a.property,o));l=u}a.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[a.property]=l}}function $p(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)$p(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$p(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function j1(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Po(n)===Po(t)))return!0}return n}function ij(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function rj(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const sj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],aj=gw(dx,"div");gw(qu,"g",sj);const oj=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],L1={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function mw(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function lj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function cj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function O1(e){return cj(e)||mw(e)}const uj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function hj(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,_=w(),v;for(l--;++l<=e.length;)if(v===10&&(d=(f?f[u]:0)||1),v=e.charCodeAt(l),v===38){const S=e.charCodeAt(l+1);if(S===9||S===10||S===12||S===32||S===38||S===60||Number.isNaN(S)||r&&S===r){o+=String.fromCharCode(v),d++;continue}const x=l+1;let y=x,E=x,R;if(S===35){E=++y;const H=e.charCodeAt(E);H===88||H===120?(R="hexadecimal",E=++y):R="decimal"}else R="named";let N="",D="",T="";const j=R==="named"?O1:R==="decimal"?mw:lj;for(E--;++E<=e.length;){const H=e.charCodeAt(E);if(!j(H))break;T+=String.fromCharCode(H),R==="named"&&oj.includes(T)&&(N=T,D=$o(T))}let B=e.charCodeAt(E)===59;if(B){E++;const H=R==="named"?$o(T):!1;H&&(N=T,D=H)}let F=1+E-x,Y="";if(!(!B&&n.nonTerminated===!1))if(!T)R!=="named"&&C(4,F);else if(R==="named"){if(B&&!D)C(5,1);else if(N!==T&&(E=y+N.length,F=1+E-y,B=!1),!B){const H=N?1:3;if(n.attribute){const z=e.charCodeAt(E);z===61?(C(H,F),D=""):O1(z)?D="":C(H,F)}else C(H,F)}Y=D}else{B||C(2,F);let H=Number.parseInt(T,R==="hexadecimal"?16:10);if(fj(H))C(7,F),Y="�";else if(H in L1)C(6,F),Y=L1[H];else{let z="";dj(H)&&C(6,F),H>65535&&(H-=65536,z+=String.fromCharCode(H>>>10|55296),H=56320|H&1023),Y=z+String.fromCharCode(H)}}if(Y){b(),_=w(),l=E-1,d+=E-x+1,a.push(Y);const H=w();H.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,Y,{start:_,end:H},e.slice(x-1,E)),_=H}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else v===10&&(p++,u++,d=0),Number.isNaN(v)?b():(o+=String.fromCharCode(v),d++);return a.join("");function w(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function C(S,x){let y;n.warning&&(y=w(),y.column+=x,y.offset+=x,n.warning.call(n.warningContext||void 0,uj[S],y,S))}function b(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:_,end:w()}),o="")}}function fj(e){return e>=55296&&e<=57343||e>1114111}function dj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var pj=0,$c={},Yt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++pj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Yt.util.type(t)){case"Object":if(a=Yt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Yt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:$c,plaintext:$c,text:$c,txt:$c,extend:function(e,t){var n=Yt.util.clone(Yt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Yt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Yt.languages.DFS(Yt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Yt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Yt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yt.tokenize(r.code,r.grammar),Yt.hooks.run("after-tokenize",r),Io.stringify(Yt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new gj;return hu(a,a.head,e),_w(e,a,t,a.head,0),_j(a)},hooks:{all:{},add:function(e,t){var n=Yt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:Io};function Io(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function B1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function _w(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c<o.length;++c){if(l&&l.cause==u+","+c)return;var f=o[c],p=f.inside,d=!!f.lookbehind,_=!!f.greedy,v=f.alias;if(_&&!f.pattern.global){var w=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,w+"g")}for(var C=f.pattern||f,b=r.next,S=a;b!==t.tail&&!(l&&S>=l.reach);S+=b.value.length,b=b.next){var x=b.value;if(t.length>e.length)return;if(!(x instanceof Io)){var y=1,E;if(_){if(E=B1(C,S,e,d),!E||E.index>=e.length)break;var T=E.index,R=E.index+E[0].length,N=S;for(N+=b.value.length;T>=N;)b=b.next,N+=b.value.length;if(N-=b.value.length,S=N,b.value instanceof Io)continue;for(var D=b;D!==t.tail&&(N<R||typeof D.value=="string");D=D.next)y++,N+=D.value.length;y--,x=e.slice(S,N),E.index-=S}else if(E=B1(C,0,x,d),!E)continue;var T=E.index,j=E[0],B=x.slice(0,T),F=x.slice(T+j.length),Y=S+x.length;l&&Y>l.reach&&(l.reach=Y);var H=b.prev;B&&(H=hu(t,H,B),S+=B.length),mj(t,H,y);var z=new Io(u,p?Yt.tokenize(j,p):j,v,j);if(b=hu(t,H,z),F&&hu(t,b,F),y>1){var V={cause:u+","+c,reach:Y};_w(e,t,n,b.prev,S,V),l&&V.reach>l.reach&&(l.reach=V.reach)}}}}}}function gj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function hu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function mj(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}function _j(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const vw=Yt;function yw(){}yw.prototype=vw;const je=new yw;je.highlight=vj;je.register=yj;je.alias=bj;je.registered=Sj;je.listLanguages=xj;je.util.encode=wj;je.Token.stringify=Gp;function vj(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(je.languages,r))n=je.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:vw.highlight.call(je,e,n,r)}}function yj(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(je.languages,e.displayName)||e(je)}function bj(e,t){const n=je.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let a;for(a in r)if(Object.hasOwn(r,a)){const l=r[a],u=typeof l=="string"?[l]:l;let o=-1;for(;++o<u.length;)n[u[o]]=n[a]}}function Sj(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(je.languages,e)}function xj(){const e=je.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Gp(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let a=-1;for(;++a<e.length;)e[a]!==null&&e[a]!==void 0&&e[a]!==""&&r.push(Gp(e[a],t));return r}const n={attributes:{},classes:["token",e.type],content:Gp(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),je.hooks.run("wrap",n),aj(n.tag+"."+n.classes.join("."),Cj(n.attributes),n.content)}function wj(e){return e}function Cj(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=hj(e[t]));return e}je.register(di);je.register(ul);je.register(Zu);je.register(Fg);je.register(Pg);je.register(Ug);je.register(hl);je.register(Ca);je.register($g);je.register(Gg);je.register(qg);je.register(Vg);je.register(Yg);je.register(Qu);je.register(Wg);je.register(Xg);je.register(Kg);je.register(Zg);je.register(Qg);je.register(Jg);je.register(em);je.register(tm);je.register(nm);je.register(Ju);je.register(im);je.register(rm);je.register(sm);je.register(am);je.register(om);je.register(lm);je.register(cm);je.register(um);je.register(hm);je.register(fm);je.register(eh);je.register(dm);function bw(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:m.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(bw)},t)}function Sw(e,t,n=3e5){if(!t||!je.registered(t)||e.length>n)return e;try{return je.highlight(e,t).children.map(bw)}catch{return e}}const Ej=1e5;function kj({code:e,lang:t}){const[n,r]=q.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return m.jsxs("div",{className:"md-code",children:[m.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})}),m.jsx("pre",{children:m.jsx("code",{children:Sw(e,t,Ej)})})]})}function Aj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function Nj(e){const t=/<file\b([^>]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Aj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(r<e.length&&n.push({type:"text",value:e.slice(r)}),n):null}function xw(e){const t=e.children;if(t)for(let n=0;n<t.length;n+=1){const r=t[n];if(r){if(r.type==="html"&&typeof r.value=="string"){const a=Nj(r.value);if(a){t.splice(n,1,...a),n+=a.length-1;continue}}xw(r)}}}function Tj(){return e=>xw(e)}function I1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return m.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[m.jsx(GS,{size:12}),m.jsx("span",{className:"file-chip-label",children:l})]})}function Rj(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const ww={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` +`)))return m.jsx("code",{className:a,...r,children:n});const c=l?Up(l[1]):null;return m.jsx(kj,{code:u,lang:c})},pre:({children:e})=>m.jsx(m.Fragment,{children:e})};function qo({text:e,onOpenFile:t}){const n={"file-mention":r=>m.jsx(I1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&Rj(a)&&t?m.jsx(I1,{path:decodeURI(a),onOpenFile:t}):m.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...ww};return m.jsx("div",{className:"md",children:m.jsx($x,{remarkPlugins:[dw,Tj],components:n,children:e})})}function Dj({synthesized:e,onView:t,onApprove:n,onReject:r,onRevise:a}){const[l,u]=q.useState(!1),o=q.useRef(null),[c,f]=q.useState(!1),[p,d]=q.useState(""),_=q.useRef(null);q.useEffect(()=>{if(!l)return;const w=C=>{o.current&&!o.current.contains(C.target)&&u(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[l]),q.useEffect(()=>{var w;c&&((w=_.current)==null||w.focus())},[c]);const v=()=>{a(p.trim()||"no specific feedback — use your judgment"),d(""),f(!1)};return m.jsxs("div",{className:"plan-strip",children:[m.jsxs("div",{className:"plan-strip-info",children:[m.jsx(WS,{size:14,className:"plan-strip-icon"}),m.jsx("span",{className:"plan-strip-title",children:e?"Claude is ready to proceed":"Claude proposed a plan"}),m.jsx("button",{className:"plan-strip-open",onClick:t,children:"Open plan"})]}),c?m.jsxs(m.Fragment,{children:[m.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:p,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),d(""),f(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),v())}}),m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:()=>{d(""),f(!1)},children:"Back"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:v,children:["Revise",m.jsx(US,{size:13})]})]})]}):m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:r,children:"Reject"}),m.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("div",{className:"plan-strip-approve",ref:o,children:[m.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>n("auto"),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(w=>!w),children:m.jsx(cs,{size:13})}),l&&m.jsx("div",{className:"plan-strip-menu",children:m.jsx("button",{onClick:()=>{u(!1),n("bypass")},children:"Accept and bypass all"})})]})]})]})}function Cw({onSaved:e}){const[t,n]=q.useState(""),[r,a]=q.useState(!1),[l,u]=q.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await dT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return m.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[m.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),m.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),m.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&m.jsx("div",{className:"error",children:l})]})}function Mj(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function jj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),m.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),m.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),m.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),m.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),m.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),m.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function Lj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),m.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),m.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),m.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),m.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),m.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),m.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),m.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Oj({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:m.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function pm({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:m.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Ew({kind:e,size:t=16}){switch(e){case"modal_job":return m.jsx(Lj,{size:t});case"hf_job":return m.jsx(jj,{size:t});case"k8s_job":return m.jsx(Oj,{size:t});case"ssh_job":return m.jsx(Ap,{size:t});case"slurm_job":return m.jsx(DA,{size:t});case"openresearch_job":return m.jsx(zA,{size:t});case"local_job":return m.jsx(hN,{size:t});default:return m.jsx(Ap,{size:t})}}function Bj({backend:e}){const t=ix(e),n=rx(e);return t?m.jsxs("span",{className:"backend-badge",children:[m.jsx(Ew,{kind:t}),m.jsx("span",{className:"backend-name",children:Mj(t)}),n&&m.jsx("span",{className:"backend-detail mono",children:n})]}):m.jsx("span",{className:"backend-badge muted",children:"—"})}const z1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Ij(e){return z1[e]??z1.idle}function Vo({status:e,label:t}){const n=Ij(e);return m.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[m.jsx("span",{className:"dot"}),t??e]})}function lp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function zj({h:e}){return e.authMethod?m.jsx(m.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):m.jsx(m.Fragment,{children:"—"})}function Hj(){const[e,t]=q.useState(null),[n,r]=q.useState("claude-code"),[a,l]=q.useState(!1),u=c=>{l(!0),wg(c).then(t).catch(()=>{}).finally(()=>l(!1))};q.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Harnesses"}),m.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),m.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>m.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,m.jsx("span",{className:`harness-dot ${lp(c).cls}`})]},c.id))}),e?o?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("span",{className:`badge ${lp(o).cls}`,children:lp(o).label}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Binary"}),m.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),m.jsx("span",{className:"k",children:"Version"}),m.jsx("span",{className:"v",children:o.version??"—"}),m.jsx("span",{className:"k",children:"Auth"}),m.jsx("span",{className:"v",children:m.jsx(zj,{h:o})}),o.account&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),m.jsx("span",{className:"v",children:o.account})]}),o.org&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Org"}),m.jsx("span",{className:"v",children:o.org})]}),o.plan&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Plan"}),m.jsx("span",{className:"v",children:o.plan})]}),m.jsx("span",{className:"k",children:"Agent models"}),m.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>xu(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&m.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function Fj({s:e}){if(!e.configured)return m.jsx("span",{className:"badge",children:"not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"no job-create permission"}):m.jsx("span",{className:"badge err",children:"cluster unreachable"}):m.jsx("span",{className:"badge err",children:"kubectl not found"})}function Pj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(""),[c,f]=q.useState(!1),[p,d]=q.useState(null),_=C=>{t(C),l(C.context??""),o(C.namespace)};q.useEffect(()=>{YN().then(_).catch(C=>r(C instanceof Error?C.message:String(C)))},[]);const v=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function w(C){if(C.preventDefault(),!c){f(!0),d(null);try{_(await WN({context:a,namespace:u.trim()}))}catch(b){d(b instanceof Error?b.message:String(b))}finally{f(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",m.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Cluster"}),m.jsx("span",{className:"v",children:m.jsx(Fj,{s:e})})]}),e.preflight.error&&m.jsx("p",{className:"settings-note",children:e.preflight.error}),m.jsxs("form",{className:"form settings-form",onSubmit:w,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Context",m.jsxs("select",{value:a,onChange:C=>l(C.target.value),children:[m.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(C=>m.jsx("option",{value:C,children:C},C))]})]}),m.jsxs("label",{children:["Namespace",m.jsx("input",{className:"mono",type:"text",value:u,onChange:C=>o(C.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&m.jsx("div",{className:"error",children:p}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:c||v,children:c?"Saving…":"Save"})})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("div",{className:"settings-card-head",children:m.jsx("h3",{children:"Run manifest"})}),m.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",m.jsx("code",{children:".orx/k8s.yaml"}),", or ",m.jsx("code",{children:"--manifest <path>"}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",m.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",m.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",m.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",m.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const Uj={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function $j({s:e}){return e.ready?m.jsx("span",{className:"badge ok",children:"connected"}):!e.tokenConfigured&&!e.modalImportable?m.jsx("span",{className:"badge",children:"not set up"}):e.modalImportable?e.tokenConfigured?m.jsx("span",{className:"badge",children:"unknown"}):m.jsx("span",{className:"badge err",children:"no token"}):m.jsx("span",{className:"badge err",children:e.envProvisioned?"env broken":"env not built"})}function Gj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[u,o]=q.useState(null);q.useEffect(()=>{XN().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await KN())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",m.jsx("code",{children:"--backend modal --flavor <name>"})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx($j,{s:e})}),m.jsx("span",{className:"k",children:"Environment"}),m.jsx("span",{className:"v",children:e.modalImportable?"ready":e.envProvisioned?"provisioned (modal import failing)":"not built yet"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.tokenSource?Uj[e.tokenSource]:"not configured"})]}),!e.tokenConfigured&&m.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",m.jsx("code",{children:"modal token new"}),", or add"," ",m.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",m.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&m.jsx("p",{className:"settings-note",children:e.error}),u&&m.jsx("div",{className:"error",children:u}),!e.modalImportable&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function qj({test:e}){if(e===void 0)return m.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return m.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"});return m.jsxs(m.Fragment,{children:[t,m.jsx("span",{className:"ssh-tested-at",children:Sa(e.testedAt)})]})}function Vj(){const[e,t]=q.useState(null),[n,r]=q.useState({});q.useEffect(()=>{nT().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await iT(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",m.jsx("code",{children:"--backend ssh --host <alias>"}),". Hosts come from"," ",m.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",m.jsx("code",{children:"git"})," and ",m.jsx("code",{children:"bash"}),"."]}),e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?m.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):m.jsxs("table",{className:"flavor-table ssh-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Host"}),m.jsx("th",{children:"Address"}),m.jsx("th",{children:"Identity"}),m.jsx("th",{children:"Status"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:e.map(l=>m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:l.host}),m.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),m.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),m.jsx("td",{children:m.jsx(qj,{test:n[l.host]??l.lastTest})}),m.jsx("td",{children:m.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function Yj({test:e}){return e===null?null:e==="testing"?m.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",children:"no slurm CLI"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"})}function Wj(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(""),[c,f]=q.useState(""),[p,d]=q.useState(""),[_,v]=q.useState(!1),[w,C]=q.useState(null),[b,S]=q.useState(null),x=b!==null&&b!=="testing"?b:null,y=D=>{t(D),l(D.host??""),o(D.partition??""),f(D.account??""),d(D.timeLimit??"")};q.useEffect(()=>{rT().then(y).catch(D=>r(D instanceof Error?D.message:String(D)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function R(D){if(D.preventDefault(),!_){v(!0),C(null);try{y(await sT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){C(T instanceof Error?T.message:String(T))}finally{v(!1)}}}async function N(D){S("testing");try{S(await aT(D))}catch(T){S({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",m.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[(x==null?void 0:x.error)&&m.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&m.jsxs("p",{className:"settings-note",children:["Partitions: ",m.jsx("code",{children:x.partitions.join(", ")})]}),m.jsxs("form",{className:"form settings-form",onSubmit:R,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Login node",m.jsxs("select",{value:a,onChange:D=>{l(D.target.value),S(null)},children:[m.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(D=>D.host===a)&&m.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(D=>m.jsx("option",{value:D.host,children:D.host},D.host))]})]}),m.jsxs("label",{children:["Partition",m.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:D=>o(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(D=>m.jsx("option",{value:D},D))})]})]}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Account",m.jsx("input",{className:"mono",type:"text",value:c,onChange:D=>f(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),m.jsxs("label",{children:["Time limit",m.jsx("input",{className:"mono",type:"text",value:p,onChange:D=>d(D.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),w&&m.jsx("div",{className:"error",children:w}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn primary",disabled:_||E,children:_?"Saving…":"Save"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||b==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),m.jsx(Yj,{test:b})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function Xj(){const[e,t]=q.useState(null),[n,r]=q.useState(null);return q.useEffect(()=>{lT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",m.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Hostname"}),m.jsx("span",{className:"v mono",children:e.hostname}),m.jsx("span",{className:"k",children:"System"}),m.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),m.jsx("span",{className:"k",children:"CPU"}),m.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),m.jsx("span",{className:"k",children:"RAM"}),m.jsx("span",{className:"v",children:e.memBytes!==null?ns(e.memBytes):"—"}),m.jsx("span",{className:"k",children:"GPUs"}),m.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ns(a.memMib*1024*1024)}`:""}`).join(", ")})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function Kj(){const[e,t]=q.useState(null),[n,r]=q.useState(null);return q.useEffect(()=>{cT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",m.jsx("code",{children:"--backend openresearch --flavor <shape>"})," (h100_sxm, cpu5c, …; browse with ",m.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",m.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?m.jsx("div",{className:"error",children:n}):e?e.loggedIn?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx("span",{className:"badge ok",children:"signed in"})}),m.jsx("span",{className:"k",children:"Orgs"}),m.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),m.jsx("span",{className:"k",children:"SSH key"}),m.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?m.jsx("span",{className:"badge ok",children:"registered"}):e.sshKeyRegistered===!1?m.jsx("span",{className:"badge err",children:"none registered"}):m.jsx("span",{className:"badge",children:"unknown"})})]}),e.sshKeyRegistered===!1&&m.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",m.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&m.jsx("p",{className:"settings-note",children:e.error})]}):m.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",m.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const H1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},Zj={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},Qj=["hf","modal","slurm","openresearch"],F1=["hf","modal","openresearch"],P1={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function Jj({t:e,isDefault:t}){return e.id==="local"?m.jsx("span",{className:"badge ok",children:"ready"}):!e.configured&&t?m.jsx("span",{className:"badge warn",children:"not configured"}):e.configured?m.jsx("span",{className:"badge ok",children:"configured"}):m.jsx("span",{className:"badge",children:"not set up"})}function eL({target:e,flavor:t,onSaved:n}){var d;const[r,a]=q.useState(t??""),[l,u]=q.useState(!1),[o,c]=q.useState(null);q.useEffect(()=>a(t??""),[t]);async function f(_){if(_.preventDefault(),!l){u(!0),c(null);try{n(await tx({backend:e,flavor:r.trim()||null}))}catch(v){c(v instanceof Error?v.message:String(v))}finally{u(!1)}}}const p=r.trim()===(t??"");return m.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[m.jsxs("label",{children:["Default flavor",m.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:_=>a(_.target.value),placeholder:F1.includes(e)?`e.g. ${((d=P1[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:`flavors-${e}`,children:(P1[e]??[]).map(_=>m.jsx("option",{value:_},_))})]}),o&&m.jsx("div",{className:"error",children:o}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),F1.includes(e)&&!t&&m.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",m.jsx("code",{children:"--flavor"}),"."]})]})]})}function tL({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=q.useState(!1),[f,p]=q.useState(!1);r&&!o&&c(!0);async function d(_){if(!f){p(!0);try{l(await tx({backend:_}))}catch(v){u(v instanceof Error?v.message:String(v))}finally{p(!1)}}}return m.jsxs("div",{className:`compute-row${r?" open":""}`,children:[m.jsxs("div",{className:"compute-row-head",onClick:a,children:[m.jsx("span",{className:"compute-row-logo",children:m.jsx(Ew,{kind:Zj[e.id],size:18})}),m.jsx("span",{className:"compute-row-name",children:H1[e.id]}),m.jsx("span",{className:"compute-row-summary",children:e.summary}),m.jsx(Jj,{t:e,isDefault:t}),t?m.jsx("span",{className:"badge compute-default-pill",children:"Default"}):m.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:_=>{_.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),m.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${H1[e.id]}`,onClick:_=>{_.stopPropagation(),a()},children:m.jsx(cs,{size:16,className:"compute-chevron"})})]}),o&&m.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&m.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",m.jsx("code",{children:"orx exp run"})," with no ",m.jsx("code",{children:"--backend"})," flag."," ",m.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&m.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&Qj.includes(e.id)&&m.jsx(eL,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&m.jsx(Xj,{}),e.id==="hf"&&m.jsx(aL,{}),e.id==="modal"&&m.jsx(Gj,{}),e.id==="k8s"&&m.jsx(Pj,{}),e.id==="ssh"&&m.jsx(Vj,{}),e.id==="slurm"&&m.jsx(Wj,{}),e.id==="openresearch"&&m.jsx(Kj,{})]})]})}function nL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(null),[u,o]=q.useState(null),c=q.useRef(0);q.useEffect(()=>{const d=++c.current;oT().then(_=>{d===c.current&&(t(_),r(null))}).catch(_=>{if(d!==c.current)return;const v=_ instanceof Error?_.message:String(_);t(w=>(w===null?r(v):o(v),w))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Compute"}),m.jsxs("p",{className:"settings-sub",children:["Where ",m.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",m.jsx("code",{children:"--backend <name>"})," always wins)."]}),n?m.jsx("div",{className:"error",children:n}):p?m.jsxs(m.Fragment,{children:[u&&m.jsx("div",{className:"error",children:u}),m.jsx("div",{className:"compute-list",children:p.map(d=>m.jsx(tL,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(_=>_===d.id?null:d.id),onSettings:f,onError:o},d.id))}),m.jsxs("p",{className:"compute-footnote",children:[m.jsx(cN,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const iL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function rL({settings:e}){return e.configured?e.valid?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"invalid token"}):m.jsx("span",{className:"badge",children:"not configured"})}function sL({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?m.jsx("span",{className:"badge ok",children:"jobs: write OK"}):e.jobsWrite===!1?m.jsx("span",{className:"badge err",children:"no job.write permission"}):m.jsx("span",{className:"badge",children:"jobs permission unknown"})}function aL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null),p=q.useRef(!1);q.useEffect(()=>{qN().then(_=>{p.current||t(_)}).catch(_=>{p.current||r(_ instanceof Error?_.message:String(_))})},[]);async function d(_){if(_.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const v=await VN(a.trim());p.current=!0,t(v),r(null),l("")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",m.jsx("code",{children:"--backend hf --flavor <name>"})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(rL,{settings:e})}),m.jsx("span",{className:"k",children:"Account"}),m.jsx("span",{className:"v",children:e.username??"—"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.maskedToken??"—"}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:e.source?iL[e.source]:"not configured"}),m.jsx("span",{className:"k",children:"Jobs"}),m.jsxs("span",{className:"v",children:[m.jsx(sL,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&m.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&m.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",m.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",m.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading status…"]}),m.jsxs("form",{className:"form settings-form",onSubmit:d,children:[m.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",m.jsx("input",{type:"password",value:a,onChange:_=>l(_.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const kw=/^hf_[A-Za-z0-9]{10,}$/;function Aw(){return m.jsx("tr",{children:m.jsx("td",{colSpan:3,children:m.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",m.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const U1=["HF_TOKEN","WANDB_API_KEY"];function oL({name:e,entry:t,onVars:n,onError:r}){const[a,l]=q.useState(""),[u,o]=q.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await JS(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await QN(e))}catch(d){c(d)}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:e}),m.jsx("td",{className:"mono muted",children:t?m.jsxs(m.Fragment,{children:[t.maskedValue,t.inProcessEnv&&m.jsx("span",{className:"badge",children:"overridden by env"})]}):m.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),m.jsx("td",{children:t?m.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:m.jsx(Gu,{size:13})}):a.trim()&&m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&kw.test(a.trim())&&m.jsx(Aw,{})]})}function lL({onVars:e,onError:t,onDone:n}){const[r,a]=q.useState(""),[l,u]=q.useState(""),[o,c]=q.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await JS(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),m.jsx("td",{children:m.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),m.jsxs("td",{children:[m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),m.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:m.jsx(Fo,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&kw.test(l.trim())&&m.jsx(Aw,{})]})}function cL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[u,o]=q.useState(null);q.useEffect(()=>{ZN().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!U1.includes(d)),p=[...U1,...f];return m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Environment variables"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[m.jsx(bg,{size:12})," Add variable"]})]}),m.jsxs("p",{className:"settings-sub",children:["Stored in ",m.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",m.jsx("code",{children:"HF_TOKEN"})," and ",m.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?m.jsx("div",{className:"error",children:n}):e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsx("table",{className:"env-table",children:m.jsxs("tbody",{children:[p.map(d=>m.jsx(oL,{name:d,entry:e.find(_=>_.key===d),onVars:c,onError:o},d)),a&&m.jsx(lL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&m.jsx("div",{className:"error",children:u})]})}function uL(){const[e,t]=q.useState(null),[n,r]=q.useState(""),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null);q.useEffect(()=>{nx().then(_=>{t(_),r(_.userName??""),l(_.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(_){if(_.preventDefault(),!(u||p)){o(!0),f(null);try{const v=await fT({userName:n.trim(),userEmail:a.trim()});t(v),r(v.userName??""),l(v.userEmail??"")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Git"}),m.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("form",{className:"form",onSubmit:d,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["user.name",m.jsx("input",{type:"text",value:n,onChange:_=>r(_.target.value),autoComplete:"off"})]}),m.jsxs("label",{children:["user.email",m.jsx("input",{type:"text",value:a,onChange:_=>l(_.target.value),autoComplete:"off"})]})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"GitHub access"}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"git"}),m.jsx("span",{className:"v",children:e.gitVersion??"not found"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",m.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),m.jsx(Cw,{onSaved:t})]}),e.githubTokenSource==="stored"&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn",onClick:()=>{pT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}function hL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return m.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[m.jsx("div",{className:"progress-track",children:m.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),m.jsxs("div",{className:"progress-caption",children:[m.jsx("span",{children:n??`${r}%`}),t>0&&m.jsxs("span",{className:"mono",children:[ns(e)," / ",ns(t)]})]})]})}const fL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function dL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(""),[u,o]=q.useState(!1),[c,f]=q.useState(null),[p,d]=q.useState({kind:"idle"}),[_,v]=q.useState(null),w=()=>ex().then(E=>{t(E),l(R=>R||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));q.useEffect(()=>{w()},[]),q.useEffect(()=>RT(E=>{E.type==="progress"?d(R=>{const N=R.kind==="moving"?R.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),w()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const C=(e==null?void 0:e.source)==="env",b=a.trim(),S=e!==null&&b===e.current;async function x(){if(!(u||!b)){o(!0),v(null),f(null);try{f(await JN(b))}catch(E){v(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function y(E){if(E.preventDefault(),!(p.kind==="moving"||!b||S)&&(v(null),!!window.confirm(`Move all orx data to: +${b} + +The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await tT(b)}catch(R){d({kind:"idle"}),v(R instanceof Error?R.message:String(R))}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Storage"}),m.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",m.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?m.jsx("div",{className:"settings-card",children:m.jsx("div",{className:"error",children:n})}):e?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Data directory"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsx("span",{className:"badge",children:e.isDefault?"default":"custom"})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Current"}),m.jsx("span",{className:"v mono",children:e.current}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:fL[e.source]}),!e.isDefault&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Default"}),m.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),C?m.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):m.jsxs("form",{className:"form settings-form",onSubmit:y,children:[m.jsxs("label",{children:["New location",m.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&m.jsxs("p",{className:"settings-note",children:["Ready to move ",ns(c.treeBytes??0),c.freeBytes!=null&&` — ${ns(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&m.jsx("div",{className:"error",children:c.error}),_&&m.jsx("div",{className:"error",children:_}),p.kind==="moving"&&m.jsx(hL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&m.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&m.jsxs(m.Fragment,{children:[" ","The old copy was left at ",m.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&m.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!b||S||p.kind==="moving",children:u?"Checking…":"Check"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!b||S||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}const qp=e=>e==="running"||e==="starting";function pL(e){return qp(e.status)?Fy(Date.now()-e.createdAt):e.endedAt?Fy(e.endedAt-e.createdAt):"—"}function $1({instances:e,emptyLabel:t}){return e.length===0?m.jsx("p",{className:"instances-empty",children:t}):m.jsx("div",{className:"instances-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Project"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Runtime"})]})}),m.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsxs("span",{className:"backend-cell",children:[m.jsx(Bj,{backend:n.backend}),r&&m.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:m.jsx($S,{size:12})})]})}),m.jsx("td",{children:n.projectName??Tp(n.projectId)}),m.jsx("td",{children:m.jsx(Vo,{status:n.status})}),m.jsx("td",{children:Sa(n.createdAt)}),m.jsx("td",{className:"mono",children:pL(n)})]},n.id)})})]})})}function gL(){const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState(!1),[,u]=q.useState(0);q.useEffect(()=>{const d=setInterval(()=>u(_=>_+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),HN().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(_=>_??[])}).finally(()=>l(!1))};q.useEffect(()=>o(),[]);const c=(d,_)=>_.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>qp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!qp(d.status)).sort(c);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-head-row",children:[m.jsx("h1",{children:"Instances"}),m.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&m.jsx("div",{className:"error",children:n}),!f||!p?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsxs(m.Fragment,{children:[m.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&m.jsx("span",{className:"count-badge",children:f.length})]}),m.jsx($1,{instances:f,emptyLabel:"Nothing running right now."}),m.jsx("h2",{className:"instances-section-title",children:"Past"}),m.jsx($1,{instances:p,emptyLabel:"No past instances yet."})]})]})}const mL=[{id:"harnesses",label:"Harnesses",icon:m.jsx(TA,{size:15})},{id:"compute",label:"Compute",icon:m.jsx(GA,{size:15})},{id:"instances",label:"Instances",icon:m.jsx(Ap,{size:15})},{id:"environment",label:"Environment",icon:m.jsx(AN,{size:15})},{id:"git",label:"Git",icon:m.jsx($u,{size:15})},{id:"storage",label:"Storage",icon:m.jsx(oN,{size:15})}];function _L({tab:e}){return m.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&m.jsx(Hj,{}),e==="compute"&&m.jsx(nL,{}),e==="environment"&&m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Environment"}),m.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),m.jsx(cL,{})]}),e==="instances"&&m.jsx(gL,{}),e==="git"&&m.jsx(uL,{}),e==="storage"&&m.jsx(dL,{})]})}function vL({skills:e,activeIndex:t,onPick:n,onHover:r}){return m.jsx("div",{className:"skill-menu",children:e.map((a,l)=>m.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[m.jsxs("span",{className:"skill-name",children:["/",a.name," ",m.jsx("span",{className:"skill-hint",children:a.argHint})]}),m.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Nw={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function G1(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function th(){const[e,t]=q.useState(!1),n=q.useRef(null);return q.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function yL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=q.useState([]),{open:u,setOpen:o,ref:c}=th(),[f,p]=q.useState("");q.useEffect(()=>{wg().then(w=>{l(w),n==null||n(w)}).catch(()=>{})},[]);const d=q.useMemo(()=>{const w=f.trim().toLowerCase();return(r&&e?a.filter(b=>b.id===e.harness):a).map(b=>{let S=b.models;return w?S=S.filter(x=>x.id.toLowerCase().includes(w)):b.id==="opencode"&&(S=S.slice(0,6)),{harness:b,models:S,hidden:w?0:b.models.length-S.length}})},[a,f,r,e]),_=(w,C)=>{var S,x;const b=(e==null?void 0:e.harness)===w.id;t({harness:w.id,model:C,permissionMode:b?e.permissionMode:((S=w.options)==null?void 0:S.defaultPermissionMode)??null,reasoningLevel:b?e.reasoningLevel:((x=w.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},v=e?e.model?xu(e.model):"Default model":"Model";return m.jsxs("div",{className:"model-picker",ref:c,children:[m.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(w=>!w),children:[v,m.jsx(cs,{size:12})]}),u&&m.jsxs("div",{className:"model-menu align-right",children:[m.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:w=>p(w.target.value)}),m.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:w,models:C,hidden:b})=>m.jsxs("div",{children:[m.jsx("div",{className:"model-group",children:w.name}),w.agentReady?m.jsxs(m.Fragment,{children:[C.map(S=>m.jsxs("button",{className:"model-item",onClick:()=>_(w,S.id),children:[m.jsxs("span",{children:[xu(S.id),m.jsx("span",{className:"model-id",children:S.id})]}),(e==null?void 0:e.harness)===w.id&&(e==null?void 0:e.model)===S.id&&m.jsx(_n,{size:13})]},S.id)),b>0&&m.jsxs("div",{className:"model-more",children:[b," more — search to find"]})]}):m.jsx("div",{className:"model-more",children:w.agentNote??"Not available"})]},w.id)),a.length===0&&m.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&m.jsxs("div",{className:"model-locked-note",children:[m.jsx(dN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function q1({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var S,x;const{open:f,setOpen:p,ref:d}=th();if(e.length===0)return null;const _=t??n??((S=e[0])==null?void 0:S.id)??null,v=e.find(y=>y.id===_),w=e.find(y=>y.id===n),C=(v==null?void 0:v.label)??((x=e[0])==null?void 0:x.label)??"",b=y=>{c(y),p(!1)};return m.jsxs("div",{className:"option-picker",ref:d,children:[m.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(y=>!y),children:[C,m.jsx(cs,{size:12})]}),f&&m.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&m.jsx("div",{className:"model-group",children:r}),w&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"model-item",onClick:()=>b(w.id),children:[m.jsxs("span",{children:[w.label," ",m.jsx("span",{className:"option-default",children:"· Default"})]}),_===w.id&&m.jsx(_n,{size:13})]}),m.jsx("div",{className:"option-sep"})]}),e.map((y,E)=>m.jsxs("button",{className:"model-item",onClick:()=>b(y.id),children:[m.jsx("span",{children:y.label}),_===y.id?m.jsx(_n,{size:13}):o&&m.jsx("span",{className:"option-num",children:E+1})]},y.id))]})]})}const Tw="orx:agent-selection";function bL(){try{const e=localStorage.getItem(Tw);return e?JSON.parse(e):null}catch{return null}}const Rw="local-";function SL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith(Rw)):e,t]}function xL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:SL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${Rw}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function wL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?m.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):m.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Dw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function CL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function V1(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Vp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${V1(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${V1(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function EL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return m.jsxs("details",{className:"tool-row",open:!1,children:[m.jsxs("summary",{children:[m.jsx("span",{className:Dw(n==null?void 0:n.status)}),m.jsx("span",{className:"tool-line",children:Vp(e)}),l&&t&&m.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&m.jsxs("div",{className:"tool-detail",children:[a&&m.jsx("div",{className:"tool-cmd-full",children:a}),r&&m.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function kL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=q.useState(!1),u=a||n,o=e.length===1?Vp(e[0]):n?Vp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return m.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[m.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[m.jsx("span",{className:Dw(n?"running":r?"error":"completed")}),m.jsx("span",{className:"tool-line",children:o}),m.jsx(Uu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&m.jsx("div",{className:"tool-group-rows",children:e.map(c=>m.jsx(EL,{part:c,onOpenFile:t},c.id))})]})}function AL({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,_;const a=e.prompt,[l,u]=q.useState([]),o=!t,c=v=>t==null?void 0:t({promptId:e.id,...v});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const w=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",C=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),m.jsx("span",{className:`prompt-outcome ${C}`,children:w})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[m.jsx(qo,{text:a.plan??"",onOpenFile:n}),a.note&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const v=(a.answers??[]).join(", ")||a.note||"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),m.jsx("span",{className:`prompt-outcome ${v?"chosen":""}`,children:v||"Resolved"})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&m.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(w=>{var C;return m.jsx("li",{className:(C=a.answers)!=null&&C.includes(w.label)?"sel":"",children:w.label},w.label)})}),a.note&&a.note!==v&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const v=!!r;return m.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[m.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),m.jsx("div",{className:`prompt-plan ${v?"clamped":""}`,children:m.jsx(qo,{text:a.plan??"",onOpenFile:n})}),v&&m.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!v&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const v=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",w=typeof((_=a.toolInput)==null?void 0:_.reason)=="string"&&a.toolInput.reason||"";return m.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[m.jsxs("div",{className:"prompt-head",children:["Permission needed: ",m.jsx("code",{children:a.tool})]}),v&&m.jsx("div",{className:"prompt-sub",children:v}),w&&m.jsx("div",{className:"prompt-sub",children:w}),!o&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=v=>u(w=>a.multiSelect?w.includes(v)?w.filter(C=>C!==v):[...w,v]:[v]);return m.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&m.jsx("div",{className:"prompt-head",children:a.header}),a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),m.jsx("div",{className:"prompt-options",children:(a.options??[]).map(v=>{const w=l.includes(v.label);return m.jsxs("button",{className:`prompt-option ${w?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(v.label):c({answers:[v.label]}),children:[m.jsx("span",{className:"prompt-option-label",children:v.label}),v.description&&m.jsx("span",{className:"prompt-option-desc",children:v.description})]},v.label)})}),a.multiSelect&&!o&&m.jsx("div",{className:"prompt-actions",children:m.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function NL(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function TL({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` +`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:wT(f.text));return m.jsxs("div",{className:"msg-user",children:[o,c.length>0&&m.jsx("div",{className:"msg-images",children:c.map((f,p)=>m.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:m.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(m.jsx(kL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(m.jsx(qo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(m.jsxs("details",{className:"reasoning",children:[m.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(m.jsx(AL,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),m.jsx("div",{className:"msg-assistant",children:a})}const Mw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function RL({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=th();return m.jsxs("div",{className:"rail-filter",ref:a,children:[m.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:m.jsx(EN,{size:13})}),n&&m.jsx("div",{className:"option-menu drop-down align-right",children:Mw.map(l=>m.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[m.jsx("span",{children:l.label}),e===l.id&&m.jsx(_n,{size:13})]},l.id))})]})}function DL({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var y;const{open:c,setOpen:f,ref:p}=th(),d=((y=e.title)==null?void 0:y.trim())||"Untitled",[_,v]=q.useState(!1),[w,C]=q.useState(""),b=q.useRef(null);function S(){var E;C(((E=e.title)==null?void 0:E.trim())||""),v(!0)}function x(){var R;const E=w.trim();v(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&l(E)}return q.useEffect(()=>{var E,R;_&&((E=b.current)==null||E.focus(),(R=b.current)==null||R.select())},[_]),m.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${_?"editing":""}`,title:`${Nw[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{_||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[m.jsx("span",{className:"session-dot",children:n&&m.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),_?m.jsx("input",{ref:b,className:"session-title-input","aria-label":"Session title",value:w,onChange:E=>C(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),v(!1))}}):m.jsx("span",{className:"session-title",children:d}),m.jsx("span",{className:"session-time",children:CL(e.updatedAt)}),m.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(R=>!R)},children:m.jsx(VA,{size:14})}),c&&m.jsxs("div",{className:"option-menu drop-down session-menu",children:[m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),S()},children:m.jsx("span",{children:"Rename"})}),m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:m.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),m.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:m.jsx("span",{children:"Delete"})})]})]})}function ML({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,children:d}){var On,yi,ni;const[_,v]=q.useState([]),[w,C]=q.useState(null),[b,S]=q.useState("active"),[x,y]=q.useState(""),[E,R]=q.useState([]),[N,D]=q.useReducer(xL,{messagesBySession:{},busySessions:new Set}),[T,j]=q.useState([]),[B,F]=q.useState(bL),[Y,H]=q.useState({}),z=q.useRef(new Set),V=q.useRef(new Set),G=q.useRef(null),X=q.useRef(null),K=q.useRef(!0),L=q.useRef(null),[M,O]=q.useState([]),[$,U]=q.useState(0),[Q,re]=q.useState(!1);q.useEffect(()=>{vT().then(O).catch(()=>{})},[]);const ae=x.startsWith("/")&&!/\s/.test(x)?x.slice(1):null,Z=ae!==null&&!Q?M.filter(oe=>oe.name.startsWith(ae.toLowerCase())):[],P=Z.length>0,ee=Math.min($,Math.max(0,Z.length-1));q.useEffect(()=>U(0),[ae]);function ne(oe){var we;y(`/${oe.name} `),(we=L.current)==null||we.focus()}function ge(oe){for(const we of oe){if(!/^image\/(png|jpeg|gif|webp)$/.test(we.type))continue;const Ne=new FileReader;Ne.onload=()=>{const qe=Ne.result;R(at=>[...at,{dataUrl:qe,mediaType:we.type}])},Ne.readAsDataURL(we)}}function he(oe){const we=Array.from(oe.clipboardData.items).filter(Ne=>Ne.kind==="file"&&Ne.type.startsWith("image/")).map(Ne=>Ne.getAsFile()).filter(Ne=>Ne!==null);we.length>0&&(oe.preventDefault(),ge(we))}const ye=_.find(oe=>oe.id===w),be=ye?{harness:ye.harness,model:Y.model??ye.model,permissionMode:Y.permissionMode??ye.permissionMode,reasoningLevel:Y.reasoningLevel??ye.reasoningLevel}:B??G1(T),ke=be?T.find(oe=>oe.id===be.harness):void 0,Ee=ke==null?void 0:ke.options,Ce=oe=>{ye?H({model:oe.model,permissionMode:oe.permissionMode,reasoningLevel:oe.reasoningLevel}):(F(oe),localStorage.setItem(Tw,JSON.stringify(oe)))},rt=oe=>{be&&Ce({...be,permissionMode:oe})},bt=oe=>{be&&Ce({...be,reasoningLevel:oe})};q.useEffect(()=>{v([]),C(null),y(""),R([]),D({type:"reset"}),z.current=new Set,zy(e).then(oe=>{v(oe),C(we=>{var Ne;return we??((Ne=oe.find(qe=>!qe.archived))==null?void 0:Ne.id)??null}),D({type:"seedBusy",sessions:oe.filter(we=>we.busy).map(we=>we.id)})}).catch(()=>{})},[e]),q.useEffect(()=>{!w||z.current.has(w)||(z.current.add(w),Hy(w).then(oe=>D({type:"seed",sessionId:w,messages:oe})).catch(()=>z.current.delete(w)))},[w]),q.useEffect(()=>TT(oe=>{switch(oe.type){case"session":if(oe.session.projectId!==e||V.current.has(oe.session.id))return;v(we=>{const Ne=we.findIndex(at=>at.id===oe.session.id);if(Ne<0)return[oe.session,...we];const qe=we.slice();return qe[Ne]=oe.session,qe});break;case"sessionDeleted":Et(oe.sessionId);break;case"message":D({type:"upsertMessage",sessionId:oe.sessionId,message:oe.message});break;case"busy":D({type:"busy",sessionId:oe.sessionId,busy:oe.busy});break}}),[e]);const Ge=w?N.messagesBySession[w]??[]:[],ct=w?N.busySessions.has(w):!1,Pt=oe=>N.busySessions.has(oe)&&(N.messagesBySession[oe]??[]).some(we=>we.parts.some(Ne=>Ne.type==="prompt"&&Ne.prompt&&!Ne.prompt.resolved&&Ne.prompt.nativeId)),ht=w?Pt(w):!1,Fe=ye,fe=q.useMemo(()=>{var oe;for(let we=Ge.length-1;we>=0;we--)for(const Ne of Ge[we].parts)if(Ne.type==="prompt"&&((oe=Ne.prompt)==null?void 0:oe.kind)==="plan"&&!Ne.prompt.resolved)return{promptId:Ne.id,plan:Ne.prompt.plan??"",synthesized:!!Ne.prompt.synthesized};return null},[Ge]),ie=q.useMemo(()=>{if(!w||(Fe==null?void 0:Fe.harness)!=="claude-code")return null;for(let oe=Ge.length-1;oe>=0;oe--)for(const we of Ge[oe].parts)if(!(we.type!=="prompt"||!we.prompt||we.prompt.resolved)&&we.prompt.kind==="question")return we.prompt.nativeId&&!N.busySessions.has(w)?null:we.id;return null},[Ge,Fe==null?void 0:Fe.harness,w,N.busySessions]),[de,Se]=q.useState(null),Ae=de&&de.sessionId===w?de:null;q.useEffect(()=>{if(!de)return;const oe=N.busySessions.has(de.sessionId),we=de.sessionId===w&&fe&&fe.promptId!==de.promptId;(!oe||we)&&Se(null)},[de,fe,N.busySessions,w]);const De=p&&w?(oe,we)=>p(oe,w,we):void 0;q.useEffect(()=>H({}),[w]);const Ve=l==="chat"&&(Ge.length>0||ct);q.useLayoutEffect(()=>{K.current=!0;const oe=G.current;oe&&(oe.scrollTop=oe.scrollHeight)},[w,Ve]),q.useLayoutEffect(()=>{const oe=G.current;oe&&K.current&&(oe.scrollTop=oe.scrollHeight)},[Ge,ct]),q.useEffect(()=>{const oe=G.current,we=X.current;if(!oe||!we)return;const Ne=new ResizeObserver(()=>{K.current&&(oe.scrollTop=oe.scrollHeight)});return Ne.observe(we),Ne.observe(oe),()=>Ne.disconnect()},[Ve]);async function Ie(){const oe=x.trim(),we=E;if(!oe&&we.length===0)return;if(oe&&ie&&we.length===0){y(""),Ut({promptId:ie,answers:[],note:oe}).then(at=>{at||y(bi=>bi||oe)});return}if(ct)return;const Ne=be;if(!Ne&&!w)return;y(""),R([]);let qe=w;try{if(!qe){const nn=await yT(e,Ne.harness,{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel});z.current.add(nn.id),v(gs=>[nn,...gs]),C(nn.id),qe=nn.id}D({type:"optimisticUser",sessionId:qe,text:oe,imageUrls:we.map(nn=>nn.dataUrl)}),D({type:"busy",sessionId:qe,busy:!0}),K.current=!0,b==="archived"&&S("active");const at=Ne?{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel}:{};H({});const bi=we.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await CT(qe,oe,at,bi.length?bi:void 0)}catch{qe&&D({type:"busy",sessionId:qe,busy:!1})}}function Nt(){w&&ET(w)}q.useEffect(()=>{if(!ct||l!=="chat")return;function oe(we){var Ne;we.key!=="Escape"||we.defaultPrevented||(we.preventDefault(),Nt(),(Ne=L.current)==null||Ne.focus())}return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[ct,w,l]);function Et(oe){V.current.add(oe),v(we=>we.filter(Ne=>Ne.id!==oe)),C(we=>we===oe?null:we),z.current.delete(oe),D({type:"forget",sessionId:oe})}function qt(oe,we){const Ne=oe.archived;v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:we}:at)),ST(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:Ne}:at))})}function st(oe,we){const Ne=oe.title;v(qe=>qe.map(at=>at.id===oe.id?{...at,title:we}:at)),xT(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,title:Ne}:at))})}async function Ln(oe){var Ne;const we=((Ne=oe.title)==null?void 0:Ne.trim())||"Untitled";if(window.confirm(`Delete "${we}"? + +Its transcript is permanently removed.`)){try{await bT(oe.id)}catch(qe){window.alert(`Failed to delete "${we}": ${qe instanceof Error?qe.message:String(qe)}`);return}Et(oe.id)}}function Ut(oe){if(!w)return Promise.resolve(!1);const we=w;return D({type:"busy",sessionId:we,busy:!0}),kT(we,oe).then(()=>!0).catch(()=>!1).finally(()=>{Hy(we).then(Ne=>D({type:"seed",sessionId:we,messages:Ne})).catch(()=>{}),zy(e).then(Ne=>{var qe;return D({type:"busy",sessionId:we,busy:!!((qe=Ne.find(at=>at.id===we))!=null&&qe.busy)})}).catch(()=>{})})}const ps=_.filter(oe=>b==="all"?!0:b==="archived"?oe.archived:!oe.archived),mi=m.jsxs("aside",{className:"session-rail floating-panel",children:[n,m.jsxs("nav",{className:"rail-nav",children:[m.jsxs("button",{className:"rail-nav-item",onClick:()=>{C(null),u("chat")},children:[m.jsx(bg,{size:15}),"New session"]}),m.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,onClick:()=>u("files"),children:[m.jsx(qS,{size:15}),"Files"]}),mL.map(oe=>m.jsxs("button",{className:`rail-nav-item ${l===oe.id?"active":""}`,onClick:()=>u(oe.id),children:[oe.icon,oe.label]},oe.id))]}),m.jsxs("div",{className:"rail-body",children:[m.jsxs("div",{className:"rail-section-head",children:[m.jsx("div",{className:"rail-section-label",children:((On=Mw.find(oe=>oe.id===b))==null?void 0:On.railLabel)??"Recents"}),m.jsx(RL,{value:b,onChange:S})]}),ps.map(oe=>m.jsx(DL,{session:oe,active:oe.id===w&&l==="chat",busy:N.busySessions.has(oe.id),waiting:Pt(oe.id),onOpen:()=>{C(oe.id),u("chat")},onRename:we=>st(oe,we),onSetArchived:we=>qt(oe,we),onDelete:()=>void Ln(oe)},oe.id)),ps.length===0&&m.jsx("div",{className:"rail-empty",children:b==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),_i=`chat-header${r?"":" rail-hidden"}`,vi=!r&&m.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:m.jsx(YS,{size:15})});return l!=="chat"?m.jsxs(m.Fragment,{children:[r&&mi,m.jsxs("section",{className:"chat-pane",children:[!r&&m.jsx("div",{className:_i,children:vi}),m.jsx("div",{className:"settings-view-scroll",children:d})]})]}):m.jsxs(m.Fragment,{children:[r&&mi,m.jsxs("section",{className:"chat-pane",children:[m.jsxs("div",{className:_i,children:[vi,m.jsx("div",{className:"title",title:Fe?((yi=Fe.title)==null?void 0:yi.trim())||"Untitled":"New session",children:Fe?((ni=Fe.title)==null?void 0:ni.trim())||"Untitled":"New session"}),m.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:m.jsx(eN,{size:15})})]}),Ve?m.jsx("div",{className:"chat-thread",ref:G,onScroll:oe=>{const we=oe.currentTarget;K.current=we.scrollHeight-we.scrollTop-we.clientHeight<60},children:m.jsxs("div",{className:"chat-thread-inner",ref:X,children:[Ge.filter(NL).map(oe=>m.jsx(TL,{message:oe,onOpenFile:f&&(we=>f(we,w??void 0)),onRespond:Ut,onOpenPlan:De},oe.id)),ct&&(ht?m.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):m.jsxs("div",{className:"working",children:[m.jsx("span",{className:"spinner"})," Working…"]}))]})}):m.jsxs("div",{className:"chat-empty",children:[m.jsxs("h2",{children:["Open",m.jsx("span",{children:"Research"})]}),m.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),m.jsx(wL,{harnesses:T,selection:B??G1(T)}),t&&m.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var oe;y(`/reproduce-paper ${t} on `),(oe=L.current)==null||oe.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),m.jsxs("div",{className:"composer",children:[fe&&!(Ae&&fe.promptId===Ae.promptId)&&m.jsx(Dj,{synthesized:fe.synthesized,onView:()=>De==null?void 0:De(fe.plan,fe.promptId),onApprove:oe=>Ut({promptId:fe.promptId,approve:!0,resumeMode:oe}),onReject:()=>Ut({promptId:fe.promptId,approve:!1}),onRevise:oe=>{w&&Se({sessionId:w,promptId:fe.promptId}),Ut({promptId:fe.promptId,approve:!1,note:oe})}}),m.jsxs("div",{className:"composer-box",children:[P&&m.jsx(vL,{skills:Z,activeIndex:ee,onPick:ne,onHover:U}),E.length>0&&m.jsx("div",{className:"composer-attachments",children:E.map((oe,we)=>m.jsxs("div",{className:"attachment-thumb",children:[m.jsx("img",{src:oe.dataUrl,alt:"pasted"}),m.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>R(Ne=>Ne.filter((qe,at)=>at!==we)),children:m.jsx(Fo,{size:11})})]},we))}),m.jsx("textarea",{ref:L,value:x,placeholder:ie?"Type a custom answer…":be?`Message ${Nw[be.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:he,onDragOver:oe=>{oe.dataTransfer.types.includes("Files")&&oe.preventDefault()},onDrop:oe=>{oe.dataTransfer.files.length!==0&&(oe.preventDefault(),ge(Array.from(oe.dataTransfer.files)))},onChange:oe=>{y(oe.target.value),re(!1)},onKeyDown:oe=>{if(P){if(oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const we=oe.key==="ArrowDown"?1:-1;U((ee+we+Z.length)%Z.length);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault(),ne(Z[ee]);return}if(oe.key==="Escape"){oe.preventDefault(),re(!0);return}}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),Ie())}}),m.jsxs("div",{className:"composer-actions",children:[m.jsx(q1,{choices:(Ee==null?void 0:Ee.permissionModes)??[],value:(be==null?void 0:be.permissionMode)??null,defaultId:(Ee==null?void 0:Ee.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:rt}),m.jsx("div",{style:{flex:1}}),m.jsx(yL,{value:be,onSelect:Ce,onHarnesses:j,lockHarness:!!ye}),m.jsx(q1,{choices:(Ee==null?void 0:Ee.reasoningLevels)??[],value:(be==null?void 0:be.reasoningLevel)??null,defaultId:(Ee==null?void 0:Ee.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:bt}),ct&&!ie?m.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:Nt,children:m.jsx(Fo,{size:16})}):m.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void Ie(),disabled:!x.trim()&&E.length===0,children:m.jsx(US,{size:16})})]})]})]})]})]})}function Y1(){return{dirs:new Map,files:[]}}function jL(e){const t=Y1();for(const n of e){const r=n.split("/");let a=t;for(let l=0;l<r.length-1;l++){const u=r[l];let o=a.dirs.get(u);o||(o=Y1(),a.dirs.set(u,o)),a=o}a.files.push(r[r.length-1])}return t}function LL({name:e,node:t,path:n,depth:r,toggled:a,onToggle:l,onOpenFile:u}){const o=r===0,c=a.has(n)?!o:o;return m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+r*14},onClick:()=>l(n),title:n,children:[c?m.jsx(cs,{size:13,className:"code-tree-chev"}):m.jsx(Uu,{size:13,className:"code-tree-chev"}),c?m.jsx(qS,{size:13}):m.jsx(rN,{size:13}),m.jsx("span",{className:"code-tree-name",children:e})]}),c&&m.jsx(jw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function jw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return m.jsxs(m.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return m.jsx(LL,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[m.jsx(QA,{size:13}),m.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function OL({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=q.useState(null),[p,d]=q.useState(null),[_,v]=q.useState(!0),w=q.useRef(0),C=q.useCallback(()=>{const E=++w.current;v(!0),GN(e,r?{ref:r}:{}).then(R=>{E===w.current&&(f(R),d(null))}).catch(R=>{E===w.current&&d(R.message)}).finally(()=>{E===w.current&&v(!1)})},[e,r]);q.useEffect(()=>(f(null),d(null),C(),()=>{w.current++}),[C]);const b=q.useMemo(()=>c?jL(c.entries):null,[c]),S=q.useCallback(E=>{const R=new Set(a);R.has(E)?R.delete(E):R.add(E),u(R)},[a,u]),x=q.useMemo(()=>{const E=new Set,R=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),R.push({branch:N.branchName,label:N.slug}));return R},[n]),y=r||(c==null?void 0:c.branch)||null;return m.jsxs("div",{className:"code-tab",children:[m.jsxs("div",{className:"code-tab-header",children:[m.jsx("span",{className:"ctl-label",children:"Source"}),m.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[m.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&m.jsx("option",{value:r,children:r}),x.map(E=>m.jsx("option",{value:E.branch,children:E.label},E.branch))]}),y&&m.jsx("a",{className:"icon-btn",href:xg(t.githubOwner,t.githubRepo,y),target:"_blank",rel:"noopener noreferrer",title:`Open ${y} on GitHub`,children:m.jsx(pm,{size:13})}),m.jsx("span",{style:{flex:1}}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:C,children:_?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),(c==null?void 0:c.truncated)&&m.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&b&&m.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),m.jsx("div",{className:"code-tab-body",children:b?b.dirs.size===0&&b.files.length===0?m.jsx("div",{className:"code-tab-note",children:"No files."}):m.jsx("div",{className:"code-tree",children:m.jsx(jw,{node:b,parentPath:"",depth:0,toggled:a,onToggle:S,onOpenFile:E=>o(E,void 0,r||void 0)})}):m.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}const BL="project";function IL(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function zL(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` +---`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const HL=/\.(png|jpe?g|gif|webp|svg)$/i;function Yp(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Yp(n.children??[],t);if(r)return r}}return null}function FL({projectId:e,folder:t,markdown:n}){const r=a=>IL(a)?a:Np(e,`${t}/${a.replace(/^\.?\//,"")}`);return m.jsx("div",{className:"md report-md",children:m.jsx($x,{remarkPlugins:[dw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return m.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return m.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[m.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&m.jsx("span",{className:"report-img-caption",children:l})]})},...ww},children:zL(n)})})}function PL({projectId:e,entry:t,onBack:n,onDelete:r}){const[a,l]=q.useState(null),[u,o]=q.useState(null);return q.useEffect(()=>{uT(e,t.path).then(c=>l(c.markdown)).catch(c=>o(c instanceof Error?c.message:String(c)))},[e,t.path,t.modifiedAt]),m.jsx("div",{className:"report-view",children:m.jsxs("div",{className:"report-view-col",children:[m.jsxs("div",{className:"report-view-head",children:[m.jsxs("button",{className:"report-back",onClick:n,children:[m.jsx(jo,{size:13})," Files"]}),m.jsx("span",{style:{flex:1}}),m.jsx("span",{className:"report-date",children:new Date(t.modifiedAt).toLocaleString()}),m.jsx("button",{className:"icon-btn",title:"Delete report folder","aria-label":"Delete report folder",onClick:()=>{window.confirm(`Delete the "${t.path}" folder from the files dir?`)&&r()},children:m.jsx(Gu,{size:14})})]}),u?m.jsx("div",{className:"error",children:u}):a===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading report…"]}):m.jsx(FL,{projectId:e,folder:t.path,markdown:a})]})})}function UL({dir:e}){const[t,n]=q.useState(!1);return m.jsxs("div",{className:"files-pill files-pill-dir",title:e,children:[m.jsx("code",{children:e}),m.jsx("button",{className:"icon-btn",title:"Copy path","aria-label":"Copy files directory path",onClick:()=>{var r;(r=navigator.clipboard)==null||r.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},children:t?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})})]})}function Lw({projectId:e,entries:t,depth:n,expanded:r,onToggle:a,onOpenReport:l,onDelete:u}){return m.jsx(m.Fragment,{children:t.map(o=>{var p;const c={paddingLeft:14+n*22},f=m.jsx("button",{className:"icon-btn ftree-del",title:`Delete ${o.path}`,"aria-label":`Delete ${o.path}`,onClick:d=>{d.stopPropagation(),window.confirm(`Delete "${o.path}" from the files dir?`)&&u(o.path)},children:m.jsx(Gu,{size:13})});if(o.isDir){const d=o.reportTitle!==void 0,_=r.has(o.path),v=n===0?o.experiment:void 0,w=d&&n>0,C=v?[v.title,v.branchName].filter(Boolean).join(" — "):d&&!w?o.reportTitle:void 0;return m.jsxs("div",{children:[m.jsxs("div",{className:"ftree-row clickable",style:c,title:C,onClick:()=>d?l(o.path):a(o.path),children:[m.jsx("button",{className:`ftree-chevron ${_?"open":""}`,"aria-label":_?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:b=>{b.stopPropagation(),a(o.path)},children:m.jsx(Uu,{size:13})}),w?m.jsx("span",{className:"ftree-title",children:o.reportTitle}):m.jsxs("span",{className:"ftree-dirname",children:[o.name,"/"]}),d&&m.jsx("span",{className:"ftree-tag",children:"report"}),(v==null?void 0:v.latestRunStatus)&&m.jsx("span",{className:"ftree-status",children:v.latestRunStatus}),f,m.jsx("span",{className:"ftree-date",children:new Date(o.modifiedAt).toLocaleDateString()})]}),_&&(((p=o.children)==null?void 0:p.length)??0)>0&&m.jsx("div",{className:"ftree-children",children:m.jsx(Lw,{projectId:e,entries:o.children??[],depth:n+1,expanded:r,onToggle:a,onOpenReport:l,onDelete:u})})]},o.path)}return m.jsxs("div",{className:"ftree-row",style:c,children:[m.jsx("span",{className:"ftree-chevron spacer"}),m.jsxs("a",{className:"ftree-link",href:Np(e,o.path),target:"_blank",rel:"noopener noreferrer",title:o.path,children:[HL.test(o.name)&&m.jsx("img",{className:"ftree-thumb",src:Np(e,o.path),alt:"",loading:"lazy"}),m.jsx("span",{className:"ftree-name",children:o.name})]}),f,m.jsx("span",{className:"ftree-size",children:ns(o.size)})]},o.path)})})}function $L(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===BL?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function GL({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=q.useState(null),[u,o]=q.useState(new Set),c=a&&t?Yp(t.entries,a):null;q.useEffect(()=>{var b;a&&t&&!((b=Yp(t.entries,a))!=null&&b.reportTitle)&&l(null)},[a,t]);const f=b=>o(S=>{const x=new Set(S);return x.has(b)?x.delete(b):x.add(b),x}),p=b=>{hT(e.id,b).catch(()=>{}).finally(n)};if(c!=null&&c.reportTitle)return m.jsx(PL,{projectId:e.id,entry:c,onBack:()=>l(null),onDelete:()=>{p(c.path),l(null)}});if(!t)return m.jsx("div",{className:"files-tab",children:m.jsx("div",{className:"files-col",children:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading files…"]})})});const{project:d,experiments:_,other:v}=$L(t.entries),w=b=>m.jsx(Lw,{projectId:e.id,entries:b,depth:0,expanded:u,onToggle:f,onOpenReport:l,onDelete:p}),C=`https://github.com/${e.githubOwner}/${e.githubRepo}`;return m.jsx("div",{className:"files-tab",children:m.jsxs("div",{className:"files-col",children:[m.jsxs("div",{className:"files-meta",children:[m.jsxs("a",{className:"files-pill",href:C,target:"_blank",rel:"noopener noreferrer",children:[m.jsxs("code",{children:[e.githubOwner,"/",e.githubRepo]}),m.jsx($S,{size:12})]}),m.jsx(UL,{dir:t.dir}),m.jsx("button",{type:"button",className:"files-pill files-pill-link",onClick:r,children:"Change storage location →"})]}),m.jsxs("p",{className:"files-hint",children:["An explorer over this folder — the agent writes each experiment's reports and figures into the folder named for its slug (project-wide reports under ",m.jsx("code",{children:"project/"}),"), and you can drop in your own files."]}),t.entries.length===0?m.jsxs("p",{className:"files-empty",children:["Nothing here yet. Ask the agent for a write-up of its findings — it saves each experiment's report folder (",m.jsx("code",{children:"report.md"})," + images) into the folder above."]}):m.jsxs("div",{className:"files-card",children:[w(d),w(_),v.length>0&&(_.length>0||d.length>0)&&m.jsx("div",{className:"ftree-divider",children:"Not linked to an experiment"}),w(v),t.truncated&&m.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]})]})})}function Gc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return m.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,m.jsx("span",{className:"tab-label",children:t}),m.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:m.jsx(Fo,{size:12})})]})}function qL({owner:e,repo:t,branch:n}){return m.jsxs("a",{className:"files-pill",href:xg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[m.jsx("code",{children:n}),m.jsx(pm,{size:12})]})}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach((function(r){Wp(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Wp(e,t,n){return(t=(function(r){var a=(function(l,u){if(typeof l!="object"||l===null)return l;var o=l[Symbol.toPrimitive];if(o!==void 0){var c=o.call(l,u);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(l)})(r,"string");return typeof a=="symbol"?a:String(a)})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(e,t){if(e==null)return{};var n,r,a=(function(u,o){if(u==null)return{};var c,f,p={},d=Object.keys(u);for(f=0;f<d.length;f++)c=d[f],o.indexOf(c)>=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Je(e,t){return Bw(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(_){d=!0,u=_}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||nh(e,t)||zw()}function Ow(e){return Bw(e)||Iw(e)||nh(e)||zw()}function Rn(e){return(function(t){if(Array.isArray(t))return Xp(t)})(e)||Iw(e)||nh(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Bw(e){if(Array.isArray(e))return e}function Iw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nh(e,t){if(e){if(typeof e=="string")return Xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xp(e,t):void 0}}function Xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gm(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=nh(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return u=c.done,c},e:function(c){o=!0,l=c},f:function(){try{u||n.return==null||n.return()}finally{if(o)throw l}}}}var qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(e,t){return e(t={exports:{}},t.exports),t.exports}var Nn=fl((function(e){/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var l=arguments[a];if(l){var u=typeof l;if(u==="string"||u==="number")r.push(l);else if(Array.isArray(l)){if(l.length){var o=n.apply(null,l);o&&r.push(o)}}else if(u==="object"){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){r.push(l.toString());continue}for(var c in l)t.call(l,c)&&l[c]&&r.push(c)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),gn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Hw=q.createContext(gn),VL=Hw.Provider,YL=function(){return q.useContext(Hw)},WL=fl((function(e,t){(function(n){function r(l){var u=l.slice(11),o=null,c=null;switch(u.indexOf('"')){case-1:o=(d=u.split(" "))[0].slice(2),c=d[1].slice(2);break;case 0:var f=u.indexOf('"',2);o=u.slice(3,f);var p=u.indexOf('"',f+1);c=p<0?u.slice(f+4):u.slice(p+3,-1);break;default:var d;o=(d=u.split(" "))[0].slice(2),c=d[1].slice(3,-1)}return{oldPath:o,newPath:c}}var a={parse:function(l){for(var u,o,c,f,p,d=[],_=2,v=l.split(` +`),w=v.length,C=0;C<w;){var b=v[C];if(b.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(p=r(b)).oldPath,newPath:p.newPath},d.push(u);var S,x=null;e:for(;S=v[++C];){var y=S.indexOf(" "),E=y>-1?S.slice(0,y):E;switch(E){case"diff":C--;break e;case"deleted":case"new":var R=S.slice(y+1);R.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=R.slice(10));break;case"similarity":u.similarity=parseInt(S.split(" ")[2],10);break;case"index":var N=S.slice(y+1).split(" "),D=N[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=S.slice(y+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=S.slice(y+1),B=v[++C].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),_=5;break e}}u.type=x||"modify"}else if(b.indexOf("Binary")===0)u.isBinary=!0,u.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",_=2,u=null;else if(_===5)if(b.indexOf("@@")===0){var F=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);o={content:b,oldStart:F[1]-0,newStart:F[4]-0,oldLines:F[3]-0||1,newLines:F[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var Y=b.slice(0,1),H={content:b.slice(1)};switch(Y){case"+":H.type="insert",H.isInsert=!0,H.lineNumber=f,f++;break;case"-":H.type="delete",H.isDelete=!0,H.lineNumber=c,c++;break;case" ":H.type="normal",H.isNormal=!0,H.oldLineNumber=c,H.newLineNumber=f,c++,f++;break;case"\\":var z=o.changes[o.changes.length-1];z.isDelete||(u.newEndingNewLine=!1),z.isInsert||(u.oldEndingNewLine=!1)}H.type&&o.changes.push(H)}C++}return d}};e.exports=a})()}));function Tr(e){return e.type==="insert"}function Dn(e){return e.type==="delete"}function $i(e){return e.type==="normal"}function XL(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=Je(l,3),f=c[0],p=c[1],d=c[2];return p?Tr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Dn(u)&&Dn(p)?d:o]):(f.push(u),[f,u,Dn(u)?o:-1])}),[[],null,-1]);return Je(a,1)[0]})(e.changes):e.changes;return lt(lt({},e),{},{isPlain:!1,changes:n})}function KL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` +`),l=r.indexOf(` +`,a+1),u=r.slice(0,a),o=r.slice(a+1,l),c=u.split(" ").slice(1,-3).join(" "),f=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(f),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(f),r.slice(l+1)].join(` +`)})(e.trimStart());return WL.parse(n).map((function(r){return(function(a,l){var u=a.hunks.map((function(o){return XL(o,l)}));return lt(lt({},a),{},{hunks:u})})(r,t)}))}function ZL(e){return e[0]}function QL(e){return e[e.length-1]}function Kp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Yo(e){return e==="old"?function(t){return Tr(t)?-1:$i(t)?t.oldLineNumber:t.lineNumber}:function(t){return Dn(t)?-1:$i(t)?t.newLineNumber:t.lineNumber}}function Fw(e,t){return function(n,r){var a=n[e],l=a+n[t];return r>=a&&r<l}}function JL(e,t){return function(n,r,a){var l=n[e]+n[t],u=r[e];return a>=l&&a<u}}function Pw(e){var t=Yo(e),n=(function(r){var a=Je(Kp(r),2),l=Fw(a[0],a[1]);return function(u,o){return u.find((function(c){return l(c,o)}))}})(e);return function(r,a){var l=n(r,a);if(l)return l.changes.find((function(u){return t(u)===a}))}}function mm(e){var t=e==="old"?"new":"old",n=Je(Kp(e),2),r=n[0],a=n[1],l=Je(Kp(t),2),u=l[0],o=l[1],c=Yo(e),f=Yo(t),p=Fw(r,a),d=JL(r,a);return function(_,v){var w=ZL(_);if(v<w[r]){var C=w[r]-v;return w[u]-C}var b=QL(_);if(b[r]+b[a]<=v){var S=v-b[r]-b[a];return b[u]+b[o]+S}for(var x=0;x<_.length;x++){var y=_[x],E=_[x+1];if(p(y,v)){var R=y.changes.findIndex((function(F){return c(F)===v})),N=y.changes[R];if($i(N))return f(N);var D=Dn(N)?R+1:R-1,T=y.changes[D];if(!T)return-1;var j=Tr(N)?"delete":"insert";return T.type===j?f(T):-1}if(d(y,E,v)){var B=v-y[r]-y[a];return y[u]+y[o]+B}}throw new Error("Unexpected line position ".concat(v))}}var eO=function(e,t,n,r){for(var a=e.length,l=n+-1;++l<a;)if(t(e[l],l,e))return l;return-1},tO=function(){this.__data__=[],this.size=0},Uw=function(e,t){return e===t||e!=e&&t!=t},ih=function(e,t){for(var n=e.length;n--;)if(Uw(e[n][0],t))return n;return-1},nO=Array.prototype.splice,iO=function(e){var t=this.__data__,n=ih(t,e);return!(n<0)&&(n==t.length-1?t.pop():nO.call(t,n,1),--this.size,!0)},rO=function(e){var t=this.__data__,n=ih(t,e);return n<0?void 0:t[n][1]},sO=function(e){return ih(this.__data__,e)>-1},aO=function(e,t){var n=this.__data__,r=ih(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ia(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ia.prototype.clear=tO,ia.prototype.delete=iO,ia.prototype.get=rO,ia.prototype.has=sO,ia.prototype.set=aO;var rh=ia,oO=function(){this.__data__=new rh,this.size=0},lO=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},cO=function(e){return this.__data__.get(e)},uO=function(e){return this.__data__.has(e)},$w=typeof qc=="object"&&qc&&qc.Object===Object&&qc,hO=typeof self=="object"&&self&&self.Object===Object&&self,Vi=$w||hO||Function("return this")(),hi=Vi.Symbol,Gw=Object.prototype,fO=Gw.hasOwnProperty,dO=Gw.toString,No=hi?hi.toStringTag:void 0,pO=function(e){var t=fO.call(e,No),n=e[No];try{e[No]=void 0;var r=!0}catch{}var a=dO.call(e);return r&&(t?e[No]=n:delete e[No]),a},gO=Object.prototype.toString,mO=function(e){return gO.call(e)},X1=hi?hi.toStringTag:void 0,Ea=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":X1&&X1 in Object(e)?pO(e):mO(e)},Wo=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},qw=function(e){if(!Wo(e))return!1;var t=Ea(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},cp=Vi["__core-js_shared__"],K1=(function(){var e=/[^.]+$/.exec(cp&&cp.keys&&cp.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),_O=function(e){return!!K1&&K1 in e},vO=Function.prototype.toString,fs=function(e){if(e!=null){try{return vO.call(e)}catch{}try{return e+""}catch{}}return""},yO=/^\[object .+?Constructor\]$/,bO=Function.prototype,SO=Object.prototype,xO=bO.toString,wO=SO.hasOwnProperty,CO=RegExp("^"+xO.call(wO).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),EO=function(e){return!(!Wo(e)||_O(e))&&(qw(e)?CO:yO).test(fs(e))},kO=function(e,t){return e==null?void 0:e[t]},ds=function(e,t){var n=kO(e,t);return EO(n)?n:void 0},Xo=ds(Vi,"Map"),Ko=ds(Object,"create"),AO=function(){this.__data__=Ko?Ko(null):{},this.size=0},NO=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},TO=Object.prototype.hasOwnProperty,RO=function(e){var t=this.__data__;if(Ko){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return TO.call(t,e)?t[e]:void 0},DO=Object.prototype.hasOwnProperty,MO=function(e){var t=this.__data__;return Ko?t[e]!==void 0:DO.call(t,e)},jO=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ko&&t===void 0?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=AO,ra.prototype.delete=NO,ra.prototype.get=RO,ra.prototype.has=MO,ra.prototype.set=jO;var Z1=ra,LO=function(){this.size=0,this.__data__={hash:new Z1,map:new(Xo||rh),string:new Z1}},OO=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},sh=function(e,t){var n=e.__data__;return OO(t)?n[typeof t=="string"?"string":"hash"]:n.map},BO=function(e){var t=sh(this,e).delete(e);return this.size-=t?1:0,t},IO=function(e){return sh(this,e).get(e)},zO=function(e){return sh(this,e).has(e)},HO=function(e,t){var n=sh(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=LO,sa.prototype.delete=BO,sa.prototype.get=IO,sa.prototype.has=zO,sa.prototype.set=HO;var ah=sa,FO=function(e,t){var n=this.__data__;if(n instanceof rh){var r=n.__data__;if(!Xo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ah(r)}return n.set(e,t),this.size=n.size,this};function aa(e){var t=this.__data__=new rh(e);this.size=t.size}aa.prototype.clear=oO,aa.prototype.delete=lO,aa.prototype.get=cO,aa.prototype.has=uO,aa.prototype.set=FO;var fu=aa,PO=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},UO=function(e){return this.__data__.has(e)};function du(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ah;++t<n;)this.add(e[t])}du.prototype.add=du.prototype.push=PO,du.prototype.has=UO;var $O=du,GO=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},qO=function(e,t){return e.has(t)},Vw=function(e,t,n,r,a,l){var u=1&n,o=e.length,c=t.length;if(o!=c&&!(u&&c>o))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,_=!0,v=2&n?new $O:void 0;for(l.set(e,t),l.set(t,e);++d<o;){var w=e[d],C=t[d];if(r)var b=u?r(C,w,d,t,e,l):r(w,C,d,e,t,l);if(b!==void 0){if(b)continue;_=!1;break}if(v){if(!GO(t,(function(S,x){if(!qO(v,x)&&(w===S||a(w,S,n,r,l)))return v.push(x)}))){_=!1;break}}else if(w!==C&&!a(w,C,n,r,l)){_=!1;break}}return l.delete(e),l.delete(t),_},Q1=Vi.Uint8Array,VO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r,a){n[++t]=[a,r]})),n},YO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r){n[++t]=r})),n},J1=hi?hi.prototype:void 0,up=J1?J1.valueOf:void 0,WO=function(e,t,n,r,a,l,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new Q1(e),new Q1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Uw(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=VO;case"[object Set]":var c=1&r;if(o||(o=YO),e.size!=t.size&&!c)return!1;var f=u.get(e);if(f)return f==t;r|=2,u.set(e,t);var p=Vw(o(e),o(t),r,a,l,u);return u.delete(e),p;case"[object Symbol]":if(up)return up.call(e)==up.call(t)}return!1},Yw=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Mn=Array.isArray,XO=function(e,t,n){var r=t(e);return Mn(e)?r:Yw(r,n(e))},KO=function(e,t){for(var n=-1,r=e==null?0:e.length,a=0,l=[];++n<r;){var u=e[n];t(u,n,e)&&(l[a++]=u)}return l},ZO=function(){return[]},QO=Object.prototype.propertyIsEnumerable,eb=Object.getOwnPropertySymbols,JO=eb?function(e){return e==null?[]:(e=Object(e),KO(eb(e),(function(t){return QO.call(e,t)})))}:ZO,e6=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},da=function(e){return e!=null&&typeof e=="object"},tb=function(e){return da(e)&&Ea(e)=="[object Arguments]"},Ww=Object.prototype,t6=Ww.hasOwnProperty,n6=Ww.propertyIsEnumerable,oh=tb((function(){return arguments})())?tb:function(e){return da(e)&&t6.call(e,"callee")&&!n6.call(e,"callee")},i6=function(){return!1},Au=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?Vi.Buffer:void 0,l=(a?a.isBuffer:void 0)||i6;e.exports=l})),r6=/^(?:0|[1-9]\d*)$/,Xw=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&r6.test(e))&&e>-1&&e%1==0&&e<t},_m=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},wt={};wt["[object Float32Array]"]=wt["[object Float64Array]"]=wt["[object Int8Array]"]=wt["[object Int16Array]"]=wt["[object Int32Array]"]=wt["[object Uint8Array]"]=wt["[object Uint8ClampedArray]"]=wt["[object Uint16Array]"]=wt["[object Uint32Array]"]=!0,wt["[object Arguments]"]=wt["[object Array]"]=wt["[object ArrayBuffer]"]=wt["[object Boolean]"]=wt["[object DataView]"]=wt["[object Date]"]=wt["[object Error]"]=wt["[object Function]"]=wt["[object Map]"]=wt["[object Number]"]=wt["[object Object]"]=wt["[object RegExp]"]=wt["[object Set]"]=wt["[object String]"]=wt["[object WeakMap]"]=!1;var s6=function(e){return da(e)&&_m(e.length)&&!!wt[Ea(e)]},a6=function(e){return function(t){return e(t)}},nb=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&$w.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),ib=nb&&nb.isTypedArray,vm=ib?a6(ib):s6,o6=Object.prototype.hasOwnProperty,l6=function(e,t){var n=Mn(e),r=!n&&oh(e),a=!n&&!r&&Au(e),l=!n&&!r&&!a&&vm(e),u=n||r||a||l,o=u?e6(e.length,String):[],c=o.length;for(var f in e)!o6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Xw(f,c))||o.push(f);return o},c6=Object.prototype,Kw=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||c6)},u6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),h6=Object.prototype.hasOwnProperty,Zw=function(e){if(!Kw(e))return u6(e);var t=[];for(var n in Object(e))h6.call(e,n)&&n!="constructor"&&t.push(n);return t},lh=function(e){return e!=null&&_m(e.length)&&!qw(e)},ym=function(e){return lh(e)?l6(e):Zw(e)},rb=function(e){return XO(e,ym,JO)},f6=Object.prototype.hasOwnProperty,d6=function(e,t,n,r,a,l){var u=1&n,o=rb(e),c=o.length;if(c!=rb(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:f6.call(t,p)))return!1}var d=l.get(e),_=l.get(t);if(d&&_)return d==t&&_==e;var v=!0;l.set(e,t),l.set(t,e);for(var w=u;++f<c;){var C=e[p=o[f]],b=t[p];if(r)var S=u?r(b,C,p,t,e,l):r(C,b,p,e,t,l);if(!(S===void 0?C===b||a(C,b,n,r,l):S)){v=!1;break}w||(w=p=="constructor")}if(v&&!w){var x=e.constructor,y=t.constructor;x==y||!("constructor"in e)||!("constructor"in t)||typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y||(v=!1)}return l.delete(e),l.delete(t),v},Zp=ds(Vi,"DataView"),Qp=ds(Vi,"Promise"),Jp=ds(Vi,"Set"),eg=ds(Vi,"WeakMap"),p6=fs(Zp),g6=fs(Xo),m6=fs(Qp),_6=fs(Jp),v6=fs(eg),Kr=Ea;(Zp&&Kr(new Zp(new ArrayBuffer(1)))!="[object DataView]"||Xo&&Kr(new Xo)!="[object Map]"||Qp&&Kr(Qp.resolve())!="[object Promise]"||Jp&&Kr(new Jp)!="[object Set]"||eg&&Kr(new eg)!="[object WeakMap]")&&(Kr=function(e){var t=Ea(e),n=t=="[object Object]"?e.constructor:void 0,r=n?fs(n):"";if(r)switch(r){case p6:return"[object DataView]";case g6:return"[object Map]";case m6:return"[object Promise]";case _6:return"[object Set]";case v6:return"[object WeakMap]"}return t});var tg=Kr,Vc="[object Object]",sb=Object.prototype.hasOwnProperty,y6=function(e,t,n,r,a,l){var u=Mn(e),o=Mn(t),c=u?"[object Array]":tg(e),f=o?"[object Array]":tg(t),p=(c=c=="[object Arguments]"?Vc:c)==Vc,d=(f=f=="[object Arguments]"?Vc:f)==Vc,_=c==f;if(_&&Au(e)){if(!Au(t))return!1;u=!0,p=!1}if(_&&!p)return l||(l=new fu),u||vm(e)?Vw(e,t,n,r,a,l):WO(e,t,c,n,r,a,l);if(!(1&n)){var v=p&&sb.call(e,"__wrapped__"),w=d&&sb.call(t,"__wrapped__");if(v||w){var C=v?e.value():e,b=w?t.value():t;return l||(l=new fu),a(C,b,n,r,l)}}return!!_&&(l||(l=new fu),d6(e,t,n,r,a,l))},ch=function e(t,n,r,a,l){return t===n||(t==null||n==null||!da(t)&&!da(n)?t!=t&&n!=n:y6(t,n,r,a,e,l))},b6=function(e,t,n,r){var a=n.length,l=a;if(e==null)return!l;for(e=Object(e);a--;){var u=n[a];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<l;){var o=(u=n[a])[0],c=e[o],f=u[1];if(u[2]){if(c===void 0&&!(o in e))return!1}else{var p=new fu,d;if(!(d===void 0?ch(f,c,3,r,p):d))return!1}}return!0},Qw=function(e){return e==e&&!Wo(e)},S6=function(e){for(var t=ym(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,Qw(a)]}return t},Jw=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},x6=function(e){var t=S6(e);return t.length==1&&t[0][2]?Jw(t[0][0],t[0][1]):function(n){return n===e||b6(n,e,t)}},uh=function(e){return typeof e=="symbol"||da(e)&&Ea(e)=="[object Symbol]"},w6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C6=/^\w*$/,bm=function(e,t){if(Mn(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!uh(e))||C6.test(e)||!w6.test(e)||t!=null&&e in Object(t)};function Sm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],l=n.cache;if(l.has(a))return l.get(a);var u=e.apply(this,r);return n.cache=l.set(a,u)||l,u};return n.cache=new(Sm.Cache||ah),n}Sm.Cache=ah;var E6=Sm,k6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A6=/\\(\\)?/g,N6=(function(e){var t=E6(e,(function(r){return n.size===500&&n.clear(),r})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(k6,(function(n,r,a,l){t.push(a?l.replace(A6,"$1"):r||n)})),t})),eC=function(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},ab=hi?hi.prototype:void 0,ob=ab?ab.toString:void 0,T6=function e(t){if(typeof t=="string")return t;if(Mn(t))return eC(t,e)+"";if(uh(t))return ob?ob.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},R6=function(e){return e==null?"":T6(e)},tC=function(e,t){return Mn(e)?e:bm(e,t)?[e]:N6(R6(e))},hh=function(e){if(typeof e=="string"||uh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},nC=function(e,t){for(var n=0,r=(t=tC(t,e)).length;e!=null&&n<r;)e=e[hh(t[n++])];return n&&n==r?e:void 0},D6=function(e,t,n){var r=e==null?void 0:nC(e,t);return r===void 0?n:r},M6=function(e,t){return e!=null&&t in Object(e)},j6=function(e,t,n){for(var r=-1,a=(t=tC(t,e)).length,l=!1;++r<a;){var u=hh(t[r]);if(!(l=e!=null&&n(e,u)))break;e=e[u]}return l||++r!=a?l:!!(a=e==null?0:e.length)&&_m(a)&&Xw(u,a)&&(Mn(e)||oh(e))},L6=function(e,t){return e!=null&&j6(e,t,M6)},O6=function(e,t){return bm(e)&&Qw(t)?Jw(hh(e),t):function(n){var r=D6(n,e);return r===void 0&&r===t?L6(n,e):ch(t,r,3)}},B6=function(e){return e},I6=function(e){return function(t){return t==null?void 0:t[e]}},z6=function(e){return function(t){return nC(t,e)}},H6=function(e){return bm(e)?I6(hh(e)):z6(e)},fh=function(e){return typeof e=="function"?e:e==null?B6:typeof e=="object"?Mn(e)?O6(e[0],e[1]):x6(e):H6(e)},F6=/\s/,P6=function(e){for(var t=e.length;t--&&F6.test(e.charAt(t)););return t},U6=/^\s+/,$6=function(e){return e&&e.slice(0,P6(e)+1).replace(U6,"")},G6=/^[-+]0x[0-9a-f]+$/i,q6=/^0b[01]+$/i,V6=/^0o[0-7]+$/i,Y6=parseInt,W6=function(e){if(typeof e=="number")return e;if(uh(e))return NaN;if(Wo(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Wo(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$6(e);var n=q6.test(e);return n||V6.test(e)?Y6(e.slice(2),n?2:8):G6.test(e)?NaN:+e},X6=function(e){return e?(e=W6(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},K6=function(e){var t=X6(e),n=t%1;return t==t?n?t-n:t:0};function kr(e){if(!e)throw new Error("change is not provided");if($i(e))return"N".concat(e.oldLineNumber);var t=Tr(e)?"I":"D";return"".concat(t).concat(e.lineNumber)}mm("old");var dh=Yo("old"),ph=Yo("new");Pw("old");Pw("new");mm("new");mm("old");var lb=(function(){try{var e=ds(Object,"defineProperty");return e({},"",{}),e}catch{}})(),xm=function(e,t,n){t=="__proto__"&&lb?lb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Z6=function(e){return function(t,n,r){for(var a=-1,l=Object(t),u=r(t),o=u.length;o--;){var c=u[++a];if(n(l[c],c,l)===!1)break}return t}},Q6=Z6(),iC=function(e,t){return e&&Q6(e,t,ym)},rC=function(e,t){var n={};return t=fh(t),iC(e,(function(r,a,l){xm(n,a,t(r,a,l))})),n},J6=["changeKey","text","tokens","renderToken"],cb=function e(t,n){var r=t.type,a=t.value,l=t.markType,u=t.properties,o=t.className,c=t.children,f=function(d){return m.jsx("span",{className:d,children:a||c&&c.map(e)},n)};switch(r){case"text":return a;case"mark":return f("diff-code-mark diff-code-mark-".concat(l));case"edit":return f("diff-code-edit");default:var p=u&&u.className;return f(Nn(o||p))}};function e8(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=Je(e,1)[0];return t.type==="text"&&!t.value}return!0}function t8(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Ar(e,J6),u=a?function(o,c){return a(o,cb,c)}:cb;return m.jsx("td",lt(lt({},l),{},{"data-change-key":t,children:r?e8(r)?" ":r.map(u):n||" "}))}var sC=q.memo(t8);function aC(e,t){return function(){var n=t==="old"?dh(e):ph(e);return n===-1?void 0:n}}function oC(e,t){return function(n){return e&&n?m.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Nu(e,t){return t?function(n){e(),t(n)}:e}function ub(e,t,n,r){return q.useMemo((function(){var a=rC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=Nu(n,a.onMouseEnter),a.onMouseLeave=Nu(r,a.onMouseLeave),a}),[e,n,r,t])}function hb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:aC(t,r),wrapInAnchor:oC(a,l)};return m.jsx("td",lt(lt({className:e},u),{},{"data-change-key":n,children:c(f)}))}function n8(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.gutterAnchor,C=e.generateAnchorID,b=e.renderToken,S=e.renderGutter,x=a.type,y=a.content,E=kr(a),R=(t=Je(q.useState(!1),2),n=t[0],r=t[1],[n,q.useCallback((function(){return r(!0)}),[]),q.useCallback((function(){return r(!1)}),[])]),N=Je(R,3),D=N[0],T=N[1],j=N[2],B=q.useMemo((function(){return{change:a}}),[a]),F=ub(d,B,T,j),Y=ub(_,B,T,j),H=C(a),z=c({changes:[a],defaultGenerate:function(){return o}}),V=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),G=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return m.jsxs("tr",{id:H,className:Nn("diff-line",z),children:[!v&&hb(V,a,E,"old",w,H,F,D,S),!v&&hb(V,a,E,"new",w,H,F,D,S),m.jsx(sC,lt({className:G,changeKey:E,text:y,tokens:u,renderToken:b},Y))]})}var i8=q.memo(n8);function r8(e){var t=e.hideGutter,n=e.element;return m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var s8=["hideGutter","selectedChanges","tokens","lineClassName"],a8=["hunk","widgets","className"];function o8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,a8),l=(function(u,o){return u.reduce((function(c,f){var p=kr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,3),p=f[0],d=f[1],_=f[2],v=c.hideGutter,w=c.selectedChanges,C=c.tokens,b=c.lineClassName,S=Ar(c,s8);if(p==="change"){var x=Dn(_)?"old":"new",y=Dn(_)?dh(_):ph(_),E=C?C[x][y-1]:null;return m.jsx(i8,lt({className:b,change:_,hideGutter:v,selected:w.includes(d),tokens:E},S),"change".concat(d))}return p==="widget"?m.jsx(r8,{hideGutter:v,element:_},"widget".concat(d)):null})(u,a)}))})}var lC=0;function Yc(e,t,n,r){var a=q.useCallback((function(){return t(e)}),[e,t]),l=q.useCallback((function(){return t("")}),[t]);return q.useMemo((function(){var u=rC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=Nu(a,u.onMouseEnter),u.onMouseLeave=Nu(l,u.onMouseLeave),u}),[n,r,a,e,l])}function hp(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,_=e.hideGutter,v=e.hover,w=e.renderToken,C=e.renderGutter;if(!t){var b=Nn("diff-gutter","diff-gutter-omit",l),S=Nn("diff-code","diff-code-omit",u);return[!_&&m.jsx("td",{className:b},"gutter"),m.jsx("td",{className:S},"code")]}var x=t.type,y=t.content,E=kr(t),R=n===lC?"old":"new",N=lt({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),Wp({"diff-gutter-selected":r},"diff-line-hover-"+R,v),l),children:C({change:t,side:R,inHoverState:v,renderDefault:aC(t,R),wrapInAnchor:oC(p,d)})},o),D=Nn("diff-code","diff-code-".concat(x),Wp({"diff-code-selected":r},"diff-line-hover-"+R,v),u);return[!_&&m.jsx("td",lt(lt({},N),{},{"data-change-key":E}),"gutter"),m.jsx(sC,lt({className:D,changeKey:E,text:y,tokens:a,renderToken:w},c),"code")]}function l8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.generateAnchorID,C=e.generateLineClassName,b=e.gutterAnchor,S=e.renderToken,x=e.renderGutter,y=Je(q.useState(""),2),E=y[0],R=y[1],N=Yc("old",R,n,d),D=Yc("new",R,r,d),T=Yc("old",R,n,_),j=Yc("new",R,r,_),B=n&&w(n),F=r&&w(r),Y=C({changes:[n,r],defaultGenerate:function(){return t}}),H={monotonous:c,hideGutter:v,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:_,renderToken:S,renderGutter:x},z=lt(lt({},H),{},{change:n,side:lC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:b,gutterAnchorTarget:B,hover:E==="old"}),V=lt(lt({},H),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:D,codeEvents:j,anchorID:n===r?null:F,gutterAnchor:b,gutterAnchorTarget:n===r?B:F,hover:E==="new"});if(c)return m.jsx("tr",{className:Nn("diff-line",Y),children:hp(n?z:V)});var G=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return m.jsxs("tr",{className:Nn("diff-line",G,Y),children:[hp(z),hp(V)]})}var c8=q.memo(l8);function u8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):m.jsxs("tr",{className:"diff-widget",children:[m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var h8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],f8=["hunk","widgets","className"];function Wc(e,t){return(e?kr(e):"00")+(t?kr(t):"00")}function d8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,f8),l=(function(u,o){for(var c=function(S){if(!S)return null;var x=kr(S);return o[x]||null},f=[],p=0;p<u.length;p++){var d=u[p];if($i(d))f.push(["change",Wc(d,d),d,d]);else if(Dn(d)){var _=u[p+1];_&&Tr(_)?(p+=1,f.push(["change",Wc(d,_),d,_])):f.push(["change",Wc(d,null),d,null])}else f.push(["change",Wc(null,d),null,d]);var v=f[f.length-1],w=c(v[2]),C=c(v[3]);if(w||C){var b=v[1];f.push(["widget",b,w,C])}}return f})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,4),p=f[0],d=f[1],_=f[2],v=f[3],w=c.selectedChanges,C=c.monotonous,b=c.hideGutter,S=c.tokens,x=c.lineClassName,y=Ar(c,h8);if(p==="change"){var E=!!_&&w.includes(kr(_)),R=!!v&&w.includes(kr(v)),N=_&&S?S.old[dh(_)-1]:null,D=v&&S?S.new[ph(v)-1]:null;return m.jsx(c8,lt({className:x,oldChange:_,newChange:v,monotonous:C,hideGutter:b,oldSelected:E,newSelected:R,oldTokens:N,newTokens:D},y),"change".concat(d))}return p==="widget"?m.jsx(u8,{monotonous:C,hideGutter:b,oldElement:_,newElement:v},"widget".concat(d)):null})(u,a)}))})}var p8=["gutterType","hunkClassName"];function g8(e){var t=e.hunk,n=YL(),r=n.gutterType,a=n.hunkClassName,l=Ar(n,p8),u=r==="none",o=r==="anchor",c=l.viewType==="unified"?o8:d8;return m.jsx(c,lt(lt({},l),{},{hunk:t,hideGutter:u,gutterAnchor:o,className:a}))}function m8(){}function fb(e,t){var n=t?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function _8(e){return e.map((function(t){return m.jsx(g8,{hunk:t},(function(n){return"-".concat(n.oldStart,",").concat(n.oldLines," +").concat(n.newStart,",").concat(n.newLines)})(t))}))}function v8(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,a=e.className,l=e.hunkClassName,u=l===void 0?gn.hunkClassName:l,o=e.lineClassName,c=o===void 0?gn.lineClassName:o,f=e.generateLineClassName,p=f===void 0?gn.generateLineClassName:f,d=e.gutterClassName,_=d===void 0?gn.gutterClassName:d,v=e.codeClassName,w=v===void 0?gn.codeClassName:v,C=e.gutterType,b=C===void 0?gn.gutterType:C,S=e.viewType,x=S===void 0?gn.viewType:S,y=e.gutterEvents,E=y===void 0?gn.gutterEvents:y,R=e.codeEvents,N=R===void 0?gn.codeEvents:R,D=e.generateAnchorID,T=D===void 0?gn.generateAnchorID:D,j=e.selectedChanges,B=j===void 0?gn.selectedChanges:j,F=e.widgets,Y=F===void 0?gn.widgets:F,H=e.renderGutter,z=H===void 0?gn.renderGutter:H,V=e.tokens,G=e.renderToken,X=e.children,K=X===void 0?_8:X,L=q.useRef(null),M=q.useCallback((function(ae){var Z=ae.target;if(ae.button===0){var P=(function(be,ke){for(var Ee=be;Ee&&Ee!==document.documentElement&&!Ee.classList.contains(ke);)Ee=Ee.parentElement;return Ee===document.documentElement?null:Ee})(Z,"diff-code");if(P&&P.parentElement){var ee=window.getSelection();ee&&ee.removeAllRanges();var ne=Rn(P.parentElement.children).indexOf(P);if(ne===1||ne===3){var ge,he=gm(L.current?L.current.querySelectorAll(".diff-line"):[]);try{for(he.s();!(ge=he.n()).done;){var ye=ge.value.children;fb(ye[1],ne===1),fb(ye[3],ne===3)}}catch(be){he.e(be)}finally{he.f()}}}}}),[]),O=b==="none",$=t==="add"||t==="delete",U=x==="split"&&!$&&r?M:m8,Q=q.useMemo((function(){return m.jsxs("colgroup",x==="unified"?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:$?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]})}),[x,$,O]),re=q.useMemo((function(){return{hunkClassName:u,lineClassName:c,generateLineClassName:p,gutterClassName:_,codeClassName:w,monotonous:$,hideGutter:O,viewType:x,gutterType:b,codeEvents:N,gutterEvents:E,generateAnchorID:T,selectedChanges:B,widgets:Y,renderGutter:z,tokens:V,renderToken:G}}),[w,N,T,_,E,b,O,u,c,p,$,z,G,B,V,x,Y]);return m.jsx(VL,{value:re,children:m.jsxs("table",{ref:L,className:Nn("diff","diff-".concat(x),a),onMouseDown:U,children:[Q,K(n)]})})}var y8=q.memo(v8),b8=function(e,t,n,r){for(var a=-1,l=e==null?0:e.length;++a<l;){var u=e[a];t(r,u,n(u),e)}return r},S8=function(e,t){return function(n,r){if(n==null)return n;if(!lh(n))return e(n,r);for(var a=n.length,l=-1,u=Object(n);++l<a&&r(u[l],l,u)!==!1;);return n}},cC=S8(iC),x8=function(e,t,n,r){return cC(e,(function(a,l,u){t(r,a,n(a),u)})),r},uC=function(e,t){return function(n,r){var a=Mn(n)?b8:x8,l=t?t():{};return a(n,e,fh(r),l)}},w8=uC((function(e,t,n){xm(e,n,t)})),db=hi?hi.isConcatSpreadable:void 0,C8=function(e){return Mn(e)||oh(e)||!!(db&&e&&e[db])},hC=function(t,n,r,a,l){var u=-1,o=t.length;for(r||(r=C8),l||(l=[]);++u<o;){var c=t[u];r(c)?Yw(l,c):l[l.length]=c}return l},E8=function(e,t){var n=-1,r=lh(e)?Array(e.length):[];return cC(e,(function(a,l,u){r[++n]=t(a,l,u)})),r},k8=function(e,t){return(Mn(e)?eC:E8)(e,fh(t))},wm=function(e,t){return hC(k8(e,t))};function A8(e,t){var n=t.newStart,r=t.changes.reduce((function(a,l){var u=Je(a,2),o=u[0],c=u[1];return Dn(l)?(o.splice(c,1),[o,c]):(Tr(l)&&o.splice(c,0,l.content),[o,c+1])}),[e,n-1]);return Je(r,1)[0]}function pb(e,t,n){if(!e.length)return[];var r=t==="old"?dh:ph,a=w8(e,r),l=r(e[e.length-1]);return Array.from({length:l}).map((function(u,o){return n(a[o+1])}))}function N8(e){var t=(function(u){return wm(u,(function(o){return o.changes})).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1];return $i(c)?(p.push(c),d.push(c)):Dn(c)?p.push(c):d.push(c),[p,d]}),[[],[]])})(e),n=Je(t,2),r=n[0],a=n[1],l=function(u){return u?u.content:""};return[pb(r,"old",l).join(` +`),pb(a,"new",l).join(` +`)]}function Xc(e){return{type:"root",children:e}}function T8(e,t){if(t.oldSource){var n=(function(c,f){return f.reduce(A8,c.split(` +`)).join(` +`)})(t.oldSource,e),r=t.highlight?function(c){return t.refractor.highlight(c,t.language)}:function(c){return[{type:"text",value:c}]};return[Xc(r(t.oldSource)),Xc(r(n))]}var a=Je(N8(e),2),l=a[0],u=a[1],o=t.highlight?function(c){return Xc(t.refractor.highlight(c,t.language))}:function(c){return Xc([{type:"text",value:c}])};return[o(l),o(u)]}function oa(e){return e.map((function(t){return lt({},t)}))}function R8(e,t){return[].concat(Rn(oa(e.slice(0,-1))),[t])}function D8(e){return e.type==="text"}function Cm(e){var t=e[e.length-1];if(D8(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function M8(e,t,n,r){var a=e.slice(0,-1),l=Cm(e),u=[];if(n<=0||t>=(l==null?void 0:l.value.length))return[e];var o=function(d,_){var v=l.value.slice(d,_);return[].concat(Rn(a),[lt(lt({},l),{},{value:v})])};if(t>0){var c=o(0,t);u.push(oa(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,_){return[_].concat(Rn(oa(d)))})(f,r):oa(f)),n<l.value.length){var p=o(n);u.push(oa(p))}return u}var j8=["children"];function fC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Ar(e,j8);n.push(a);var l,u=gm(r);try{for(u.s();!(l=u.n()).done;)fC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(oa([].concat(Rn(n.slice(1)),[e])));return t}function L8(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Cm(c);return f.value.includes(` +`)?f.value.split(` +`).map((function(p){return R8(c,lt(lt({},f),{},{value:p}))})):[c]})(n),l=Ow(a),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(r),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function gb(e){return L8(fC(e))}var O8=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?ch(e,t,void 0,n):!!r},B8=function(e,t){return ch(e,t)},I8=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function z8(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,a=I8(e.children);return a&&(r=t,(n=a).type===r.type&&(n.type==="text"||n.children&&r.children&&O8(n,r,(function(l,u,o){return o==="chlidren"||B8(l,u)}))))?e.children[e.children.length-1]=(function(l,u){return"value"in l&&"value"in u?lt(lt({},l),{},{value:"".concat(l.value).concat(u.value)}):l})(a,t):e.children.push(t),e.children[e.children.length-1]}function mb(e){var t,n={type:"root",children:[]},r=gm(e);try{var a=function(){var l=t.value;l.reduce((function(u,o,c){return z8(u,c===l.length-1?lt({},o):lt(lt({},o),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)a()}catch(l){r.e(l)}finally{r.f()}return n}var H8=Object.prototype.hasOwnProperty,F8=uC((function(e,t,n){H8.call(e,n)?e[n].push(t):xm(e,n,[t])})),P8=Object.prototype.hasOwnProperty,U8=function(e){if(e==null)return!0;if(lh(e)&&(Mn(e)||typeof e=="string"||typeof e.splice=="function"||Au(e)||vm(e)||oh(e)))return!e.length;var t=tg(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(Kw(e))return!Zw(e).length;for(var n in e)if(P8.call(e,n))return!1;return!0},$8=function(e,t){var n=t.start,r=t.length,a=n+r,l=e.reduce((function(u,o){var c=Je(u,2),f=c[0],p=c[1],d=p+Cm(o).value.length;if(p>a||d<n)f.push(o);else{var _=M8(o,n-p,a-p,t);f.push.apply(f,Rn(_))}return[f,d]}),[[],0]);return Je(l,1)[0]};function _b(e,t){var n=F8(t,"lineNumber");return e.map((function(r,a){return(function(l,u){return U8(u)?l:u.reduce($8,l)})(r,n[a+1])}))}function G8(e,t){return function(n){var r=Je(n,2),a=r[0],l=r[1];return[_b(a,e),_b(l,t)]}}var vb=function(e){return e!=null&&e.length?hC(e):[]},q8=Math.max,yb=function(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:K6(n);return a<0&&(a=q8(r+a,0)),eO(e,fh(t),a)},gh=fl((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(n,r){return[n,r]},t.prototype.diff_main=function(n,r,a,l){l===void 0&&(l=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=l;if(n==null||r==null)throw new Error("Null input. (diff_main)");if(n==r)return n?[new t.Diff(0,n)]:[];a===void 0&&(a=!0);var o=a,c=this.diff_commonPrefix(n,r),f=n.substring(0,c);n=n.substring(c),r=r.substring(c),c=this.diff_commonSuffix(n,r);var p=n.substring(n.length-c);n=n.substring(0,n.length-c),r=r.substring(0,r.length-c);var d=this.diff_compute_(n,r,o,u);return f&&d.unshift(new t.Diff(0,f)),p&&d.push(new t.Diff(0,p)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(n,r,a,l){var u;if(!n)return[new t.Diff(1,r)];if(!r)return[new t.Diff(-1,n)];var o=n.length>r.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],_=p[1],v=p[2],w=p[3],C=p[4],b=this.diff_main(d,v,a,l),S=this.diff_main(_,w,a,l);return b.concat([new t.Diff(0,C)],S)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",_="";c<o.length;){switch(o[c][0]){case 1:p++,_+=o[c][1];break;case-1:f++,d+=o[c][1];break;case 0:if(f>=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var v=this.diff_main(d,_,!1,a),w=v.length-1;w>=0;w--)o.splice(c,0,v[w]);c+=v.length}p=0,f=0,d="",_=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),_=0;_<f;_++)p[_]=-1,d[_]=-1;p[c+1]=0,d[c+1]=0;for(var v=l-u,w=v%2!=0,C=0,b=0,S=0,x=0,y=0;y<o&&!(new Date().getTime()>a);y++){for(var E=-y+C;E<=y-b;E+=2){for(var R=c+E,N=(F=E==-y||E!=y&&p[R-1]<p[R+1]?p[R+1]:p[R-1]+1)-E;F<l&&N<u&&n.charAt(F)==r.charAt(N);)F++,N++;if(p[R]=F,F>l)b+=2;else if(N>u)C+=2;else if(w&&(j=c+v-E)>=0&&j<f&&d[j]!=-1&&F>=(T=l-d[j]))return this.diff_bisectSplit_(n,r,F,N,a)}for(var D=-y+S;D<=y-x;D+=2){for(var T,j=c+D,B=(T=D==-y||D!=y&&d[j-1]<d[j+1]?d[j+1]:d[j-1]+1)-D;T<l&&B<u&&n.charAt(l-T-1)==r.charAt(u-B-1);)T++,B++;if(d[j]=T,T>l)x+=2;else if(B>u)S+=2;else if(!w&&(R=c+v-D)>=0&&R<f&&p[R]!=-1){var F;if(N=c+(F=p[R])-R,F>=(T=l-T))return this.diff_bisectSplit_(n,r,F,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),_=this.diff_main(f,p,!1,u);return d.concat(_)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,_=-1,v=a.length;_<f.length-1;){(_=f.indexOf(` +`,d))==-1&&(_=f.length-1);var w=f.substring(d,_+1);(l.hasOwnProperty?l.hasOwnProperty(w):l[w]!==void 0)?p+=String.fromCharCode(l[w]):(v==o&&(w=f.substring(d),_=f.length),p+=String.fromCharCode(v),l[w]=v,a[v++]=w),d=_+1}return p}a[0]="";var o=4e4,c=u(n);return o=65535,{chars1:c,chars2:u(r),lineArray:a}},t.prototype.diff_charsToLines_=function(n,r){for(var a=0;a<n.length;a++){for(var l=n[a][1],u=[],o=0;o<l.length;o++)u[o]=r[l.charCodeAt(o)];n[a][1]=u.join("")}},t.prototype.diff_commonPrefix=function(n,r){if(!n||!r||n.charAt(0)!=r.charAt(0))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(o,u)==r.substring(o,u)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonSuffix=function(n,r){if(!n||!r||n.charAt(n.length-1)!=r.charAt(r.length-1))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(n.length-u,n.length-o)==r.substring(r.length-u,r.length-o)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonOverlap_=function(n,r){var a=n.length,l=r.length;if(a==0||l==0)return 0;a>l?n=n.substring(a-l):a<l&&(r=r.substring(0,a));var u=Math.min(a,l);if(n==r)return u;for(var o=0,c=1;;){var f=n.substring(u-c),p=r.indexOf(f);if(p==-1)return o;c+=p,p!=0&&n.substring(u-c)!=r.substring(0,c)||(o=c,c++)}},t.prototype.diff_halfMatch_=function(n,r){if(this.Diff_Timeout<=0)return null;var a=n.length>r.length?n:r,l=n.length>r.length?r:n;if(a.length<4||2*l.length<a.length)return null;var u=this;function o(C,b,S){for(var x,y,E,R,N=C.substring(S,S+Math.floor(C.length/4)),D=-1,T="";(D=b.indexOf(N,D+1))!=-1;){var j=u.diff_commonPrefix(C.substring(S),b.substring(D)),B=u.diff_commonSuffix(C.substring(0,S),b.substring(0,D));T.length<B+j&&(T=b.substring(D-B,D)+b.substring(D,D+j),x=C.substring(0,S-B),y=C.substring(S+j),E=b.substring(0,D-B),R=b.substring(D+j))}return 2*T.length>=C.length?[x,y,E,R,T]:null}var c,f,p,d,_,v=o(a,l,Math.ceil(a.length/4)),w=o(a,l,Math.ceil(a.length/2));return v||w?(c=w?v&&v[4].length>w[4].length?v:w:v,n.length>r.length?(f=c[0],p=c[1],d=c[2],_=c[3]):(d=c[0],_=c[1],f=c[2],p=c[3]),[f,p,d,_,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=0,f=0,p=0,d=0;o<n.length;)n[o][0]==0?(a[l++]=o,c=p,f=d,p=0,d=0,u=n[o][1]):(n[o][0]==1?p+=n[o][1].length:d+=n[o][1].length,u&&u.length<=Math.max(c,f)&&u.length<=Math.max(p,d)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,o=--l>0?a[l-1]:-1,c=0,f=0,p=0,d=0,u=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o<n.length;){if(n[o-1][0]==-1&&n[o][0]==1){var _=n[o-1][1],v=n[o][1],w=this.diff_commonOverlap_(_,v),C=this.diff_commonOverlap_(v,_);w>=C?(w>=_.length/2||w>=v.length/2)&&(n.splice(o,0,new t.Diff(0,v.substring(0,w))),n[o-1][1]=_.substring(0,_.length-w),n[o+1][1]=v.substring(w),o++):(C>=_.length/2||C>=v.length/2)&&(n.splice(o,0,new t.Diff(0,_.substring(0,C))),n[o-1][0]=1,n[o-1][1]=v.substring(0,v.length-C),n[o+1][0]=-1,n[o+1][1]=_.substring(C),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(C,b){if(!C||!b)return 6;var S=C.charAt(C.length-1),x=b.charAt(0),y=S.match(t.nonAlphaNumericRegex_),E=x.match(t.nonAlphaNumericRegex_),R=y&&S.match(t.whitespaceRegex_),N=E&&x.match(t.whitespaceRegex_),D=R&&S.match(t.linebreakRegex_),T=N&&x.match(t.linebreakRegex_),j=D&&C.match(t.blanklineEndRegex_),B=T&&b.match(t.blanklineStartRegex_);return j||B?5:D||T?4:y&&!R&&N?3:R||N?2:y||E?1:0}for(var a=1;a<n.length-1;){if(n[a-1][0]==0&&n[a+1][0]==0){var l=n[a-1][1],u=n[a][1],o=n[a+1][1],c=this.diff_commonSuffix(l,u);if(c){var f=u.substring(u.length-c);l=l.substring(0,l.length-c),u=f+u.substring(0,u.length-c),o=f+o}for(var p=l,d=u,_=o,v=r(l,u)+r(u,o);u.charAt(0)===o.charAt(0);){l+=u.charAt(0),u=u.substring(1)+o.charAt(0),o=o.substring(1);var w=r(l,u)+r(u,o);w>=v&&(v=w,p=l,d=u,_=o)}n[a-1][1]!=p&&(p?n[a-1][1]=p:(n.splice(a-1,1),a--),n[a][1]=d,_?n[a+1][1]=_:(n.splice(a+1,1),a--))}a++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=!1,f=!1,p=!1,d=!1;o<n.length;)n[o][0]==0?(n[o][1].length<this.Diff_EditCost&&(p||d)?(a[l++]=o,c=p,f=d,u=n[o][1]):(l=0,u=null),p=d=!1):(n[o][0]==-1?d=!0:p=!0,u&&(c&&f&&p&&d||u.length<this.Diff_EditCost/2&&c+f+p+d==3)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,u=null,c&&f?(p=d=!0,l=0):(o=--l>0?a[l-1]:-1,p=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,a=0,l=0,u=0,o="",c="";a<n.length;)switch(n[a][0]){case 1:u++,c+=n[a][1],a++;break;case-1:l++,o+=n[a][1],a++;break;case 0:l+u>1?(l!==0&&u!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(a-l-u>0&&n[a-l-u-1][0]==0?n[a-l-u-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),a++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-r)+n[a][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),a-=l+u,n.splice(a,l+u),o.length&&(n.splice(a,0,new t.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new t.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,u=0,l=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var f=!1;for(a=1;a<n.length-1;)n[a-1][0]==0&&n[a+1][0]==0&&(n[a][1].substring(n[a][1].length-n[a-1][1].length)==n[a-1][1]?(n[a][1]=n[a-1][1]+n[a][1].substring(0,n[a][1].length-n[a-1][1].length),n[a+1][1]=n[a-1][1]+n[a+1][1],n.splice(a-1,1),f=!0):n[a][1].substring(0,n[a+1][1].length)==n[a+1][1]&&(n[a-1][1]+=n[a+1][1],n[a][1]=n[a][1].substring(n[a+1][1].length)+n[a+1][1],n.splice(a+1,1),f=!0)),a++;f&&this.diff_cleanupMerge(n)},t.prototype.diff_xIndex=function(n,r){var a,l=0,u=0,o=0,c=0;for(a=0;a<n.length&&(n[a][0]!==1&&(l+=n[a][1].length),n[a][0]!==-1&&(u+=n[a][1].length),!(l>r));a++)o=l,c=u;return n.length!=a&&n[a][0]===-1?c:c+(r-o)},t.prototype.diff_prettyHtml=function(n){for(var r=[],a=/&/g,l=/</g,u=/>/g,o=/\n/g,c=0;c<n.length;c++){var f=n[c][0],p=n[c][1].replace(a,"&").replace(l,"<").replace(u,">").replace(o,"¶<br>");switch(f){case 1:r[c]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case-1:r[c]='<del style="background:#ffe6e6;">'+p+"</del>";break;case 0:r[c]="<span>"+p+"</span>"}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_text2=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==-1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_levenshtein=function(n){for(var r=0,a=0,l=0,u=0;u<n.length;u++){var o=n[u][0],c=n[u][1];switch(o){case 1:a+=c.length;break;case-1:l+=c.length;break;case 0:r+=Math.max(a,l),a=0,l=0}}return r+=Math.max(a,l)},t.prototype.diff_toDelta=function(n){for(var r=[],a=0;a<n.length;a++)switch(n[a][0]){case 1:r[a]="+"+encodeURI(n[a][1]);break;case-1:r[a]="-"+n[a][1].length;break;case 0:r[a]="="+n[a][1].length}return r.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(n,r){for(var a=[],l=0,u=0,o=r.split(/\t/g),c=0;c<o.length;c++){var f=o[c].substring(1);switch(o[c].charAt(0)){case"+":try{a[l++]=new t.Diff(1,decodeURI(f))}catch{throw new Error("Illegal escape in diff_fromDelta: "+f)}break;case"-":case"=":var p=parseInt(f,10);if(isNaN(p)||p<0)throw new Error("Invalid number in diff_fromDelta: "+f);var d=n.substring(u,u+=p);o[c].charAt(0)=="="?a[l++]=new t.Diff(0,d):a[l++]=new t.Diff(-1,d);break;default:if(o[c])throw new Error("Invalid diff operation in diff_fromDelta: "+o[c])}}if(u!=n.length)throw new Error("Delta length ("+u+") does not equal source text length ("+n.length+").");return a},t.prototype.match_main=function(n,r,a){if(n==null||r==null||a==null)throw new Error("Null input. (match_main)");return a=Math.max(0,Math.min(a,n.length)),n==r?0:n.length?n.substring(a,a+r.length)==r?a:this.match_bitap_(n,r,a):-1},t.prototype.match_bitap_=function(n,r,a){if(r.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(r),u=this;function o(N,D){var T=N/r.length,j=Math.abs(a-D);return u.Match_Distance?T+j/u.Match_Distance:j?1:T}var c=this.Match_Threshold,f=n.indexOf(r,a);f!=-1&&(c=Math.min(o(0,f),c),(f=n.lastIndexOf(r,a+r.length))!=-1&&(c=Math.min(o(0,f),c)));var p,d,_=1<<r.length-1;f=-1;for(var v,w=r.length+n.length,C=0;C<r.length;C++){for(p=0,d=w;p<d;)o(C,a+d)<=c?p=d:w=d,d=Math.floor((w-p)/2+p);w=d;var b=Math.max(1,a-d+1),S=Math.min(a+d,n.length)+r.length,x=Array(S+2);x[S+1]=(1<<C)-1;for(var y=S;y>=b;y--){var E=l[n.charAt(y-1)];if(x[y]=C===0?(x[y+1]<<1|1)&E:(x[y+1]<<1|1)&E|(v[y+1]|v[y])<<1|1|v[y+1],x[y]&_){var R=o(C,y-1);if(R<=c){if(c=R,!((f=y-1)>a))break;b=Math.max(1,2*a-f)}}}if(o(C+1,a)>c)break;v=x}return f},t.prototype.match_alphabet_=function(n){for(var r={},a=0;a<n.length;a++)r[n.charAt(a)]=0;for(a=0;a<n.length;a++)r[n.charAt(a)]|=1<<n.length-a-1;return r},t.prototype.patch_addContext_=function(n,r){if(r.length!=0){if(n.start2===null)throw Error("patch not initialized");for(var a=r.substring(n.start2,n.start2+n.length1),l=0;r.indexOf(a)!=r.lastIndexOf(a)&&a.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)l+=this.Patch_Margin,a=r.substring(n.start2-l,n.start2+n.length1+l);l+=this.Patch_Margin;var u=r.substring(n.start2-l,n.start2);u&&n.diffs.unshift(new t.Diff(0,u));var o=r.substring(n.start2+n.length1,n.start2+n.length1+l);o&&n.diffs.push(new t.Diff(0,o)),n.start1-=u.length,n.start2-=u.length,n.length1+=u.length+o.length,n.length2+=u.length+o.length}},t.prototype.patch_make=function(n,r,a){var l,u;if(typeof n=="string"&&typeof r=="string"&&a===void 0)l=n,(u=this.diff_main(l,r,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(n&&typeof n=="object"&&r===void 0&&a===void 0)u=n,l=this.diff_text1(u);else if(typeof n=="string"&&r&&typeof r=="object"&&a===void 0)l=n,u=r;else{if(typeof n!="string"||typeof r!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");l=n,u=a}if(u.length===0)return[];for(var o=[],c=new t.patch_obj,f=0,p=0,d=0,_=l,v=l,w=0;w<u.length;w++){var C=u[w][0],b=u[w][1];switch(f||C===0||(c.start1=p,c.start2=d),C){case 1:c.diffs[f++]=u[w],c.length2+=b.length,v=v.substring(0,d)+b+v.substring(d);break;case-1:c.length1+=b.length,c.diffs[f++]=u[w],v=v.substring(0,d)+v.substring(d+b.length);break;case 0:b.length<=2*this.Patch_Margin&&f&&u.length!=w+1?(c.diffs[f++]=u[w],c.length1+=b.length,c.length2+=b.length):b.length>=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,_),o.push(c),c=new t.patch_obj,f=0,_=v,p=d)}C!==1&&(p+=b.length),C!==-1&&(d+=b.length)}return f&&(this.patch_addContext_(c,_),o.push(c)),o},t.prototype.patch_deepCopy=function(n){for(var r=[],a=0;a<n.length;a++){var l=n[a],u=new t.patch_obj;u.diffs=[];for(var o=0;o<l.diffs.length;o++)u.diffs[o]=new t.Diff(l.diffs[o][0],l.diffs[o][1]);u.start1=l.start1,u.start2=l.start2,u.length1=l.length1,u.length2=l.length2,r[a]=u}return r},t.prototype.patch_apply=function(n,r){if(n.length==0)return[r,[]];n=this.patch_deepCopy(n);var a=this.patch_addPadding(n);r=a+r+a,this.patch_splitMax(n);for(var l=0,u=[],o=0;o<n.length;o++){var c,f,p=n[o].start2+l,d=this.diff_text1(n[o].diffs),_=-1;if(d.length>this.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),p))!=-1&&((_=this.match_main(r,d.substring(d.length-this.Match_MaxBits),p+d.length-this.Match_MaxBits))==-1||c>=_)&&(c=-1):c=this.match_main(r,d,p),c==-1)u[o]=!1,l-=n[o].length2-n[o].length1;else if(u[o]=!0,l=c-p,d==(f=_==-1?r.substring(c,c+d.length):r.substring(c,_+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[o].diffs)+r.substring(c+d.length);else{var v=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(v)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(v);for(var w,C=0,b=0;b<n[o].diffs.length;b++){var S=n[o].diffs[b];S[0]!==0&&(w=this.diff_xIndex(v,C)),S[0]===1?r=r.substring(0,c+w)+S[1]+r.substring(c+w):S[0]===-1&&(r=r.substring(0,c+w)+r.substring(c+this.diff_xIndex(v,C+S[1].length))),S[0]!==-1&&(C+=S[1].length)}}}}return[r=r.substring(a.length,r.length-a.length),u]},t.prototype.patch_addPadding=function(n){for(var r=this.Patch_Margin,a="",l=1;l<=r;l++)a+=String.fromCharCode(l);for(l=0;l<n.length;l++)n[l].start1+=r,n[l].start2+=r;var u=n[0],o=u.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,a)),u.start1-=r,u.start2-=r,u.length1+=r,u.length2+=r;else if(r>o[0][1].length){var c=r-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],u.start1-=c,u.start2-=c,u.length1+=c,u.length2+=c}return(o=(u=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,a)),u.length1+=r,u.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),u.length1+=c,u.length2+=c),a},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,a=0;a<n.length;a++)if(!(n[a].length1<=r)){var l=n[a];n.splice(a--,1);for(var u=l.start1,o=l.start2,c="";l.diffs.length!==0;){var f=new t.patch_obj,p=!0;for(f.start1=u-c.length,f.start2=o-c.length,c!==""&&(f.length1=f.length2=c.length,f.diffs.push(new t.Diff(0,c)));l.diffs.length!==0&&f.length1<r-this.Patch_Margin;){var d=l.diffs[0][0],_=l.diffs[0][1];d===1?(f.length2+=_.length,o+=_.length,f.diffs.push(l.diffs.shift()),p=!1):d===-1&&f.diffs.length==1&&f.diffs[0][0]==0&&_.length>2*r?(f.length1+=_.length,u+=_.length,p=!1,f.diffs.push(new t.Diff(d,_)),l.diffs.shift()):(_=_.substring(0,r-f.length1-this.Patch_Margin),f.length1+=_.length,u+=_.length,d===0?(f.length2+=_.length,o+=_.length):p=!1,f.diffs.push(new t.Diff(d,_)),_==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(_.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var v=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);v!==""&&(f.length1+=v.length,f.length2+=v.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=v:f.diffs.push(new t.Diff(0,v))),p||n.splice(++a,0,f)}}},t.prototype.patch_toText=function(n){for(var r=[],a=0;a<n.length;a++)r[a]=n[a];return r.join("")},t.prototype.patch_fromText=function(n){var r=[];if(!n)return r;for(var a=n.split(` +`),l=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;l<a.length;){var o=a[l].match(u);if(!o)throw new Error("Invalid patch string: "+a[l]);var c=new t.patch_obj;for(r.push(c),c.start1=parseInt(o[1],10),o[2]===""?(c.start1--,c.length1=1):o[2]=="0"?c.length1=0:(c.start1--,c.length1=parseInt(o[2],10)),c.start2=parseInt(o[3],10),o[4]===""?(c.start2--,c.length2=1):o[4]=="0"?c.length2=0:(c.start2--,c.length2=parseInt(o[4],10)),l++;l<a.length;){var f=a[l].charAt(0);try{var p=decodeURI(a[l].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+p)}if(f=="-")c.diffs.push(new t.Diff(-1,p));else if(f=="+")c.diffs.push(new t.Diff(1,p));else if(f==" ")c.diffs.push(new t.Diff(0,p));else{if(f=="@")break;if(f!=="")throw new Error('Invalid patch mode "'+f+'" in: '+p)}l++}}return r},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var n,r=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@ +`],a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case 1:n="+";break;case-1:n="-";break;case 0:n=" "}r[a+1]=n+encodeURI(this.diffs[a][1])+` +`}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0})),V8=gh.DIFF_EQUAL,Y8=gh.DIFF_DELETE,W8=gh.DIFF_INSERT;function dC(e){var t=yb(e,(function(r){return!$i(r)}));if(t===-1)return[];var n=yb(e,(function(r){return!!$i(r)}),t);return n===-1?[e.slice(t)]:[e.slice(t,n)].concat(Rn(dC(e.slice(n))))}function bb(e){return e.reduce((function(t,n){var r=Je(n,2),a=r[0],l=Ow(r[1].split(` +`).map((function(c){return[a,c]}))),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(t[t.length-1]),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function ng(e,t){return e.reduce((function(n,r){var a=Je(n,2),l=a[0],u=a[1],o=Je(r,2),c=o[0],f=o[1];if(c!==V8){var p={type:"edit",lineNumber:t,start:u,length:f.length};l.push(p)}return[l,u+f.length]}),[[],0])[0]}function Sb(e,t){return wm(e,(function(n,r){return ng(n,t+r)}))}function pC(e,t){var n=new gh,r=n.diff_main(e,t);return n.diff_cleanupSemantic(r),r.length<=1?[[],[]]:(function(a){return a.reduce((function(l,u){var o=Je(l,2),c=o[0],f=o[1];switch(Je(u,1)[0]){case W8:f.push(u);break;case Y8:c.push(u);break;default:c.push(u),f.push(u)}return[c,f]}),[[],[]])})(r)}function X8(e){var t=e.reduce((function(f,p){var d=Je(f,2),_=d[0],v=d[1];return Dn(p)?[_+(_?` +`:"")+p.content,v]:[_,v+(v?` +`:"")+p.content]}),["",""]),n=Je(t,2),r=Je(pC(n[0],n[1]),2),a=r[0],l=r[1];if(a.length===0&&l.length===0)return[[],[]];var u=function(f){if(f&&!$i(f))return f.lineNumber},o=u(e.find(Dn)),c=u(e.find(Tr));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[Sb(bb(a),o),Sb(bb(l),c)]}function K8(e){var t=e.reduce((function(r,a){var l=Je(r,3),u=l[0],o=l[1],c=l[2];if(!c||!Dn(c)||!Tr(a))return[u,o,a];var f=Je(pC(c.content,a.content),2),p=f[0],d=f[1];return[u.concat(ng(p,c.lineNumber)),o.concat(ng(d,a.lineNumber)),a]}),[[],[],null]),n=Je(t,2);return[n[0],n[1]]}function Z8(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?X8:K8,r=wm(e.map((function(o){return o.changes})),dC).map(n).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1],_=Je(c,2),v=_[0],w=_[1];return[p.concat(v),d.concat(w)]}),[[],[]]),a=Je(r,2),l=a[0],u=a[1];return G8(vb(l),vb(u))}var Q8=["enhancers"],xb=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=Je(T8(e,Ar(n,Q8)),2),u=l[0],o=l[1],c=[gb(u),gb(o)],f=(t=[c[0],c[1]],a.reduce((function(C,b){return b(C)}),t)),p=Je(f,2),d=p[0],_=p[1],v=[d.map(mb),_.map(mb)],w=v[1];return{old:v[0].map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]})),new:w.map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]}))}};const J8=2e3,eB={highlight(e,t){return je.highlight(e,t).children}};function tB(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function nB(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function iB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function rB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function sB(e){const t=[Z8(e.hunks,{type:"line"})],n=pw(iB(e));return n&&je.registered(n)?xb(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:eB}):xb(e.hunks,{enhancers:t,highlight:!1})}const aB=({change:e,side:t})=>t==="old"?null:tB(e);function wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function oB({bytesRead:e,byteLimit:t}){return m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsxs("p",{children:["This diff is larger than ",wb(t)," (",wb(e)," read). View it locally with git."]})]})}function lB({file:e,defaultExpanded:t}){const[n,r]=q.useState(t),{additions:a,deletions:l}=q.useMemo(()=>nB(e),[e]),u=n&&a+l<=J8,o=q.useMemo(()=>{if(u)try{return sB(e)}catch{return}},[e,u]);return m.jsxs("section",{className:"diff-file-card",children:[m.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[m.jsx("span",{className:"chev",children:n?m.jsx(cs,{size:14}):m.jsx(Uu,{size:14})}),m.jsx("span",{className:"path",children:m.jsx("code",{children:rB(e)})}),m.jsxs("span",{className:"stats",children:[m.jsxs("span",{className:"diff-stat-add",children:["+",a]}),m.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?m.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):m.jsx(y8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:aB,tokens:o,viewType:"unified"}))]})}function gC({diff:e,className:t}){const n=q.useMemo(()=>{if(!e.trim())return[];try{return KL(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?m.jsx("div",{className:"diff-empty",children:"No changes."}):m.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>m.jsx(lB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var fp={exports:{}},Cb;function cB(){return Cb||(Cb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),_=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(_/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(fp)),fp.exports}var uB=cB(),dp={exports:{}},Eb;function hB(){return Eb||(Eb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),_=c(9924),v=c(844),w=c(4725),C=c(2585),b=c(3656);let S=o.AccessibilityManager=class extends v.Disposable{constructor(x,y,E,R){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let y=0;y<x;y++)this._handleChar(" ")}_handleChar(x){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const E=this._terminal.buffer,R=E.lines.length.toString();for(let N=x;N<=y;N++){const D=E.lines.get(E.ydisp+N),T=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),F=this._rowElements[N];F&&(j.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=j,this._rowColumns.set(F,T)),F.setAttribute("aria-posinset",B),F.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const E=x.target,R=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==R)return;let N,D;if(y===0?(N=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:F})=>{const Y=B instanceof Text?B.parentNode:B;let H=parseInt(Y==null?void 0:Y.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(Y);if(!z)return console.warn("columns is null. Race condition?"),null;let V=F<z.length?z[F]:z.slice(-1)[0]+1;return V>=this._terminal.cols&&(++H,V=0),{row:H,column:V}},D=N(y),T=N(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x<this._terminal.rows;x++)this._refreshRowDimensions(this._rowElements[x])}}_refreshRowDimensions(x){x.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=f([p(1,C.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],S)},3614:(u,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function p(_,v,w,C){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),v.value=""}function d(_,v,w){const C=w.getBoundingClientRect(),b=_.clientX-C.left-10,S=_.clientY-C.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${b}px`,v.style.top=`${S}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,v,w,C){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),v,w,C)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(_,v,w,C,b){d(_,v,w),b&&C.rightClickSelect(_),v.value=C.selectionText,v.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,_){this._css.set(p,d,_)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,_){this._color.set(p,d,_)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),_=c(8460),v=c(844),w=c(2585),C=c(4725);let b=o.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(S,x,y,E,R){super(),this._element=S,this._mouseService=x,this._renderService=y,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=S.composedPath();for(let E=0;E<y.length;E++){const R=y[E];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&x.x===this._lastBufferCell.x&&x.y===this._lastBufferCell.y||(this._handleHover(x),this._lastBufferCell=x)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,x){var E,R;this._activeProviderReplies&&x||((E=this._activeProviderReplies)==null||E.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let y=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())x?(R=this._activeProviderReplies)!=null&&R.get(N)&&(y=this._checkLinkProviderResult(N,S,y)):D.provideLinks(S.y,(T=>{var B,F;if(this._isMouseOut)return;const j=T==null?void 0:T.map((Y=>({link:Y})));(B=this._activeProviderReplies)==null||B.set(N,j),y=this._checkLinkProviderResult(N,S,y),((F=this._activeProviderReplies)==null?void 0:F.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,x){const y=new Set;for(let E=0;E<x.size;E++){const R=x.get(E);if(R)for(let N=0;N<R.length;N++){const D=R[N],T=D.link.range.start.y<S?0:D.link.range.start.x,j=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let B=T;B<=j;B++){if(y.has(B)){R.splice(N--,1);break}y.add(B)}}}}_checkLinkProviderResult(S,x,y){var N;if(!this._activeProviderReplies)return y;const E=this._activeProviderReplies.get(S);let R=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&E){const D=E.find((T=>this._linkAtPosition(T.link,x)));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((j=>this._linkAtPosition(j.link,x)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,x){this._currentLink&&this._lastMouseEvent&&(!S||!x||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(S.link,x)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.pointerCursor},set:y=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.underline},set:y=>{var E,R,N;(E=this._currentLink)!=null&&E.state&&((N=(R=this._currentLink)==null?void 0:R.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(S,x){const y=S.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(S,x){const y=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,R=x.y*this._bufferService.cols+x.x;return y<=R&&R<=E}_positionFromMouseEvent(S,x,y){const E=y.getCoords(S,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,x,y,E,R){return{x1:S,y1:x,x2:y,y2:E,cols:this._bufferService.cols,fg:R}}};o.Linkifier=b=f([p(1,C.IMouseService),p(2,C.IRenderService),p(3,w.IBufferService),p(4,C.ILinkProviderService)],b)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=o.OscLinkProvider=class{constructor(C,b,S){this._bufferService=C,this._optionsService=b,this._oscLinkService=S}provideLinks(C,b){var j;const S=this._bufferService.buffer.lines.get(C-1);if(!S)return void b(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,E=new d.CellData,R=S.getTrimmedLength();let N=-1,D=-1,T=!1;for(let B=0;B<R;B++)if(D!==-1||S.hasContent(B)){if(S.loadCell(B,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=B,N=E.extended.urlId;continue}T=E.extended.urlId!==N}else D!==-1&&(T=!0);if(T||D!==-1&&B===R-1){const F=(j=this._oscLinkService.getLinkData(N))==null?void 0:j.uri;if(F){const Y={start:{x:D+1,y:C},end:{x:B+(T||B!==R-1?0:1),y:C}};let H=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const z=new URL(F);["http:","https:"].includes(z.protocol)||(H=!0)}catch{H=!0}H||x.push({text:F,range:Y,activate:(z,V)=>y?y.activate(z,V,Y):w(0,V),hover:(z,V)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,z,V,Y)},leave:(z,V)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,z,V,Y)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,N=E.extended.urlId):(D=-1,N=-1)}}b(x)}};function w(C,b){if(confirm(`Do you want to navigate to ${b}? + +WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=v=f([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],v)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),_=c(9042),v=c(3730),w=c(1680),C=c(3107),b=c(5744),S=c(2950),x=c(1296),y=c(428),E=c(4269),R=c(5114),N=c(8934),D=c(3230),T=c(9312),j=c(4725),B=c(6731),F=c(8055),Y=c(8969),H=c(8460),z=c(844),V=c(6114),G=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),$=c(5435),U=c(4567),Q=c(779);class re extends Y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=V,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ee)=>this.refresh(P,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,z.toDisposable)((()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const P of Z){let ee,ne="";switch(P.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+P.index}switch(P.type){case 0:const ge=F.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(ge)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[P.index]=F.channels.toColor(...P.color)));else{const he=ee;this._themeService.modifyColors((ye=>ye[he]=F.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(Z);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ge=P.getWidth(ee),he=this._renderService.dimensions.css.cell.width*ge,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,be=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=be+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,f.copyHandler)(P,this._selectionService)})));const Z=P=>(0,f.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),V.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),V.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,f.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),V.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,P=this.element;function ee(he){const ye=Z._mouseService.getMouseReportCoords(he,Z.screenElement);if(!ye)return!1;let be,ke;switch(he.overrideType||he.type){case"mousemove":ke=32,he.buttons===void 0?(be=3,he.button!==void 0&&(be=he.button<3?he.button:3)):be=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":ke=0,be=he.button<3?he.button:3;break;case"mousedown":ke=1,be=he.button<3?he.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(he)===!1||Z.viewport.getLinesScrolled(he)===0)return!1;ke=he.deltaY<0?0:1,be=4;break;default:return!1}return!(ke===void 0||be===void 0||be>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:be,action:ke,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ge={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ne.mousemove||(P.addEventListener("mousemove",ge.mousemove),ne.mousemove=ge.mousemove):(P.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&he?ne.wheel||(P.addEventListener("wheel",ge.wheel,{passive:!1}),ne.wheel=ge.wheel):(P.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&he?ne.mouseup||(ne.mouseup=ge.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&he?ne.mousedrag||(ne.mousedrag=ge.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(P,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(he)}))),this.register((0,p.addDisposableDomListener)(P,"wheel",(he=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(he);if(ye===0)return;const be=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let ke="";for(let Ee=0;Ee<Math.abs(ye);Ee++)ke+=be;return this.coreService.triggerDataEvent(ke,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(P,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(P,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Z,P){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,P)}updateCursorStyle(Z){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,P,ee=0){var ne;ee===1?(super.scrollLines(Z,P,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,P,ee){this._selectionService.setSelection(Z,P,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,P){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,P)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!P&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,P){const ee=Z.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Z.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Z.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)P=Z.charCode;else if(Z.which===null||Z.which===void 0)P=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;P=Z.which}return!(!P||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=Z.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Z),!0}return!1}resize(Z,P){Z!==this.cols||P!==this.rows?super.resize(Z,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,P){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Z=this.viewport)==null||Z.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Z;(Z=this._renderService)==null||Z.clearTextureAtlas()}_reportFocus(){var Z;(Z=this.element)!=null&&Z.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ee};${P}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ge=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ge};${ne}t`)}}cancel(Z,P){if(this.options.cancelEvents||P)return Z.preventDefault(),Z.stopPropagation(),!1}}o.Terminal=re},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),w=c(844),C=c(2585);let b=o.Viewport=class extends w.Disposable{constructor(S,x,y,E,R,N,D,T){super(),this._viewportElement=S,this._scrollArea=x,this._bufferService=y,this._optionsService=E,this._charSizeService=R,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const x=this._getPixelsScrolled(S);return x!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+x:this._smoothScrollState.target+=x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const x=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?x*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._currentRowHeight*this._bufferService.rows),x}getBufferElements(S,x){var T;let y,E="";const R=[],N=x??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let j=S;j<N;j++){const B=D.get(j);if(!B)continue;const F=(T=D.get(j+1))==null?void 0:T.isWrapped;if(E+=B.translateToString(!F),!F||j===D.length-1){const Y=document.createElement("div");Y.textContent=E,R.push(Y),E.length>0&&(y=Y),E=""}}return{bufferElements:R,cursorElement:y}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(S,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const x=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}};o.Viewport=b=f([p(2,C.IBufferService),p(3,C.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],b)},3107:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),v=c(2585);let w=o.BufferDecorationRenderer=class extends _.Disposable{constructor(C,b,S,x,y){super(),this._screenElement=C,this._bufferService=b,this._coreBrowserService=S,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var x;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((x=C==null?void 0:C.options)==null?void 0:x.layer)==="top"),b.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=C.options.x??0;return S&&S>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(C,b),b}_refreshStyle(C){const b=C.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let S=this._decorationElements.get(C);S||(S=this._createElement(C),C.element=S,this._decorationElements.set(C,S),this._container.appendChild(S),C.onDispose((()=>{this._decorationElements.delete(C),S.remove()}))),S.style.top=b*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(S)}}_refreshXPosition(C,b=C.element){if(!b)return;const S=C.options.x??0;(C.options.anchor||"left")==="right"?b.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var b;(b=this._decorationElements.get(C))==null||b.remove(),this._decorationElements.delete(C),C.dispose()}};o.BufferDecorationRenderer=w=f([p(1,v.IBufferService),p(2,d.ICoreBrowserService),p(3,v.IDecorationService),p(4,d.IRenderService)],w)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),v=c(844),w=c(2585),C={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,R,N,D,T,j){var F;super(),this._viewportElement=y,this._screenElement=E,this._bufferService=R,this._decorationService=N,this._renderService=D,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(F=this._viewportElement.parentElement)==null||F.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var Y;(Y=this._canvas)==null||Y.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=b.left,S.right=b.left+b.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);C.left=E,C.center=E,C.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(S[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-C[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,b,S,x,y,E){this._textarea=C,this._compositionView=b,this._bufferService=S,this._optionsService=x,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,S=b.replace(C,"");this._dataAlreadySent=S,b.length>C.length?this._coreService.triggerDataEvent(S,!0):b.length<C.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):b.length===C.length&&b!==C&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,x=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=x+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=x+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=w=f([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,d.IRenderService)],w)},9806:(u,o)=>{function c(f,p,d){const _=d.getBoundingClientRect(),v=f.getComputedStyle(d),w=parseInt(v.getPropertyValue("padding-left")),C=parseInt(v.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-C]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,_,v,w,C,b,S){if(!w)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(S?C/2:0))/C),x[1]=Math.ceil(x[1]/b),x[0]=Math.min(Math.max(x[0],1),_+(S?1:0)),x[1]=Math.min(Math.max(x[1],1),v),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(b,S,x,y){const E=b-d(b,x),R=S-d(S,x),N=Math.abs(E-R)-(function(D,T,j){let B=0;const F=D-d(D,j),Y=T-d(T,j);for(let H=0;H<Math.abs(F-Y);H++){const z=_(D,T)==="A"?-1:1,V=j.buffer.lines.get(F+z*H);V!=null&&V.isWrapped&&B++}return B})(b,S,x);return C(N,w(_(b,S),y))}function d(b,S){let x=0,y=S.buffer.lines.get(b),E=y==null?void 0:y.isWrapped;for(;E&&b>=0&&b<S.rows;)x++,y=S.buffer.lines.get(--b),E=y==null?void 0:y.isWrapped;return x}function _(b,S){return b>S?"A":"B"}function v(b,S,x,y,E,R){let N=b,D=S,T="";for(;N!==x||D!==y;)N+=E?1:-1,E&&N>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,b,N),N=0,b=0,D++):!E&&N<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,b+1),N=R.cols-1,b=N,D--);return T+R.buffer.translateBufferLineToString(D,!1,b,N)}function w(b,S){const x=S?"O":"[";return f.C0.ESC+x+b}function C(b,S){b=Math.floor(b);let x="";for(let y=0;y<b;y++)x+=S;return x}o.moveToCellSequence=function(b,S,x,y){const E=x.buffer.x,R=x.buffer.y;if(!x.buffer.hasScrollback)return(function(T,j,B,F,Y,H){return p(j,F,Y,H).length===0?"":C(v(T,j,T,j-d(j,Y),!1,Y).length,w("D",H))})(E,R,0,S,x,y)+p(R,S,x,y)+(function(T,j,B,F,Y,H){let z;z=p(j,F,Y,H).length>0?F-d(F,Y):j;const V=F,G=(function(X,K,L,M,O,$){let U;return U=p(L,M,O,$).length>0?M-d(M,O):K,X<L&&U<=M||X>=L&&U<M?"C":"D"})(T,j,B,F,Y,H);return C(v(T,z,B,V,G==="C",Y).length,w(G,H))})(E,R,b,S,x,y);let N;if(R===S)return N=E>b?"D":"C",C(Math.abs(E-b),w(N,y));N=R>S?"D":"C";const D=Math.abs(R-S);return C((function(T,j){return j.cols-T})(R>S?b:E,x)+(D-1)*x.cols+1+((R>S?E:b)-1),w(N,y))}},1296:function(u,o,c){var f=this&&this.__decorate||function(H,z,V,G){var X,K=arguments.length,L=K<3?z:G===null?G=Object.getOwnPropertyDescriptor(z,V):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(H,z,V,G);else for(var M=H.length-1;M>=0;M--)(X=H[M])&&(L=(K<3?X(L):K>3?X(z,V,L):X(z,V))||L);return K>3&&L&&Object.defineProperty(z,V,L),L},p=this&&this.__param||function(H,z){return function(V,G){z(V,G,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),w=c(6171),C=c(6052),b=c(4725),S=c(8055),x=c(8460),y=c(844),E=c(2585),R="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let F=1,Y=o.DomRenderer=class extends y.Disposable{constructor(H,z,V,G,X,K,L,M,O,$,U,Q,re){super(),this._terminal=H,this._document=z,this._element=V,this._screenElement=G,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=$,this._bufferService=U,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const V of this._rowElements)V.style.width=`${this.dimensions.css.canvas.width}px`,V.style.height=`${this.dimensions.css.cell.height}px`,V.style.lineHeight=`${this.dimensions.css.cell.height}px`,V.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const z=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=z,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let z=`${this._terminalSelector} .${N} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;z+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity(H.foreground,.5).css};}`,z+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const V=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;z+=`@keyframes ${V} { 50% { border-bottom-style: hidden; }}`,z+=`@keyframes ${G} { 50% { box-shadow: none; }}`,z+=`@keyframes ${X} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,z+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,z+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of H.ansi.entries())z+=`${this._terminalSelector} .${D}${K} { color: ${L.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${S.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;z+=`${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(H.background).css}; }${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${T}${v.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=z}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,z){for(let V=this._rowElements.length;V<=z;V++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,z){this._refreshRowElements(H,z),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,z,V){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,z,V),this.renderRows(0,this._bufferService.rows-1),!H||!z)return;this._selectionRenderModel.update(this._terminal,H,z,V);const G=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(V){const O=H[0]>z[0];M.appendChild(this._createSelectionElement(K,O?z[0]:H[0],O?H[0]:z[0],L-K+1))}else{const O=G===K?H[0]:0,$=K===X?z[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,$));const U=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,U)),K!==L){const Q=X===L?z[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(H,z,V,G=1){const X=this._document.createElement("div"),K=z*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(V-z);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=G*this.dimensions.css.cell.height+"px",X.style.top=H*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,z){const V=this._bufferService.buffer,G=V.ybase+V.y,X=Math.min(V.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=H;O<=z;O++){const $=O+V.ydisp,U=this._rowElements[O],Q=V.lines.get($);if(!U||!Q)break;U.replaceChildren(...this._rowFactory.createRow(Q,$,$===G,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,z,V,G,X,K){V<0&&(H=0),G<0&&(z=0);const L=this._bufferService.rows-1;V=Math.max(Math.min(V,L),0),G=Math.max(Math.min(G,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,$=Math.min(M.x,X-1),U=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=V;ae<=G;++ae){const Z=ae+M.ydisp,P=this._rowElements[ae],ee=M.lines.get(Z);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,$,U,this.dimensions.css.cell.width,this._widthCache,K?ae===V?H:0:-1,K?(ae===G?z:X)-1:-1))}}};o.DomRenderer=Y=f([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],Y)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,D,T,j){var B,F=arguments.length,Y=F<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(N,D,T,j);else for(var H=N.length-1;H>=0;H--)(B=N[H])&&(Y=(F<3?B(Y):F>3?B(D,T,Y):B(D,T))||Y);return F>3&&Y&&Object.defineProperty(D,T,Y),Y},p=this&&this.__param||function(N,D){return function(T,j){D(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),w=c(2585),C=c(8055),b=c(4725),S=c(4269),x=c(6171),y=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,D,T,j,B,F,Y){this._document=N,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=F,this._themeService=Y,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,T){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=T}createRow(N,D,T,j,B,F,Y,H,z,V,G){const X=[],K=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O<F+1&&(O=F+1);let $=0,U="",Q=0,re=0,ae=0,Z=!1,P=0,ee=!1,ne=0;const ge=[],he=V!==-1&&G!==-1;for(let ye=0;ye<O;ye++){N.loadCell(ye,this._workCell);let be=this._workCell.getWidth();if(be===0)continue;let ke=!1,Ee=ye,Ce=this._workCell;if(K.length>0&&ye===K[0][0]){ke=!0;const Ie=K.shift();Ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),Ee=Ie[1]-1,be=Ce.getWidth()}const rt=this._isCellInSelection(ye,D),bt=T&&ye===F,Ge=he&&ye>=V&&ye<=G;let ct=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{ct=!0}));let Pt=Ce.getChars()||_.WHITESPACE_CELL_CHAR;if(Pt===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Pt=" "),ne=be*H-z.get(Pt,Ce.isBold(),Ce.isItalic()),M){if($&&(rt&&ee||!rt&&!ee&&Ce.bg===Q)&&(rt&&ee&&L.selectionForeground||Ce.fg===re)&&Ce.extended.ext===ae&&Ge===Z&&ne===P&&!bt&&!ke&&!ct){Ce.isInvisible()?U+=_.WHITESPACE_CELL_CHAR:U+=Pt,$++;continue}$&&(M.textContent=U),M=this._document.createElement("span"),$=0,U=""}else M=this._document.createElement("span");if(Q=Ce.bg,re=Ce.fg,ae=Ce.extended.ext,Z=Ge,P=ne,ee=rt,ke&&F>=ye&&F<=Ee&&(F=ye),!this._coreService.isCursorHidden&&bt&&this._coreService.isCursorInitialized){if(ge.push("xterm-cursor"),this._coreBrowserService.isFocused)Y&&ge.push("xterm-cursor-blink"),ge.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ge.push("xterm-cursor-outline");break;case"block":ge.push("xterm-cursor-block");break;case"bar":ge.push("xterm-cursor-bar");break;case"underline":ge.push("xterm-cursor-underline")}}if(Ce.isBold()&&ge.push("xterm-bold"),Ce.isItalic()&&ge.push("xterm-italic"),Ce.isDim()&&ge.push("xterm-dim"),U=Ce.isInvisible()?_.WHITESPACE_CELL_CHAR:Ce.getChars()||_.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(ge.push(`xterm-underline-${Ce.extended.underlineStyle}`),U===" "&&(U=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ie=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ie<8&&(Ie+=8),M.style.textDecorationColor=L.ansi[Ie].css}Ce.isOverline()&&(ge.push("xterm-overline"),U===" "&&(U=" ")),Ce.isStrikethrough()&&ge.push("xterm-strikethrough"),Ge&&(M.style.textDecoration="underline");let ht=Ce.getFgColor(),Fe=Ce.getFgColorMode(),fe=Ce.getBgColor(),ie=Ce.getBgColorMode();const de=!!Ce.isInverse();if(de){const Ie=ht;ht=fe,fe=Ie;const Nt=Fe;Fe=ie,ie=Nt}let Se,Ae,De,Ve=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{Ie.options.layer!=="top"&&Ve||(Ie.backgroundColorRGB&&(ie=50331648,fe=Ie.backgroundColorRGB.rgba>>8&16777215,Se=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(Fe=50331648,ht=Ie.foregroundColorRGB.rgba>>8&16777215,Ae=Ie.foregroundColorRGB),Ve=Ie.options.layer==="top")})),!Ve&&rt&&(Se=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,fe=Se.rgba>>8&16777215,ie=50331648,Ve=!0,L.selectionForeground&&(Fe=50331648,ht=L.selectionForeground.rgba>>8&16777215,Ae=L.selectionForeground)),Ve&&ge.push("xterm-decoration-top"),ie){case 16777216:case 33554432:De=L.ansi[fe],ge.push(`xterm-bg-${fe}`);break;case 50331648:De=C.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(M,`background-color:#${R((fe>>>0).toString(16),"0",6)}`);break;default:de?(De=L.foreground,ge.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):De=L.background}switch(Se||Ce.isDim()&&(Se=C.color.multiplyOpacity(De,.5)),Fe){case 16777216:case 33554432:Ce.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(M,De,L.ansi[ht],Ce,Se,void 0)||ge.push(`xterm-fg-${ht}`);break;case 50331648:const Ie=C.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(M,De,Ie,Ce,Se,Ae)||this._addStyle(M,`color:#${R(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,De,L.foreground,Ce,Se,Ae)||de&&ge.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ge.length&&(M.className=ge.join(" "),ge.length=0),bt||ke||ct?M.textContent=U:$++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ee}return M&&$&&(M.textContent=U),X}_applyMinimumContrast(N,D,T,j,B,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const Y=this._getContrastCache(j);let H;if(B||F||(H=Y.getColor(D.rgba,T.rgba)),H===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);H=C.color.ensureContrastRatio(B||D,F||T,z),Y.setColor((B||D).rgba,(F||T).rgba,H??null)}return!!H&&(this._addStyle(N,`color:${H.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&D>=T[1]&&N<j[0]&&D<=j[1]:N<T[0]&&D>=T[1]&&N>=j[0]&&D<=j[1]:D>T[1]&&D<j[1]||T[1]===j[1]&&D===T[1]&&N>=T[0]&&N<j[0]||T[1]<j[1]&&D===j[1]&&N<j[0]||T[1]<j[1]&&D===T[1]&&N>=T[0])}};function R(N,D,T){for(;N.length<T;)N=D+N;return N}o.DomRendererRowFactory=E=f([p(1,b.ICharacterJoinerService),p(2,w.IOptionsService),p(3,b.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,b.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[p,d,_,v],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(v),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),p&&(_+="I");let v=this._holey.get(_);if(v===void 0){let w=0;f&&(w|=1),p&&(w|=2),v=this._measure(c,w),v>0&&this._holey.set(_,v)}return v}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,_,v){return d===1&&_>Math.ceil(1.5*v)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,_=0){return(p-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,_,v=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,C=d[1]-w,b=_[1]-w,S=Math.max(C,0),x=Math.min(b,p.rows-1);S>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=C,this.viewportEndRow=b,this.viewportCappedStartRow=S,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=_[0])}isCellSelected(p,d,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let w=o.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new b(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([p(2,d.IOptionsService)],w);class C extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends C{constructor(y,E,R){super(),this._document=y,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends C{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),w=c(2585);class C extends d.AttributeData{constructor(x,y,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=C;let b=o.CharacterJoinerService=class mC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===x)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(x){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(x);if(!y||y.length===0)return[];const E=[],R=y.translateToString(!0);let N=0,D=0,T=0,j=y.getFg(0),B=y.getBg(0);for(let F=0;F<y.getTrimmedLength();F++)if(y.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==B){if(F-N>1){const Y=this._getJoinedRanges(R,T,D,y,N);for(let H=0;H<Y.length;H++)E.push(Y[H])}N=F,T=D,j=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const F=this._getJoinedRanges(R,T,D,y,N);for(let Y=0;Y<F.length;Y++)E.push(F[Y])}return E}_getJoinedRanges(x,y,E,R,N){const D=x.substring(y,E);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const B=this._characterJoiners[j].handler(D);for(let F=0;F<B.length;F++)mC._mergeRanges(T,B[F])}catch(B){console.error(B)}return this._stringRangesToCellRanges(T,R,N),T}_stringRangesToCellRanges(x,y,E){let R=0,N=!1,D=0,T=x[R];if(T){for(let j=E;j<this._bufferService.cols;j++){const B=y.getWidth(j),F=y.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!N&&T[0]<=D&&(T[0]=j,N=!0),T[1]<=D){if(T[1]=j,T=x[++R],!T)break;T[0]<=D?(T[0]=j,N=!0):N=!1}D+=F}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(x,y){let E=!1;for(let R=0;R<x.length;R++){const N=x[R];if(E){if(y[1]<=N[0])return x[R-1][1]=y[1],x;if(y[1]<=N[1])return x[R-1][1]=Math.max(y[1],N[1]),x.splice(R,1),x;x.splice(R,1),R--}else{if(y[1]<=N[0])return x.splice(R,0,y),x;if(y[1]<=N[1])return N[0]=Math.min(y[0],N[0]),x;y[0]<N[1]&&(N[0]=Math.min(y[0],N[0]),E=!0)}}return E?x[x.length-1][1]=y[1]:x.push(y),x}};o.CharacterJoinerService=b=f([p(0,w.IBufferService)],b)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class _ extends f.Disposable{constructor(C,b,S){super(),this._textarea=C,this._window=b,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=_;class v extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const v=this.linkProviders.indexOf(_);v!==-1&&this.linkProviders.splice(v,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(w,C,b,S){var x,y=arguments.length,E=y<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,C,b,S);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(E=(y<3?x(E):y>3?x(C,b,E):x(C,b))||E);return y>3&&E&&Object.defineProperty(C,b,E),E},p=this&&this.__param||function(w,C){return function(b,S){C(b,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),_=c(9806);let v=o.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,b,S,x){return(0,_.getCoords)(window,w,C,b,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(w,C){const b=(0,_.getCoordsRelativeToElement)(window,w,C);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=v=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],v)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),_=c(4725),v=c(8460),w=c(844),C=c(7226),b=c(2585);let S=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,E,R,N,D,T,j){super(),this._rowCount=x,this._charSizeService=R,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,F)=>this._renderRows(B,F)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(y),this._observerDisposable.value=(0,w.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,E){var R;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=E,(R=this._renderer.value)==null||R.handleSelectionChanged(x,y,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=S=f([p(2,b.IOptionsService),p(3,_.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],S)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,F){var Y,H=arguments.length,z=H<3?j:F===null?F=Object.getOwnPropertyDescriptor(j,B):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(T,j,B,F);else for(var V=T.length-1;V>=0;V--)(Y=T[V])&&(z=(H<3?Y(z):H>3?Y(j,B,z):Y(j,B))||z);return H>3&&z&&Object.defineProperty(j,B,z),z},p=this&&this.__param||function(T,j){return function(B,F){j(B,F,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),w=c(4725),C=c(8460),b=c(844),S=c(6114),x=c(4841),y=c(511),E=c(2585),R=" ",N=new RegExp(R,"g");let D=o.SelectionService=class extends b.Disposable{constructor(T,j,B,F,Y,H,z,V,G){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=F,this._coreService=Y,this._mouseService=H,this._optionsService=z,this._renderService=V,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const Y=T[0]<j[0]?T[0]:j[0],H=T[0]<j[0]?j[0]:T[0];for(let z=T[1];z<=j[1];z++){const V=B.translateBufferLineToString(z,!0,Y,H);F.push(V)}}else{const Y=T[1]===j[1]?j[0]:void 0;F.push(B.translateBufferLineToString(T[1],!0,T[0],Y));for(let H=T[1]+1;H<=j[1]-1;H++){const z=B.lines.get(H),V=B.translateBufferLineToString(H,!0);z!=null&&z.isWrapped?F[F.length-1]+=V:F.push(V)}if(T[1]!==j[1]){const H=B.lines.get(j[1]),z=B.translateBufferLineToString(j[1],!0,0,j[0]);H&&H.isWrapped?F[F.length-1]+=z:F.push(z)}}return F.map((Y=>Y.replace(N," "))).join(S.isWindows?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(B&&F&&j)&&this._areCoordsInSelection(j,B,F)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!B||!F)&&this._areCoordsInSelection([T,j],B,F)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]<B[1]||j[1]===B[1]&&T[1]===j[1]&&T[0]>=j[0]&&T[0]<B[0]||j[1]<B[1]&&T[1]===B[1]&&T[0]<B[0]||j[1]<B[1]&&T[1]===j[1]&&T[0]>=j[0]}_selectWordAtCursor(T,j){var Y,H;const B=(H=(Y=this._linkifier.currentLink)==null?void 0:Y.link)==null?void 0:H.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return S.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const F=B.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const F=(0,_.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let F=0;j>=F;F++){const Y=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:Y>1&&j!==F&&(B+=Y-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const Y=this._bufferService.buffer,H=Y.lines.get(T[1]);if(!H)return;const z=Y.translateBufferLineToString(T[1],!1);let V=this._convertViewportColToCharacterIndex(H,T[0]),G=V;const X=T[0]-V;let K=0,L=0,M=0,O=0;if(z.charAt(V)===" "){for(;V>0&&z.charAt(V-1)===" ";)V--;for(;G<z.length&&z.charAt(G+1)===" ";)G++}else{let Q=T[0],re=T[0];H.getWidth(Q)===0&&(K++,Q--),H.getWidth(re)===2&&(L++,re++);const ae=H.getString(re).length;for(ae>1&&(O+=ae-1,G+=ae-1);Q>0&&V>0&&!this._isCharWordSeparator(H.loadCell(Q-1,this._workCell));){H.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,V-=Z-1),V--,Q--}for(;re<H.length&&G+1<z.length&&!this._isCharWordSeparator(H.loadCell(re+1,this._workCell));){H.loadCell(re+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,re++):Z>1&&(O+=Z-1,G+=Z-1),G++,re++}}G++;let $=V+X-K+M,U=Math.min(this._bufferService.cols,G-V+K+L-M-O);if(j||z.slice(V,G).trim()!==""){if(B&&$===0&&H.getCodePoint(0)!==32){const Q=Y.lines.get(T[1]-1);if(Q&&H.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const ae=this._bufferService.cols-re.start;$-=ae,U+=ae}}}if(F&&$+U===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const Q=Y.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&(U+=re.length)}}return{start:$,length:U}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,w.IMouseService),p(6,E.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],D)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(D,T,j,B){var F,Y=arguments.length,H=Y<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(D,T,j,B);else for(var z=D.length-1;z>=0;z--)(F=D[z])&&(H=(Y<3?F(H):Y>3?F(T,j,H):F(T,j))||H);return Y>3&&H&&Object.defineProperty(T,j,H),H},p=this&&this.__param||function(D,T){return function(j,B){T(j,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),w=c(844),C=c(2585),b=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),x=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],F=T[j/6%6|0],Y=T[j%6];D.push({css:_.channels.toCss(B,F,Y),rgba:_.channels.toRgba(B,F,Y)})}for(let j=0;j<24;j++){const B=8+10*j;D.push({css:_.channels.toCss(B,B,B),rgba:_.channels.toRgba(B,B,B)})}return D})());let R=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:S,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(S,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=N(D.foreground,b),T.background=N(D.background,S),T.cursor=N(D.cursor,x),T.cursorAccent=N(D.cursorAccent,y),T.selectionBackgroundTransparent=N(D.selectionBackground,E),T.selectionBackgroundOpaque=_.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=_.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?N(D.selectionForeground,_.NULL_COLOR):void 0,T.selectionForeground===_.NULL_COLOR&&(T.selectionForeground=void 0),_.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=_.color.opacity(T.selectionBackgroundTransparent,.3)),_.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=_.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(D.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(D.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(D.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(D.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(D.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(D.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(D.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(D.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<j;B++)T.ansi[B+16]=N(D.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,T){if(D!==void 0)try{return _.css.toColor(D)}catch{}return T}o.ThemeService=R=f([p(0,C.IOptionsService)],R)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const w=new Array(v);for(let C=0;C<Math.min(v,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let w=this._length;w<v;w++)this._array[w]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,w){this._array[this._getCyclicIndex(v)]=w}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,w,...C){if(w){for(let b=v;b<this._length-w;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+w)];this._length-=w,this.onDeleteEmitter.fire({index:v,amount:w})}for(let b=this._length-1;b>=v;b--)this._array[this._getCyclicIndex(b+C.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<C.length;b++)this._array[this._getCyclicIndex(v+b)]=C[b];if(C.length&&this.onInsertEmitter.fire({index:v,amount:C.length}),this._length+C.length>this._maxLength){const b=this._length+C.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=C.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,w,C){if(!(w<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let S=w-1;S>=0;S--)this.set(v+S+C,this.get(v+S));const b=v+w+C-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<w;b++)this.set(v+b+C,this.get(v+b))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}o.CircularList=d},1439:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=p<=1?f[_]:f[_]&&c(f[_],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var _,v,w,C,b;function S(y){const E=y.toString(16);return E.length<2?"0"+E:E}function x(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,R,N,D){return D!==void 0?`#${S(E)}${S(R)}${S(N)}${S(D)}`:`#${S(E)}${S(R)}${S(N)}`},y.toRgba=function(E,R,N,D=255){return(E<<24|R<<16|N<<8|D)>>>0},y.toColor=function(E,R,N,D){return{css:y.toCss(E,R,N,D),rgba:y.toRgba(E,R,N,D)}}})(_||(o.channels=_={})),(function(y){function E(R,N){return d=Math.round(255*N),[c,f,p]=b.toChannels(R.rgba),{css:_.toCss(c,f,p,d),rgba:_.toRgba(c,f,p,d)}}y.blend=function(R,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=R.rgba>>24&255,F=R.rgba>>16&255,Y=R.rgba>>8&255;return c=B+Math.round((D-B)*d),f=F+Math.round((T-F)*d),p=Y+Math.round((j-Y)*d),{css:_.toCss(c,f,p),rgba:_.toRgba(c,f,p)}},y.isOpaque=function(R){return(255&R.rgba)==255},y.ensureContrastRatio=function(R,N,D){const T=b.ensureContrastRatio(R.rgba,N.rgba,D);if(T)return _.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(R){const N=(255|R.rgba)>>>0;return[c,f,p]=b.toChannels(N),{css:_.toCss(c,f,p),rgba:N}},y.opacity=E,y.multiplyOpacity=function(R,N){return d=255&R.rgba,E(R,d*N/255)},y.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(v||(o.color=v={})),(function(y){let E,R;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),_.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),_.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(c,f,p,d);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,p,d),css:N}}})(w||(o.css=w={})),(function(y){function E(R,N,D){const T=R/255,j=N/255,B=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},y.relativeLuminance2=E})(C||(o.rgb=C={})),(function(y){function E(N,D,T){const j=N>>24&255,B=N>>16&255,F=N>>8&255;let Y=D>>24&255,H=D>>16&255,z=D>>8&255,V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));for(;V<T&&(Y>0||H>0||z>0);)Y-=Math.max(0,Math.ceil(.1*Y)),H-=Math.max(0,Math.ceil(.1*H)),z-=Math.max(0,Math.ceil(.1*z)),V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));return(Y<<24|H<<16|z<<8|255)>>>0}function R(N,D,T){const j=N>>24&255,B=N>>16&255,F=N>>8&255;let Y=D>>24&255,H=D>>16&255,z=D>>8&255,V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));for(;V<T&&(Y<255||H<255||z<255);)Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),H=Math.min(255,H+Math.ceil(.1*(255-H))),z=Math.min(255,z+Math.ceil(.1*(255-z))),V=x(C.relativeLuminance2(Y,H,z),C.relativeLuminance2(j,B,F));return(Y<<24|H<<16|z<<8|255)>>>0}y.blend=function(N,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,j=D>>16&255,B=D>>8&255,F=N>>24&255,Y=N>>16&255,H=N>>8&255;return c=F+Math.round((T-F)*d),f=Y+Math.round((j-Y)*d),p=H+Math.round((B-H)*d),_.toRgba(c,f,p)},y.ensureContrastRatio=function(N,D,T){const j=C.relativeLuminance(N>>8),B=C.relativeLuminance(D>>8);if(x(j,B)<T){if(B<j){const H=E(N,D,T),z=x(j,C.relativeLuminance(H>>8));if(z<T){const V=R(N,D,T);return z>x(j,C.relativeLuminance(V>>8))?H:V}return H}const F=R(N,D,T),Y=x(j,C.relativeLuminance(F>>8));if(Y<T){const H=E(N,D,T);return Y>x(j,C.relativeLuminance(H>>8))?F:H}return F}},y.reduceLuminance=E,y.increaseLuminance=R,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(b||(o.rgba=b={})),o.toPaddedHex=S,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),_=c(7866),v=c(744),w=c(7302),C=c(6975),b=c(8460),S=c(1753),x=c(1480),y=c(7994),E=c(9282),R=c(5435),N=c(5981),D=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((F=>{var Y;(Y=this._onScrollApi)==null||Y.fire(F.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(F){for(const Y in F)this.optionsService.options[Y]=F[Y]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(F)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((Y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((Y,H)=>this._inputHandler.parse(Y,H)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,Y){this._writeBuffer.write(F,Y)}writeSync(F,Y){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,Y)}input(F,Y=!0){this.coreService.triggerDataEvent(F,Y)}resize(F,Y){isNaN(F)||isNaN(Y)||(F=Math.max(F,v.MINIMUM_COLS),Y=Math.max(Y,v.MINIMUM_ROWS),this._bufferService.resize(F,Y))}scroll(F,Y=!1){this._bufferService.scroll(F,Y)}scrollLines(F,Y,H){this._bufferService.scrollLines(F,Y,H)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const Y=F-this._bufferService.buffer.ydisp;Y!==0&&this.scrollLines(Y)}registerEscHandler(F,Y){return this._inputHandler.registerEscHandler(F,Y)}registerDcsHandler(F,Y){return this._inputHandler.registerDcsHandler(F,Y)}registerCsiHandler(F,Y){return this._inputHandler.registerCsiHandler(F,Y)}registerOscHandler(F,Y){return this._inputHandler.registerOscHandler(F,Y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const Y=this.optionsService.rawOptions.windowsPty;Y&&Y.buildNumber!==void 0&&Y.buildNumber!==void 0?F=Y.backend==="conpty"&&Y.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const Y of F)Y.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const p=[];for(let d=0;d<this._listeners.length;d++)p.push(this._listeners[d]);for(let d=0;d<p.length;d++)p[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c((p=>f.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var $,U=arguments.length,Q=U<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)($=K[re])&&(Q=(U<3?$(Q):U>3?$(L,M,Q):$(L,M))||Q);return U>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),w=c(844),C=c(482),b=c(8437),S=c(8460),x=c(643),y=c(511),E=c(3734),R=c(2585),N=c(1480),D=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function Y(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var H;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(o.WindowsOptionsReportType=H={}));let z=0;class V extends w.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,$,U,Q,re,ae,Z=new v.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=$,this._optionsService=U,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=ae,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ee.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((P,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ee,payload:ne})})),this._parser.setPrintHandler(((P,ee,ne)=>this.print(P,ee,ne))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new D.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new D.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new D.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new D.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new D.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new D.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new D.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new D.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new D.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new D.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((P,ee)=>this.requestStatusString(P,ee))))}_preserveStack(L,M,O,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=$}_logSlowResolvingAsync(L){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,$=this._activeBuffer.x,U=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;$=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>F&&(Q=this._parseStack.position+F)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(P=>String.fromCharCode(P))).join("")}"`),typeof L=="string"?L.split("").map((P=>P.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(L.length,F))),re||this._dirtyRowTracker.clearRange(),L.length>F)for(let P=Q;P<L.length;P+=F){const ee=P+F<L.length?P+F:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(P,ee),this._parseBuffer):this._utf8Decoder.decode(L.subarray(P,ee),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ne))return this._preserveStack($,U,ne,P),this._logSlowResolvingAsync(O),O}else if(!re){const P=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack($,U,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===$&&this._activeBuffer.y===U||this._onCursorMove.fire();const ae=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(ae,this._bufferService.rows-1))}print(L,M,O){let $,U;const Q=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ee=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let ge=this._parser.precedingJoinState;for(let he=M;he<O;++he){if($=L[he],$<127&&Q){const Ee=Q[String.fromCharCode($)];Ee&&($=Ee.charCodeAt(0))}const ye=this._unicodeService.charProperties($,ge);U=N.UnicodeService.extractWidth(ye);const be=N.UnicodeService.extractShouldJoin(ye),ke=be?N.UnicodeService.extractWidth(ge):0;if(ge=ye,re&&this._onA11yChar.fire((0,C.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-ke>ae){if(Z){const Ee=ne;let Ce=this._activeBuffer.x-ke;for(this._activeBuffer.x=ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ke>0&&ne instanceof b.BufferLine&&ne.copyCellsFrom(Ee,Ce,0,ke,!1);Ce<ae;)Ee.setCellFromCodepoint(Ce++,0,1,ee)}else if(this._activeBuffer.x=ae-1,U===2)continue}if(be&&this._activeBuffer.x){const Ee=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-Ee,$,U);for(let Ce=U-ke;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(P&&(ne.insertCells(this._activeBuffer.x,U-ke,this._activeBuffer.getNullCell(ee)),ne.getWidth(ae-1)===2&&ne.setCellFromCodepoint(ae-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,$,U,ee),U>0)for(;--U;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=ge,this._activeBuffer.x<ae&&O-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!Y(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,$=!1,U=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),U),$&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O<this._bufferService.rows;O++)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;M--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;M--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const O=L.params[0]||1,$=N.UnicodeService.extractWidth(M),U=this._activeBuffer.x-$,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),re=new Uint32Array(Q.length*O);let ae=0;for(let P=0;P<Q.length;){const ee=Q.codePointAt(P)||0;re[ae++]=ee,P+=ee>65535?2:1}let Z=ae;for(let P=1;P<O;++P)re.copyWithin(Z,0,ae),Z+=ae;return this.print(re,0,Z),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const O=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:U}=this._coreMouseService,Q=this._coreService,{buffers:re,cols:ae}=this._bufferService,{active:Z,alt:P}=re,ee=this._optionsService.rawOptions,ne=be=>be?1:2,ge=L.params[0];return he=ge,ye=M?ge===2?4:ge===4?ne(Q.modes.insertMode):ge===12?3:ge===20?ne(ee.convertEol):0:ge===1?ne(O.applicationCursorKeys):ge===3?ee.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ge===6?ne(O.origin):ge===7?ne(O.wraparound):ge===8?3:ge===9?ne($==="X10"):ge===12?ne(ee.cursorBlink):ge===25?ne(!Q.isCursorHidden):ge===45?ne(O.reverseWraparound):ge===66?ne(O.applicationKeypad):ge===67?4:ge===1e3?ne($==="VT200"):ge===1002?ne($==="DRAG"):ge===1003?ne($==="ANY"):ge===1004?ne(O.sendFocus):ge===1005?4:ge===1006?ne(U==="SGR"):ge===1015?4:ge===1016?ne(U==="SGR_PIXELS"):ge===1048?1:ge===47||ge===1047||ge===1049?ne(Z===P):ge===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${he};${ye}$y`),!0;var he,ye}_updateAttrColor(L,M,O,$,U){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,$,U])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const $=[0,0,-1,0,0,0];let U=0,Q=0;do{if($[Q+U]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let ae=0;do $[1]===5&&(U=1),$[Q+ae+1+U]=re[ae];while(++ae<re.length&&ae+Q+1+U<$.length);break}if($[1]===5&&Q+U>=2||$[1]===2&&Q+U>=5)break;$[1]&&(U=1)}while(++Q+M<L.length&&Q+U<$.length);for(let re=2;re<$.length;++re)$[re]===-1&&($[re]=0);switch($[0]){case 38:O.fg=this._updateAttrColor(O.fg,$[1],$[3],$[4],$[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,$[1],$[3],$[4],$[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,$[1],$[3],$[4],$[5])}return Q}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=b.DEFAULT_ATTR_DATA.fg,L.bg=b.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const $=this._curAttrData;for(let U=0;U<M;U++)O=L.params[U],O>=30&&O<=37?($.fg&=-50331904,$.fg|=16777216|O-30):O>=40&&O<=47?($.bg&=-50331904,$.bg|=16777216|O-40):O>=90&&O<=97?($.fg&=-50331904,$.fg|=16777224|O-90):O>=100&&O<=107?($.bg&=-50331904,$.bg|=16777224|O-100):O===0?this._processSGR0($):O===1?$.fg|=134217728:O===3?$.bg|=67108864:O===4?($.fg|=268435456,this._processUnderline(L.hasSubParams(U)?L.getSubParams(U)[0]:1,$)):O===5?$.fg|=536870912:O===7?$.fg|=67108864:O===8?$.fg|=1073741824:O===9?$.fg|=2147483648:O===2?$.bg|=134217728:O===21?this._processUnderline(2,$):O===22?($.fg&=-134217729,$.bg&=-134217729):O===23?$.bg&=-67108865:O===24?($.fg&=-268435457,this._processUnderline(0,$)):O===25?$.fg&=-536870913:O===27?$.fg&=-67108865:O===28?$.fg&=-1073741825:O===29?$.fg&=2147483647:O===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):O===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?U+=this._extractColor(L,U,$):O===53?$.bg|=1073741824:O===55?$.bg&=-1073741825:O===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):O===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!Y(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const $=O.shift(),U=O.shift();if(/^\d+$/.exec($)){const Q=parseInt($);if(X(Q))if(U==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)(U);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let $;const U=O.findIndex((Q=>Q.startsWith("id=")));return U!==-1&&($=O[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let $=0;$<O.length&&!(M>=this._specialColors.length);++$,++M)if(O[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const U=(0,j.parseColor)(O[$]);U&&this._onColor.fire([{type:1,index:this._specialColors[M],color:U}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let $=0;$<O.length;++$)if(/^\d+$/.exec(O[$])){const U=parseInt(O[$]);X(U)&&M.push({type:2,index:U})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(B[L[0]],_.CHARSETS[L[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const O=this._activeBuffer.ybase+this._activeBuffer.y+M,$=this._activeBuffer.lines.get(O);$&&($.fill(L),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const O=this._bufferService.buffer,$=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${U}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=V;let G=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(z=K,K=L,L=z),K<this.start&&(this.start=K),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}G=f([p(0,R.IBufferService)],G)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,_){this._data[p]||(this._data[p]={}),this._data[p][d]=_}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,_,v){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,_,v)}get(f,p,d,_){var v;return(v=this._data.get(f,p))==null?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,p){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let p=0,d=this._array.length-1;for(;d>=p;){let _=p+d>>1;const v=this._getKey(this._array[_]);if(v>f)d=_-1;else{if(!(v<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}p=_+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let w=0,C=0,b=v.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),S=v.timeRemaining(),1.5*C>S)return b-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-w))}ms`),void this._start();b=S}this.clear()}}class d extends p{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=d==null?void 0:d.get(p.cols-1),v=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);v&&_&&(v.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),_=c(8437),v=c(4634),w=c(511),C=c(643),b=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,E){this._hasScrollback=x,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&x<this._rows}_getCorrectBufferLength(x){if(!this._hasScrollback)return x;const y=x+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<x)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(x,E);let D=0;if(this._rows<y)for(let T=this._rows;T<y;T++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(x,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(x,E)));else for(let T=this._rows;T>y;T--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const T=this.lines.length-N;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(x,E);this._cols=x,this._rows=y,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const E=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,v.reflowLargerCreateNewLayout)(this.lines,E);(0,v.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(x,y,R.countRemoved)}}_reflowLargerAdjustViewport(x,y,E){const R=this.getNullCell(_.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(x,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),R=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),j.unshift(T);const B=this.ybase+this.y;if(B>=D&&B<D+j.length)continue;const F=j[j.length-1].getTrimmedLength(),Y=(0,v.reflowSmallerGetNewLineLengths)(j,this._cols,x),H=Y.length-j.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const V=[];for(let O=0;O<H;O++){const $=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);V.push($)}V.length>0&&(R.push({start:D+j.length+N,newLines:V}),N+=V.length),j.push(...V);let G=Y.length-1,X=Y[G];X===0&&(G--,X=Y[G]);let K=j.length-H-1,L=F;for(;K>=0;){const O=Math.min(L,X);if(j[G]===void 0)break;if(j[G].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(G--,X=Y[G]),L-=O,L===0){K--;const $=Math.max(K,0);L=(0,v.getWrappedLineTrimmedLength)(j,$,this._cols)}}for(let O=0;O<j.length;O++)Y[O]<x&&j[O].setCell(Y[O],E);let M=H-z;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+N)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+y-1)}if(R.length>0){const D=[],T=[];for(let G=0;G<this.lines.length;G++)T.push(this.lines.get(G));const j=this.lines.length;let B=j-1,F=0,Y=R[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let H=0;for(let G=Math.min(this.lines.maxLength-1,j+N-1);G>=0;G--)if(Y&&Y.start>B+H){for(let X=Y.newLines.length-1;X>=0;X--)this.lines.set(G--,Y.newLines[X]);G++,D.push({index:B+1,amount:Y.newLines.length}),H+=Y.newLines.length,Y=R[++F]}else this.lines.set(G,T[B--]);let z=0;for(let G=D.length-1;G>=0;G--)D[G].index+=z,this.lines.onInsertEmitter.fire(D[G]),z+=D[G].amount;const V=Math.max(0,j+N-this.lines.maxLength);V>0&&this.lines.onTrimEmitter.fire(V)}}translateBufferLineToString(x,y,E=0,R){const N=this.lines.get(x);return N?N.translateToString(y,E,R):""}getWrappedRangeForLine(x){let y=x,E=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(x){for(x!=null?this.tabs[x]||(x=this.prevStop(x)):(this.tabs={},x=0);x<this._cols;x+=this._optionsService.rawOptions.tabStopWidth)this.tabs[x]=!0}prevStop(x){for(x==null&&(x=this.x);!this.tabs[--x]&&x>0;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x<this._cols;);return x>=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===x&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].dispose(),this.markers.splice(x--,1);this._isClearing=!1}addMarker(x){const y=new b.Marker(x);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let v=0;class w{constructor(b,S,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=S||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){const S=this._data[3*b+0],x=2097151&S;return[this._data[3*b+1],2097152&S?this._combined[b]:x?(0,_.stringFromCodePoint)(x):"",S>>22,2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):x]}set(b,S){this._data[3*b+1]=S[d.CHAR_DATA_ATTR_INDEX],S[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=S[1],this._data[3*b+0]=2097152|b|S[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&S}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b]:2097151&S?(0,_.stringFromCodePoint)(2097151&S):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,S){return v=3*b,S.content=this._data[v+0],S.fg=this._data[v+1],S.bg=this._data[v+2],2097152&S.content&&(S.combinedData=this._combined[b]),268435456&S.bg&&(S.extended=this._extendedAttrs[b]),S}setCell(b,S){2097152&S.content&&(this._combined[b]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=S.content,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}setCellFromCodepoint(b,S,x,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=S|x<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,S,x){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,_.stringFromCodePoint)(S):2097151&y?(this._combined[b]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(S),y&=-2097152,y|=2097152):y=S|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*b+0]=y}insertCells(b,S,x){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length-b){const y=new p.CellData;for(let E=this.length-b-S-1;E>=0;--E)this.setCell(b+S+E,this.loadCell(b+E,y));for(let E=0;E<S;++E)this.setCell(b+E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,x)}deleteCells(b,S,x){if(b%=this.length,S<this.length-b){const y=new p.CellData;for(let E=0;E<this.length-b-S;++E)this.setCell(b+E,this.loadCell(b+S+E,y));for(let E=this.length-S;E<this.length;++E)this.setCell(E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,x)}replaceCells(b,S,x,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.isProtected(b)||this.setCell(b,x),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.setCell(b++,x)}resize(b,S){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const x=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,S)}else{this._data=this._data.subarray(0,x);const y=Object.keys(this._combined);for(let R=0;R<y.length;R++){const N=parseInt(y[R],10);N>=b&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let R=0;R<E.length;R++){const N=parseInt(E[R],10);N>=b&&delete this._extendedAttrs[N]}}return this.length=b,4*x*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,S=!1){if(S)for(let x=0;x<this.length;++x)this.isProtected(x)||this.setCell(x,b);else{this._combined={},this._extendedAttrs={};for(let x=0;x<this.length;++x)this.setCell(x,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const S in b._combined)this._combined[S]=b._combined[S];this._extendedAttrs={};for(const S in b._extendedAttrs)this._extendedAttrs[S]=b._extendedAttrs[S];this.isWrapped=b.isWrapped}clone(){const b=new w(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const S in this._combined)b._combined[S]=this._combined[S];for(const S in this._extendedAttrs)b._extendedAttrs[S]=this._extendedAttrs[S];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,S,x,y,E){const R=b._data;if(E)for(let D=y-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}else for(let D=0;D<y;D++){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}const N=Object.keys(b._combined);for(let D=0;D<N.length;D++){const T=parseInt(N[D],10);T>=S&&(this._combined[T-S+x]=b._combined[T])}}translateToString(b,S,x,y){S=S??0,x=x??this.length,b&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;S<x;){const R=this._data[3*S+0],N=2097151&R,D=2097152&R?this._combined[S]:N?(0,_.stringFromCodePoint)(N):d.WHITESPACE_CELL_CHAR;if(E+=D,y)for(let T=0;T<D.length;++T)y.push(S);S+=R>>22||1}return y&&y.push(S),E}}o.BufferLine=w},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const _=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,v=f[p+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,_,v){const w=[];for(let C=0;C<f.length-1;C++){let b=C,S=f.get(++b);if(!S.isWrapped)continue;const x=[f.get(C)];for(;b<f.length&&S.isWrapped;)x.push(S),S=f.get(++b);if(_>=C&&_<b){C+=x.length-1;continue}let y=0,E=c(x,y,p),R=1,N=0;for(;R<x.length;){const T=c(x,R,p),j=T-N,B=d-E,F=Math.min(j,B);x[y].copyCellsFrom(x[R],N,E,F,!1),E+=F,E===d&&(y++,E=0),N+=F,N===T&&(R++,N=0),E===0&&y!==0&&x[y-1].getWidth(d-1)===2&&(x[y].copyCellsFrom(x[y-1],d-1,E++,1,!1),x[y-1].setCell(d-1,v))}x[y].replaceCells(E,d,v);let D=0;for(let T=x.length-1;T>0&&(T>y||x[T].getTrimmedLength()===0);T--)D++;D>0&&(w.push(C+x.length-D),w.push(D)),C+=x.length-1}return w},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let _=0,v=p[_],w=0;for(let C=0;C<f.length;C++)if(v===C){const b=p[++_];f.onDeleteEmitter.fire({index:C-w,amount:b}),C+=b-1,w+=b,v=p[++_]}else d.push(C);return{layout:d,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,p){const d=[];for(let _=0;_<p.length;_++)d.push(f.get(p[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=p.length},o.reflowSmallerGetNewLineLengths=function(f,p,d){const _=[],v=f.map(((S,x)=>c(f,x,p))).reduce(((S,x)=>S+x));let w=0,C=0,b=0;for(;b<v;){if(v-b<d){_.push(v-b);break}w+=d;const S=c(f,C,p);w>S&&(w-=S,C++);const x=f[C].getWidth(w-1)===2;x&&w--;const y=x?d-1:d;_.push(y),b+=y}return _},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class _ extends p.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=_},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const C=new _;return C.setFromCharData(w),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const b=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const S=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(b-55296)+S-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,_,v,w){const C={type:0,cancel:!1,key:void 0},b=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:C.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(C.key=f.C0.ESC+C.key);break;case 9:if(d.shiftKey){C.key=f.C0.ESC+"[Z";break}C.key=f.C0.HT,C.cancel=!0;break;case 13:C.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,C.cancel=!0;break;case 27:C.key=f.C0.ESC,d.altKey&&(C.key=f.C0.ESC+f.C0.ESC),C.cancel=!0;break;case 37:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"D",C.key===f.C0.ESC+"[1;3D"&&(C.key=f.C0.ESC+(v?"b":"[1;5D"))):C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"C",C.key===f.C0.ESC+"[1;3C"&&(C.key=f.C0.ESC+(v?"f":"[1;5C"))):C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"A",v||C.key!==f.C0.ESC+"[1;3A"||(C.key=f.C0.ESC+"[1;5A")):C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"B",v||C.key!==f.C0.ESC+"[1;3B"||(C.key=f.C0.ESC+"[1;5B")):C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(C.key=f.C0.ESC+"[2~");break;case 46:C.key=b?f.C0.ESC+"[3;"+(b+1)+"~":f.C0.ESC+"[3~";break;case 36:C.key=b?f.C0.ESC+"[1;"+(b+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:C.key=b?f.C0.ESC+"[1;"+(b+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?C.type=2:d.ctrlKey?C.key=f.C0.ESC+"[5;"+(b+1)+"~":C.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?C.type=3:d.ctrlKey?C.key=f.C0.ESC+"[6;"+(b+1)+"~":C.key=f.C0.ESC+"[6~";break;case 112:C.key=b?f.C0.ESC+"[1;"+(b+1)+"P":f.C0.ESC+"OP";break;case 113:C.key=b?f.C0.ESC+"[1;"+(b+1)+"Q":f.C0.ESC+"OQ";break;case 114:C.key=b?f.C0.ESC+"[1;"+(b+1)+"R":f.C0.ESC+"OR";break;case 115:C.key=b?f.C0.ESC+"[1;"+(b+1)+"S":f.C0.ESC+"OS";break;case 116:C.key=b?f.C0.ESC+"[15;"+(b+1)+"~":f.C0.ESC+"[15~";break;case 117:C.key=b?f.C0.ESC+"[17;"+(b+1)+"~":f.C0.ESC+"[17~";break;case 118:C.key=b?f.C0.ESC+"[18;"+(b+1)+"~":f.C0.ESC+"[18~";break;case 119:C.key=b?f.C0.ESC+"[19;"+(b+1)+"~":f.C0.ESC+"[19~";break;case 120:C.key=b?f.C0.ESC+"[20;"+(b+1)+"~":f.C0.ESC+"[20~";break;case 121:C.key=b?f.C0.ESC+"[21;"+(b+1)+"~":f.C0.ESC+"[21~";break;case 122:C.key=b?f.C0.ESC+"[23;"+(b+1)+"~":f.C0.ESC+"[23~";break;case 123:C.key=b?f.C0.ESC+"[24;"+(b+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!w||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?C.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(C.key=f.C0.US),d.key==="@"&&(C.key=f.C0.NUL)):d.keyCode===65&&(C.type=1);else{const S=p[d.keyCode],x=S==null?void 0:S[d.shiftKey?1:0];if(x)C.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(y);d.shiftKey&&(E=E.toUpperCase()),C.key=f.C0.ESC+E}else if(d.keyCode===32)C.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),C.key=f.C0.ESC+y,C.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?C.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?C.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?C.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?C.key=f.C0.DEL:d.keyCode===219?C.key=f.C0.ESC:d.keyCode===220?C.key=f.C0.FS:d.keyCode===221&&(C.key=f.C0.GS)}return C}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let _=f;_<p;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?f[d++]=1024*(this._interim-55296)+v-56320+65536:(f[d++]=this._interim,f[d++]=v),this._interim=0}for(let v=_;v<p;++v){const w=c.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=p)return this._interim=w,d;const C=c.charCodeAt(v);56320<=C&&C<=57343?f[d++]=1024*(w-55296)+C-56320+65536:(f[d++]=w,f[d++]=C)}else w!==65279&&(f[d++]=w)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,_,v,w,C=0,b=0,S=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)R<<=6,R|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-D;for(;S<j;){if(S>=p)return 0;if(N=c[S++],(192&N)!=128){S--,E=!0;break}this.interim[D++]=N,R<<=6,R|=63&N}E||(T===2?R<128?S--:f[C++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(f[C++]=R):R<65536||R>1114111||(f[C++]=R)),this.interim.fill(0)}const x=p-4;let y=S;for(;y<p;){for(;!(!(y<x)||128&(d=c[y])||128&(_=c[y+1])||128&(v=c[y+2])||128&(w=c[y+3]));)f[C++]=d,f[C++]=_,f[C++]=v,f[C++]=w,y+=4;if(d=c[y++],d<128)f[C++]=d;else if((224&d)==192){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(b=(31&d)<<6|63&_,b<128){y--;continue}f[C++]=b}else if((240&d)==224){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(b=(15&d)<<12|(63&_)<<6|63&v,b<2048||b>=55296&&b<=57343||b===65279)continue;f[C++]=b}else if((248&d)==240){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,C;if(w=c[y++],(192&w)!=128){y--;continue}if(b=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&w,b<65536||b>1114111)continue;f[C++]=b}}return C}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let v=0;v<p.length;++v)_.fill(0,p[v][0],p[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?_[v]:(function(w,C){let b,S=0,x=C.length-1;if(w<C[0][0]||w>C[x][1])return!1;for(;x>=S;)if(b=S+x>>1,w>C[b][1])S=b+1;else{if(!(w<C[b][0]))return!0;x=b-1}return!1})(v,d)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,w){let C=this.wcwidth(v),b=C===0&&w!==0;if(b){const S=f.UnicodeService.extractWidth(w);S===0?b=!1:S>C&&(C=S)}return f.UnicodeService.createPropertyValue(0,C,b)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w)}_innerWrite(v=0,w=!0){const C=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],S=this._action(b,w);if(S){const y=E=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(C,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,_){const v=d.toString(16),w=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const w=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/w*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/w*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,w=[0,0,0];for(let C=0;C<3;++C){const b=parseInt(_.slice(v*C,v*C+v),16);w[C]=v===1?b<<4:v===2?b:v===3?b>>4:b>>8}return w}},o.toRgbString=function(d,_=16){const[v,w,C]=d;return`rgb:${p(v,_)}/${p(w,_)}/${p(C,_)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const b=this._handlers[w];return b.push(C),{dispose:()=>{const S=b.indexOf(C);S!==-1&&b.splice(S,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,b){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(w,C,b);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,C,b))}unhook(w,C=!0){if(this._active.length){let b=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,b=C,x=this._stack.fallThrough,this._stack.paused=!1),!x&&b===!1){for(;S>=0&&(b=this._active[S].unhook(w),b!==!0);S--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,b;S--}for(;S>=0;S--)if(b=this._active[S].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const v=new p.Params;v.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=v,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():v,this._data="",this._hitLimit=!1}put(w,C,b){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,C,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((b=>(this._params=v,this._data="",this._hitLimit=!1,b)));return this._params=v,this._data="",this._hitLimit=!1,C}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),_=c(6351);class v{constructor(S){this.table=new Uint8Array(S)}setDefault(S,x){this.table.fill(S<<4|x)}add(S,x,y,E){this.table[x<<8|S]=y<<4|E}addMany(S,x,y,E){for(let R=0;R<S.length;R++)this.table[x<<8|S[R]]=y<<4|E}}o.TransitionTable=v;const w=160;o.VT500_TRANSITION_TABLE=(function(){const b=new v(4095),S=Array.apply(null,Array(256)).map(((D,T)=>T)),x=(D,T)=>S.slice(D,T),y=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const R=x(0,14);let N;for(N in b.setDefault(1,0),b.addMany(y,0,2,0),R)b.addMany([24,26,153,154],N,3,0),b.addMany(x(128,144),N,3,0),b.addMany(x(144,152),N,3,0),b.add(156,N,0,0),b.add(27,N,11,1),b.add(157,N,4,8),b.addMany([152,158,159],N,0,7),b.add(155,N,11,3),b.add(144,N,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(x(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(x(64,127),3,7,0),b.addMany(x(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(x(48,60),4,8,4),b.addMany(x(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(x(32,64),6,0,6),b.add(127,6,0,6),b.addMany(x(64,127),6,0,0),b.addMany(x(32,48),3,9,5),b.addMany(x(32,48),5,9,5),b.addMany(x(48,64),5,0,6),b.addMany(x(64,127),5,7,0),b.addMany(x(32,48),4,9,5),b.addMany(x(32,48),1,9,2),b.addMany(x(32,48),2,9,2),b.addMany(x(48,127),2,10,0),b.addMany(x(48,80),1,10,0),b.addMany(x(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(x(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(x(28,32),9,0,9),b.addMany(x(32,48),9,9,12),b.addMany(x(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(x(32,128),11,0,11),b.addMany(x(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(x(28,32),10,0,10),b.addMany(x(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(x(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(x(28,32),12,0,12),b.addMany(x(32,48),12,9,12),b.addMany(x(48,64),12,0,11),b.addMany(x(64,127),12,12,13),b.addMany(x(64,127),10,12,13),b.addMany(x(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(w,0,2,0),b.add(w,8,5,8),b.add(w,6,0,6),b.add(w,11,0,11),b.add(w,13,13,13),b})();class C extends f.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,x=[64,126]){let y=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=S.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<S.intermediates.length;++R){const N=S.intermediates.charCodeAt(R);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=E,y}identToString(S){const x=[];for(;S;)x.push(String.fromCharCode(255&S)),S>>=8;return x.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,x){const y=this._identifier(S,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,x){this._executeHandlers[S.charCodeAt(0)]=x}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,x){const y=this._identifier(S);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,x){return this._dcsParser.registerHandler(this._identifier(S),x)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,x){return this._oscParser.registerHandler(S,x)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,x,y,E,R){this._parseStack.state=S,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(S,x,y){let E,R=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(R=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=S[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<x;++T){switch(R=S[T],N=this._transitions.table[this.currentState<<8|(R<160?R:w)],N>>4){case 2:for(let H=T+1;;++H){if(H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}if(++H>=x||(R=S[H])<32||R>126&&R<w){this._printHandler(S,T,H),T=H-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|R];let B=j?j.length-1:-1;for(;B>=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<x&&(R=S[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const F=this._escHandlers[this._collect<<8|R];let Y=F?F.length-1:-1;for(;Y>=0&&(E=F[Y](),E!==!0);Y--)if(E instanceof Promise)return this._preserveStack(4,F,Y,N,T),E;Y<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let H=T+1;;++H)if(H>=x||(R=S[H])===24||R===26||R===27||R>127&&R<w){this._dcsParser.put(S,T,H),T=H-1;break}break;case 14:if(E=this._dcsParser.unhook(R!==24&&R!==26),E)return this._preserveStack(6,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let H=T+1;;H++)if(H>=x||(R=S[H])<32||R>127&&R<w){this._oscParser.put(S,T,H),T=H-1;break}break;case 6:if(E=this._oscParser.end(R!==24&&R!==26),E)return this._preserveStack(5,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}o.EscapeSequenceParser=C},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(v),{dispose:()=>{const C=w.indexOf(v);C!==-1&&w.splice(C,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(_,v,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,v,w))}start(){this.reset(),this._state=1}put(_,v,w){if(this._state!==3){if(this._state===1)for(;v<w;){const C=_[v++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-v>0&&this._put(_,v,w)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,b=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=v,b=this._stack.fallThrough,this._stack.paused=!1),!b&&w===!1){for(;C>=0&&(w=this._active[C].end(_),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,v,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,v}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const w=d[v];if(Array.isArray(w))for(let C=0;C<w.length;++C)_.addSubParam(w[C]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&(d[_]=this._subParams.slice(v,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,w=v[_-1];v[_-1]=~w?Math.min(10*w+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){f=p;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,_){return this._line.translateToString(p,d,_)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=_},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let C=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(b,this))}resize(b,S){this.cols=b,this.rows=S,this.buffers.resize(b,S),this._onResize.fire({cols:b,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,S=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=x.getBlankLine(b,S),this._cachedBlankLine=y),y.isWrapped=S;const E=x.ybase+x.scrollTop,R=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;R===x.lines.length-1?N?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(R+1,0,y.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=R-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(R,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(b,S,x){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(S||this._onScroll.fire(y.ydisp))}};o.BufferService=C=f([p(0,w.IOptionsService)],C)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function C(y,E){let R=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(R|=64,R|=y.action):(R|=3&y.button,4&y.button&&(R|=64),8&y.button&&(R|=128),y.action===32?R|=32:y.action!==0||E||(R|=3)),R}const b=String.fromCharCode,S={DEFAULT:y=>{const E=[C(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.x};${y.y}${E}`}};let x=o.CoreMouseService=class extends v.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(w))this.addProtocol(R,w[R]);for(const R of Object.keys(S))this.addEncoding(R,S[R]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,R){if(R){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),w=c(2585),C=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends v.Disposable{constructor(x,y,E){super(),this._bufferService=x,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}reset(){this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}triggerDataEvent(x,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=S=f([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],S)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),_=c(6106);let v=0,w=0;class C extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new b(x);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,E){let R=0,N=0;for(const D of this._decorations.getKeyIterator(y))R=D.options.x??0,N=R+(D.options.width??1),x>=R&&x<N&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(x,y,E,R){this._decorations.forEachByKey(y,(N=>{v=N.options.x??0,w=v+(N.options.width??1),x>=v&&x<w&&(!E||(N.options.layer??"bottom")===E)&&R(N)}))}}o.DecorationService=C;class b extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(x){super(),this.options=x,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=x.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(...v){this._entries=new Map;for(const[w,C]of v)this.set(w,C)}set(v,w){const C=this._entries.get(v);return this._entries.set(v,w),C}forEach(v){for(const[w,C]of this._entries.entries())v(w,C)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const w=(0,p.getServiceDependencies)(_).sort(((S,x)=>S.index-x.index)),C=[];for(const S of w){const x=this._services.get(S.id);if(!x)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${S.id}.`);C.push(x)}const b=w.length>0?w[0].index:v.length;if(v.length!==b)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${b+1} conflicts with ${v.length} static arguments`);return new _(...v,...C)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,C=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let S=0;S<b.length;S++)typeof b[S]=="function"&&(b[S]=b[S]())}_log(b,S,x){this._evalLazyOptionalParams(x),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...x)}trace(b,...S){var x;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.trace.bind(this._optionsService.options.logger))??console.log,b,S)}debug(b,...S){var x;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.debug.bind(this._optionsService.options.logger))??console.log,b,S)}info(b,...S){var x;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.info.bind(this._optionsService.options.logger))??console.info,b,S)}warn(b,...S){var x;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.warn.bind(this._optionsService.options.logger))??console.warn,b,S)}error(b,...S){var x;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.error.bind(this._optionsService.options.logger))??console.error,b,S)}};o.LogService=C=f([p(0,_.IOptionsService)],C),o.setTraceLogger=function(b){w=b},o.traceCall=function(b,S,x){if(typeof x.value!="function")throw new Error("not supported");const y=x.value;x.value=function(...E){if(w.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);w.trace(`GlyphRenderer#${y.name}(${E.map((N=>JSON.stringify(N))).join(", ")})`);const R=y.apply(this,E);return w.trace(`GlyphRenderer#${y.name} return`,R),R}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends p.Disposable{constructor(C){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const S in C)if(S in b)try{const x=C[S];b[S]=this._sanitizeAndValidateOption(S,x)}catch(x){console.error(x)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,b){return this.onOptionChange((S=>{S===C&&b(this.rawOptions[C])}))}onMultipleOptionChange(C,b){return this.onOptionChange((S=>{C.indexOf(S)!==-1&&b()}))}_setupOptions(){const C=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},b=(S,x)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);x=this._sanitizeAndValidateOption(S,x),this.rawOptions[S]!==x&&(this.rawOptions[S]=x,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const x={get:C.bind(this,S),set:b.bind(this,S)};Object.defineProperty(this.options,S,x)}}_sanitizeAndValidateOption(C,b){switch(C){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[C]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${C}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=_.includes(b)?b:o.DEFAULT_OPTIONS[C];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${C} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${C} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=v},2660:function(u,o,c){var f=this&&this.__decorate||function(v,w,C,b){var S,x=arguments.length,y=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,w,C,b);else for(var E=v.length-1;E>=0;E--)(S=v[E])&&(y=(x<3?S(y):x>3?S(w,C,y):S(w,C))||y);return x>3&&y&&Object.defineProperty(w,C,y),y},p=this&&this.__param||function(v,w){return function(C,b){w(C,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let _=o.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const w=this._bufferService.buffer;if(v.id===void 0){const E=w.addMarker(w.ybase+w.y),R={data:v,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const C=v,b=this._getEntryIdKey(C),S=this._entriesWithId.get(b);if(S)return this.addLineToLink(S.id,w.ybase+w.y),S.id;const x=w.addMarker(w.ybase+w.y),y={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(v,w){const C=this._dataByLinkId.get(v);if(C&&C.lines.every((b=>b.line!==w))){const b=this._bufferService.buffer.addMarker(w);C.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(C,b)))}}getLinkData(v){var w;return(w=this._dataByLinkId.get(v))==null?void 0:w.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,w){const C=v.lines.indexOf(w);C!==-1&&(v.lines.splice(C,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};o.OscLinkService=_=f([p(0,d.IBufferService)],_)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(_,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,b,S){b[c]===b?b[f].push({id:C,index:S}):(b[f]=[{id:C,index:S}],b[c]=b)})(d,_,w)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,w,C=!1){return(16777215&v)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const v=new p.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let w=0,C=0;const b=v.length;for(let S=0;S<b;++S){let x=v.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=b)return w+this.wcwidth(x);const R=v.charCodeAt(S);56320<=R&&R<=57343?x=1024*(x-55296)+R-56320+65536:w+=this.wcwidth(R)}const y=this.charProperties(x,C);let E=d.extractWidth(y);d.extractShouldJoin(y)&&(E-=d.extractWidth(C)),w+=E,C=y}return w}charProperties(v,w){return this._activeProvider.charProperties(v,w)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),_=a(7975),v=a(7090),w=["cols","rows"];class C extends f.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],y=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:x.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(S){if(w.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const x in S)this._publicOptions[x]=S[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,x=!0){this._core.input(S,x)}resize(S,x){this._verifyIntegers(S,x),this._core.resize(S,x)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,x,y){this._verifyIntegers(S,x,y),this._core.select(S,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,x){this._verifyIntegers(S,x),this._core.selectLines(S,x)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,x){this._core.write(S,x)}writeln(S,x){this._core.write(S),this._core.write(`\r +`,x)}paste(S){this._core.paste(S)}refresh(S,x){this._verifyIntegers(S,x),this._core.refresh(S,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const x of S)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const x of S)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=C})(),l})()))})(dp)),dp.exports}var fB=hB();function kb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function dB({runId:e}){const t=q.useRef(null);return q.useEffect(()=>{const n=t.current;if(!n)return;const r=new fB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:'ui-monospace, "SF Mono", Menlo, Consolas, monospace',scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new uB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const _=await FN(e,o);if(u)return;if(_.dataBase64&&r.write(kb(_.dataBase64)),o=_.nextOffset,_.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=AT(e,_=>{if(u)return;const v=kb(_.dataBase64);!c&&_.offset===o?(r.write(v),o+=v.length):_.offset+v.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),m.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const ea="__uncommitted__";function pB({state:e}){return!e||e.loading?m.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?m.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?m.jsx(oB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):m.jsx(gC,{diff:e.payload.diff}):m.jsx("div",{className:"diff-empty",children:"No changes."})}function gB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?m.jsx(mB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):m.jsx(_B,{experiment:e,project:t})}function mB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=q.useState(null),[u,o]=q.useState(!1),c=q.useRef(null),f=n&&t.find(w=>w.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=w=>{const C=t.findIndex(b=>b.id===w);return C===-1?t.length:t.length-C},_=q.useRef(null);q.useEffect(()=>{if(_.current===null){_.current=new Set(t.map(C=>C.id));return}const w=t.find(C=>!_.current.has(C.id));for(const C of t)_.current.add(C.id);w&&r(w.id)},[t,r]),q.useEffect(()=>{if(!u)return;const w=C=>{var b;(b=c.current)!=null&&b.contains(C.target)||o(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[u]);async function v(){if(f){l(null);try{await ZS(f.id)}catch(w){l(w instanceof Error?w.message:String(w))}}}return m.jsxs("div",{className:"term-view",children:[m.jsxs("div",{className:"term-bar",children:[m.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),m.jsx("span",{style:{flex:1}}),a&&m.jsx("span",{className:"error",children:a}),p&&m.jsxs("button",{className:"btn sm ghost",onClick:()=>void v(),children:[m.jsx(BA,{size:13}),"Stop"]}),t.length>0&&f&&m.jsxs("div",{className:"run-history",ref:c,children:[m.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(w=>!w),children:[m.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),m.jsx(Vo,{status:f.status}),m.jsx(cs,{size:14,className:"run-picker-chev"})]}),u&&m.jsx("div",{className:"history-menu",children:t.map(w=>m.jsxs("button",{className:`history-item ${w.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(w.id),o(!1)},children:[m.jsxs("span",{className:"run-label",children:["Run ",d(w.id)]}),m.jsx(Vo,{status:w.status}),m.jsx("span",{className:"when",children:Sa(w.createdAt)})]},w.id))})]})]}),m.jsx("div",{className:"term-fill",children:f?m.jsx(dB,{runId:f.id},f.id):m.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function _B({experiment:e,project:t}){const[n,r]=q.useState(null),[a,l]=q.useState(null),[u,o]=q.useState(null),[c,f]=q.useState(null),[p,d]=q.useState({}),_=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function v(){l(null);try{const[C,b]=await Promise.all([PN(e.id),By(e.projectId)]);r(C),o(b),f(S=>{var y;return S!==null?S:b.diff.trim()!==""&&b.experimentId===e.id?ea:((y=C[0])==null?void 0:y.sha)??null})}catch(C){l(C instanceof Error?C.message:String(C))}}q.useEffect(()=>{n===null&&!a&&v()},[n,a,e.id]),q.useEffect(()=>{const C=setInterval(()=>{By(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(C)},[e.projectId]),q.useEffect(()=>{var C;c===ea&&u&&!_&&f(((C=n==null?void 0:n[0])==null?void 0:C.sha)??null)},[c,u,_,n]),q.useEffect(()=>{if(!c||c===ea||p[c])return;const C=c;d(b=>({...b,[C]:{loading:!0}})),UN(e.id,C).then(b=>d(S=>({...S,[C]:{loading:!1,payload:b}}))).catch(b=>d(S=>({...S,[C]:{loading:!1,error:b instanceof Error?b.message:String(b)}})))},[c,p,e.id]);const w=!_&&((n==null?void 0:n.length)??0)===0;return m.jsx("div",{className:"drawer",children:m.jsx("div",{className:"drawer-body",children:m.jsxs("div",{className:"drawer-section",children:[m.jsxs("div",{className:"changes-branch",children:[m.jsx("span",{className:"ctl-label",children:"Branch"}),m.jsx(qL,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?m.jsx("div",{className:"error",children:a}):n===null?m.jsx("div",{className:"changes-note",children:"Loading changes…"}):w?m.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"commit-picker",children:[m.jsx("span",{className:"ctl-label",children:"Commit"}),c===ea&&m.jsx("span",{className:"uncommitted-dot"}),m.jsxs("select",{className:"input sm",value:c??"",onChange:C=>f(C.target.value),children:[_&&m.jsx("option",{value:ea,children:"● Uncommitted changes"}),n.map(C=>m.jsxs("option",{value:C.sha,children:[C.sha.slice(0,7)," — ",C.subject]},C.sha))]}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void v(),children:m.jsx(Sg,{size:14})})]}),m.jsx("div",{style:{marginTop:10},children:c===ea&&u?u.truncated?m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):m.jsx(gC,{diff:u.diff}):c?m.jsx(pB,{state:p[c]}):m.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function vB(e,t){return Sw(e,pw(t))}function yB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=q.useState(null),[o,c]=q.useState(null),[f,p]=q.useState(!0),[d,_]=q.useState(0),v=/\.(md|mdx|markdown)$/i.test(t),[w,C]=q.useState(!1);q.useEffect(()=>{let y=!1;return p(!0),$N(e,t,{sessionId:n,ref:r}).then(E=>{y||(u(E),c(null))}).catch(E=>{y||c(E.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const b=q.useMemo(()=>l&&!l.notFound?vB(l.content,t):null,[l,t]),S=l&&!l.notFound&&l.content?l.content.split(` +`).length-(l.content.endsWith(` +`)?1:0):0,x=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return m.jsxs("div",{className:"file-view",children:[m.jsxs("div",{className:"file-view-header",children:[m.jsx(KA,{size:13,style:{flexShrink:0}}),m.jsx("code",{className:"file-view-path",title:t,children:t}),r&&m.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),v&&m.jsx("button",{className:`icon-btn ${w?"active":""}`,title:w?"Rendered view":"Source view","aria-label":w?"Rendered view":"Source view",onClick:()=>C(y=>!y),children:m.jsx(FA,{size:13})}),m.jsx("button",{className:"icon-btn",title:"Reload file","aria-label":"Reload file",onClick:()=>_(y=>y+1),children:f?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),m.jsx("div",{className:"file-view-body",children:o?m.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?m.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?m.jsx("div",{className:"file-view-note",children:x(l)}):m.jsxs(m.Fragment,{children:[!r&&n&&l.root==="clone"&&m.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),v&&!w?m.jsx("div",{className:"file-view-md",children:m.jsx(qo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):m.jsxs("div",{className:"file-view-codewrap",children:[S>0&&m.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:S},(y,E)=>E+1).join(` +`)}),m.jsx("pre",{className:"file-view-code",children:m.jsx("code",{children:b})})]}),l.truncated&&m.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function bB({projectName:e,onHome:t,onCollapse:n}){return m.jsxs("div",{className:"rail-brand",children:[m.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[m.jsx(jo,{size:15}),m.jsx("span",{className:"brand-project",children:e})]}),n&&m.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:m.jsx(YS,{size:15})})]})}function SB({onDone:e}){const[t,n]=q.useState(0),[r,a]=q.useState(null),[l,u]=q.useState(null),[o,c]=q.useState(null),[f,p]=q.useState(null),[d,_]=q.useState(!1),v=C=>{_(!0),Promise.allSettled([wg(C).then(a),nx().then(u),ex().then(c),gT().then(p)]).finally(()=>_(!1))};q.useEffect(()=>v(!1),[]);const w=()=>{_T((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return m.jsx("div",{className:"home onboarding",children:m.jsx("div",{className:"home-inner",children:t===0?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 1 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Your coding agents"}),m.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),m.jsx("div",{className:"onb-cards",children:r===null?m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(C=>m.jsx(wB,{h:C},C.id))}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===1?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 2 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),m.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),m.jsx("div",{className:"onb-cards",children:m.jsx(CB,{git:l,onUpdate:u})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[m.jsx(jo,{size:12})," Back"]}),m.jsxs("button",{className:"btn ghost",onClick:()=>v(!1),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===2?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 3 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),m.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),m.jsx("div",{className:"onb-cards",children:m.jsx(EB,{dataDir:o,onUpdate:c})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 4 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Usage analytics"}),m.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),m.jsx("div",{className:"onb-cards",children:m.jsx(kB,{telemetry:f,onUpdate:p})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:w,children:["Create your first project ",m.jsx(Ic,{size:13})]})]})]})})})}function xB(e){return e.agentReady?{cls:"st-done",label:"connected"}:e.installed?{cls:"st-starting",label:"not signed in"}:{cls:"st-idle",label:"not detected"}}function wB({h:e}){var r,a;const t=xB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:e.name}),m.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),m.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>xu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):m.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function CB({git:e,onUpdate:t}){const[n,r]=q.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"status-badge st-failed",children:[m.jsx("span",{className:"dot"})," not found"]})]}),m.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),m.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"GitHub"}),m.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"signed in via gh CLI":"not connected"}),m.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&m.jsxs("div",{className:"onb-card-meta",children:["Set ",m.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&m.jsxs("div",{className:"onb-gh-options",children:[m.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),m.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?m.jsxs(m.Fragment,{children:[m.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),m.jsxs("button",{className:"btn ghost",onClick:a,children:[n?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx(yg,{size:12}),n?"Copied":"Copy"]}),m.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):m.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",m.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),m.jsx("div",{className:"onb-gh-or",children:"or"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),m.jsx(Cw,{onSaved:t})]})]})]})}function EB({dataDir:e,onUpdate:t}){const[n,r]=q.useState(""),[a,l]=q.useState(!1),[u,o]=q.useState(!1),[c,f]=q.useState(null);if(q.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:"status-badge st-done",children:[m.jsx(_n,{size:12,strokeWidth:3})," pinned"]})]}),m.jsxs("div",{className:"onb-card-meta",children:["Set by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function _(){if(!(u||!d)){o(!0),f(null);try{t(await eT(p)),l(!1)}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?m.jsx("span",{className:"dot"}):m.jsx(_n,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?m.jsxs(m.Fragment,{children:[m.jsx("input",{className:"mono",type:"text",value:n,onChange:v=>r(v.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&m.jsx("div",{className:"error",style:{marginTop:8},children:c}),m.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[m.jsx("button",{className:"btn primary",onClick:_,disabled:u||!d,children:u?"Saving…":"Use this folder"}),m.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):m.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",m.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function kB({telemetry:e,onUpdate:t}){const[n,r]=q.useState(!1);if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),mT(o).then(t).finally(()=>r(!1)))};return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsxs("div",{children:[m.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),m.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),m.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[m.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?m.jsx(_n,{size:12,strokeWidth:3}):null," On"]}),m.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:m.jsx(_n,{size:12,strokeWidth:3})," Off"]})]})]}),m.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",m.jsx("code",{children:"orx telemetry off"}),"."]}),l&&m.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function Kc(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function Ab(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function AB(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function NB(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function TB({onCreated:e,onCancel:t}){var U;const[n,r]=q.useState("paper"),[a,l]=q.useState("use"),[u,o]=q.useState(""),[c,f]=q.useState(""),[p,d]=q.useState(!1),[_,v]=q.useState("main"),[w,C]=q.useState(!1),[b,S]=q.useState(null),[x,y]=q.useState(""),[E,R]=q.useState([]),[N,D]=q.useState(!1),[T,j]=q.useState(null),[B,F]=q.useState(!1),[Y,H]=q.useState(null),z=q.useRef(0),V=Kc(u),G=!!(c.trim()&&(n==="new"||n==="existing"&&V!==null||n==="paper"&&T!==null&&(u.trim()===""||V!==null))),X=Q=>{var re;o(Q),p||f(((re=Kc(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++z.current;R([]),D(!1),F(!0),H(null);try{const ae=await LN(Q);if(re!==z.current)return;j(ae);const Z=ae.repoUrl?Kc(ae.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(ae.title??"").trim().slice(0,60))}catch(ae){if(re!==z.current)return;H(ae instanceof Error?ae.message:String(ae))}finally{re===z.current&&F(!1)}}function L(){z.current++,j(null),y(""),R([]),H(null),o(""),p||f("")}q.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=AB(Q);if(!re&&Q.length<3){R([]),D(!1);return}const ae=++z.current;re||D(!0);const Z=setTimeout(()=>{if(re){K(re);return}jN(Q).then(P=>{ae===z.current&&R(P)}).catch(P=>{ae===z.current&&(R([]),H(P instanceof Error?P.message:String(P)))}).finally(()=>{ae===z.current&&D(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!G||w)){C(!0),S(null);try{const re=await MN(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!V?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:V.owner,githubRepo:V.repo,baselineBranch:_.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){S(re instanceof Error?re.message:String(re))}finally{C(!1)}}}const O=n==="new"||n==="paper"&&!V,$=m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),m.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),m.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${V?`${V.owner}/${V.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),m.jsxs("label",{children:["Branch",m.jsx("input",{value:_,onChange:Q=>v(Q.target.value),placeholder:"main"})]})]})]});return m.jsxs("form",{className:"form",onSubmit:M,children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),m.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),m.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["GitHub repository",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${V?"ok":""}`,children:V?`${V.owner} / ${V.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),$]}),n==="paper"&&(T===null?m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["Paper",m.jsx("input",{value:x,onChange:Q=>y(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint ${Y?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":Y??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&m.jsx("div",{className:"paper-results",children:E.map(Q=>m.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[m.jsx("span",{className:"title",children:NB(Q.title)}),m.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"paper-pick",children:[m.jsxs("div",{className:"meta",children:[m.jsx("div",{className:"title",children:T.title||T.paperId}),m.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),m.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),m.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${V?"ok":""}`,children:V?`${V.owner} / ${V.repo}`+(T.repoUrl&&((U=Kc(T.repoUrl))==null?void 0:U.repo)===V.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),V?$:m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]}),b&&m.jsx("div",{className:"error",children:b}),m.jsxs("div",{className:"actions",children:[t&&m.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!G||w,children:w?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Nb({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=q.useState(!1),[u,o]=q.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? + +Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await BN(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return m.jsxs("div",{className:"home",children:[m.jsxs("div",{className:"home-inner",children:[m.jsxs("div",{className:"home-brand",children:["Open",m.jsx("span",{children:"Research"})]}),m.jsxs("div",{className:"home-head",children:[m.jsx("h2",{children:"Projects"}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[m.jsx(bg,{size:13})," New project"]})]}),m.jsx("div",{className:"home-list",children:e.length===0?m.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>m.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[m.jsx("span",{className:"name",children:f.name}),m.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&m.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),m.jsxs("span",{className:"time",children:["created ",Sa(f.createdAt)]}),m.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:m.jsx(Gu,{size:14})})]},f.id))})]}),a&&m.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:m.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[m.jsx("h2",{children:"New project"}),m.jsx(TB,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function RB(e){const t=ix(e.backend);return t?[t,rx(e.backend)].filter(Boolean).join(" · "):"—"}function DB({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?m.jsx("div",{className:"empty-state",children:m.jsx("p",{children:"No runs yet."})}):m.jsx("div",{className:"runs-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Run"}),m.jsx("th",{children:"Experiment"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Commit"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Exit"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return m.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[m.jsx("td",{className:"mono",children:Tp(o.id)}),m.jsx("td",{className:"mono",children:l.get(o.experimentId)??Tp(o.experimentId)}),m.jsx("td",{children:m.jsx(Vo,{status:o.status})}),m.jsx("td",{className:"mono",children:RB(o)}),m.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),m.jsx("td",{children:Sa(o.createdAt)}),m.jsx("td",{className:"mono",children:o.exitCode??"—"}),m.jsx("td",{children:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:m.jsx($u,{size:14})}),c&&m.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ft(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var MB={value:()=>{}};function mh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new pu(n)}function pu(e){this._=e}function jB(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}pu.prototype=mh.prototype={constructor:pu,on:function(e,t){var n=this._,r=jB(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=LB(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Tb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Tb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pu(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function LB(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Tb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=MB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ig="http://www.w3.org/1999/xhtml";const Rb={svg:"http://www.w3.org/2000/svg",xhtml:ig,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _h(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rb.hasOwnProperty(t)?{space:Rb[t],local:e}:e}function OB(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ig&&t.documentElement.namespaceURI===ig?t.createElement(e):t.createElementNS(n,e)}}function BB(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _C(e){var t=_h(e);return(t.local?BB:OB)(t)}function IB(){}function Em(e){return e==null?IB:function(){return this.querySelector(e)}}function zB(e){typeof e!="function"&&(e=Em(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=new Array(u),c,f,p=0;p<u;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),o[p]=f);return new jn(r,this._parents)}function HB(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function FB(){return[]}function vC(e){return e==null?FB:function(){return this.querySelectorAll(e)}}function PB(e){return function(){return HB(e.apply(this,arguments))}}function UB(e){typeof e=="function"?e=PB(e):e=vC(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&(r.push(e.call(c,c.__data__,f,u)),a.push(c));return new jn(r,a)}function yC(e){return function(){return this.matches(e)}}function bC(e){return function(t){return t.matches(e)}}var $B=Array.prototype.find;function GB(e){return function(){return $B.call(this.children,e)}}function qB(){return this.firstElementChild}function VB(e){return this.select(e==null?qB:GB(typeof e=="function"?e:bC(e)))}var YB=Array.prototype.filter;function WB(){return Array.from(this.children)}function XB(e){return function(){return YB.call(this.children,e)}}function KB(e){return this.selectAll(e==null?WB:XB(typeof e=="function"?e:bC(e)))}function ZB(e){typeof e!="function"&&(e=yC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new jn(r,this._parents)}function SC(e){return new Array(e.length)}function QB(){return new jn(this._enter||this._groups.map(SC),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JB(e){return function(){return e}}function eI(e,t,n,r,a,l){for(var u=0,o,c=t.length,f=l.length;u<f;++u)(o=t[u])?(o.__data__=l[u],r[u]=o):n[u]=new Tu(e,l[u]);for(;u<c;++u)(o=t[u])&&(a[u]=o)}function tI(e,t,n,r,a,l,u){var o,c,f=new Map,p=t.length,d=l.length,_=new Array(p),v;for(o=0;o<p;++o)(c=t[o])&&(_[o]=v=u.call(c,c.__data__,o,t)+"",f.has(v)?a[o]=c:f.set(v,c));for(o=0;o<d;++o)v=u.call(e,l[o],o,l)+"",(c=f.get(v))?(r[o]=c,c.__data__=l[o],f.delete(v)):n[o]=new Tu(e,l[o]);for(o=0;o<p;++o)(c=t[o])&&f.get(_[o])===c&&(a[o]=c)}function nI(e){return e.__data__}function iI(e,t){if(!arguments.length)return Array.from(this,nI);var n=t?tI:eI,r=this._parents,a=this._groups;typeof e!="function"&&(e=JB(e));for(var l=a.length,u=new Array(l),o=new Array(l),c=new Array(l),f=0;f<l;++f){var p=r[f],d=a[f],_=d.length,v=rI(e.call(p,p&&p.__data__,f,r)),w=v.length,C=o[f]=new Array(w),b=u[f]=new Array(w),S=c[f]=new Array(_);n(p,d,C,b,S,v,t);for(var x=0,y=0,E,R;x<w;++x)if(E=C[x]){for(x>=y&&(y=x+1);!(R=b[y])&&++y<w;);E._next=R||null}}return u=new jn(u,r),u._enter=o,u._exit=c,u}function rI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sI(){return new jn(this._exit||this._groups.map(SC),this._parents)}function aI(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function oI(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),o=new Array(a),c=0;c<u;++c)for(var f=n[c],p=r[c],d=f.length,_=o[c]=new Array(d),v,w=0;w<d;++w)(v=f[w]||p[w])&&(_[w]=v);for(;c<a;++c)o[c]=n[c];return new jn(o,this._parents)}function lI(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function cI(e){e||(e=uI);function t(d,_){return d&&_?e(d.__data__,_.__data__):!d-!_}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],o=u.length,c=a[l]=new Array(o),f,p=0;p<o;++p)(f=u[p])&&(c[p]=f);c.sort(t)}return new jn(a,this._parents).order()}function uI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function hI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fI(){return Array.from(this)}function dI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function pI(){let e=0;for(const t of this)++e;return e}function gI(){return!this.node()}function mI(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,o;l<u;++l)(o=a[l])&&e.call(o,o.__data__,l,a);return this}function _I(e){return function(){this.removeAttribute(e)}}function vI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yI(e,t){return function(){this.setAttribute(e,t)}}function bI(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function SI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function wI(e,t){var n=_h(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?vI:_I:typeof t=="function"?n.local?xI:SI:n.local?bI:yI)(n,t))}function xC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CI(e){return function(){this.style.removeProperty(e)}}function EI(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kI(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function AI(e,t,n){return arguments.length>1?this.each((t==null?CI:typeof t=="function"?kI:EI)(e,t,n??"")):pa(this.node(),e)}function pa(e,t){return e.style.getPropertyValue(t)||xC(e).getComputedStyle(e,null).getPropertyValue(t)}function NI(e){return function(){delete this[e]}}function TI(e,t){return function(){this[e]=t}}function RI(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function DI(e,t){return arguments.length>1?this.each((t==null?NI:typeof t=="function"?RI:TI)(e,t)):this.node()[e]}function wC(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new CC(e)}function CC(e){this._node=e,this._names=wC(e.getAttribute("class")||"")}CC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function EC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function kC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function MI(e){return function(){EC(this,e)}}function jI(e){return function(){kC(this,e)}}function LI(e,t){return function(){(t.apply(this,arguments)?EC:kC)(this,e)}}function OI(e,t){var n=wC(e+"");if(arguments.length<2){for(var r=km(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?LI:t?MI:jI)(n,t))}function BI(){this.textContent=""}function II(e){return function(){this.textContent=e}}function zI(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function HI(e){return arguments.length?this.each(e==null?BI:(typeof e=="function"?zI:II)(e)):this.node().textContent}function FI(){this.innerHTML=""}function PI(e){return function(){this.innerHTML=e}}function UI(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $I(e){return arguments.length?this.each(e==null?FI:(typeof e=="function"?UI:PI)(e)):this.node().innerHTML}function GI(){this.nextSibling&&this.parentNode.appendChild(this)}function qI(){return this.each(GI)}function VI(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function YI(){return this.each(VI)}function WI(e){var t=typeof e=="function"?e:_C(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function XI(){return null}function KI(e,t){var n=typeof e=="function"?e:_C(e),r=t==null?XI:typeof t=="function"?t:Em(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ZI(){var e=this.parentNode;e&&e.removeChild(this)}function QI(){return this.each(ZI)}function JI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function e7(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t7(e){return this.select(e?e7:JI)}function n7(e){return arguments.length?this.property("__data__",e):this.node().__data__}function i7(e){return function(t){e.call(this,t,this.__data__)}}function r7(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function s7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function a7(e,t,n){return function(){var r=this.__on,a,l=i7(t);if(r){for(var u=0,o=r.length;u<o;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function o7(e,t,n){var r=r7(e+""),a,l=r.length,u;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,f=o.length,p;c<f;++c)for(a=0,p=o[c];a<l;++a)if((u=r[a]).type===p.type&&u.name===p.name)return p.value}return}for(o=t?a7:s7,a=0;a<l;++a)this.each(o(r[a],t,n));return this}function AC(e,t,n){var r=xC(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function l7(e,t){return function(){return AC(this,e,t)}}function c7(e,t){return function(){return AC(this,e,t.apply(this,arguments))}}function u7(e,t){return this.each((typeof t=="function"?c7:l7)(e,t))}function*h7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var NC=[null];function jn(e,t){this._groups=e,this._parents=t}function dl(){return new jn([[document.documentElement]],NC)}function f7(){return this}jn.prototype=dl.prototype={constructor:jn,select:zB,selectAll:UB,selectChild:VB,selectChildren:KB,filter:ZB,data:iI,enter:QB,exit:sI,join:aI,merge:oI,selection:f7,order:lI,sort:cI,call:hI,nodes:fI,node:dI,size:pI,empty:gI,each:mI,attr:wI,style:AI,property:DI,classed:OI,text:HI,html:$I,raise:qI,lower:YI,append:WI,insert:KI,remove:QI,clone:t7,datum:n7,on:o7,dispatch:u7,[Symbol.iterator]:h7};function An(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],NC)}function d7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xn(e,t){if(e=d7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const p7={passive:!1},Zo={capture:!0,passive:!1};function pp(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function TC(e){var t=e.document.documentElement,n=An(e).on("dragstart.drag",ua,Zo);"onselectstart"in t?n.on("selectstart.drag",ua,Zo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RC(e,t){var n=e.document.documentElement,r=An(e).on("dragstart.drag",null);t&&(r.on("click.drag",ua,Zo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zc=e=>()=>e;function rg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}rg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function g7(e){return!e.ctrlKey&&!e.button}function m7(){return this.parentNode}function _7(e,t){return t??{x:e.x,y:e.y}}function v7(){return navigator.maxTouchPoints||"ontouchstart"in this}function DC(){var e=g7,t=m7,n=_7,r=v7,a={},l=mh("start","drag","end"),u=0,o,c,f,p,d=0;function _(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",b).on("touchmove.drag",S,p7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,R){if(!(p||!e.call(this,E,R))){var N=y(this,t.call(this,E,R),E,R,"mouse");N&&(An(E.view).on("mousemove.drag",w,Zo).on("mouseup.drag",C,Zo),TC(E.view),pp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function w(E){if(ua(E),!f){var R=E.clientX-o,N=E.clientY-c;f=R*R+N*N>d}a.mouse("drag",E)}function C(E){An(E.view).on("mousemove.drag mouseup.drag",null),RC(E.view,f),ua(E),a.mouse("end",E)}function b(E,R){if(e.call(this,E,R)){var N=E.changedTouches,D=t.call(this,E,R),T=N.length,j,B;for(j=0;j<T;++j)(B=y(this,D,E,R,N[j].identifier,N[j]))&&(pp(E),B("start",E,N[j]))}}function S(E){var R=E.changedTouches,N=R.length,D,T;for(D=0;D<N;++D)(T=a[R[D].identifier])&&(ua(E),T("drag",E,R[D]))}function x(E){var R=E.changedTouches,N=R.length,D,T;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),D=0;D<N;++D)(T=a[R[D].identifier])&&(pp(E),T("end",E,R[D]))}function y(E,R,N,D,T,j){var B=l.copy(),F=Xn(j||N,R),Y,H,z;if((z=n.call(E,new rg("beforestart",{sourceEvent:N,target:_,identifier:T,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:B}),D))!=null)return Y=z.x-F[0]||0,H=z.y-F[1]||0,function V(G,X,K){var L=F,M;switch(G){case"start":a[T]=V,M=u++;break;case"end":delete a[T],--u;case"drag":F=Xn(K||X,R),M=u;break}B.call(G,E,new rg(G,{sourceEvent:X,subject:z,target:_,identifier:T,active:M,x:F[0]+Y,y:F[1]+H,dx:F[0]-L[0],dy:F[1]-L[1],dispatch:B}),D)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Zc(!!E),_):e},_.container=function(E){return arguments.length?(t=typeof E=="function"?E:Zc(E),_):t},_.subject=function(E){return arguments.length?(n=typeof E=="function"?E:Zc(E),_):n},_.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Zc(!!E),_):r},_.on=function(){var E=l.on.apply(l,arguments);return E===l?_:E},_.clickDistance=function(E){return arguments.length?(d=(E=+E)*E,_):Math.sqrt(d)},_}function Am(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function MC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pl(){}var Qo=.7,Ru=1/Qo,ha="\\s*([+-]?\\d+)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",y7=/^#([0-9a-f]{3,8})$/,b7=new RegExp(`^rgb\\(${ha},${ha},${ha}\\)$`),S7=new RegExp(`^rgb\\(${ui},${ui},${ui}\\)$`),x7=new RegExp(`^rgba\\(${ha},${ha},${ha},${Jo}\\)$`),w7=new RegExp(`^rgba\\(${ui},${ui},${ui},${Jo}\\)$`),C7=new RegExp(`^hsl\\(${Jo},${ui},${ui}\\)$`),E7=new RegExp(`^hsla\\(${Jo},${ui},${ui},${Jo}\\)$`),Db={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Am(pl,rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mb,formatHex:Mb,formatHex8:k7,formatHsl:A7,formatRgb:jb,toString:jb});function Mb(){return this.rgb().formatHex()}function k7(){return this.rgb().formatHex8()}function A7(){return jC(this).formatHsl()}function jb(){return this.rgb().formatRgb()}function rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=y7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Lb(t):n===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=b7.exec(e))?new mn(t[1],t[2],t[3],1):(t=S7.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x7.exec(e))?Qc(t[1],t[2],t[3],t[4]):(t=w7.exec(e))?Qc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=C7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,1):(t=E7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,t[4]):Db.hasOwnProperty(e)?Lb(Db[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Lb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Qc(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function N7(e){return e instanceof pl||(e=rs(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function sg(e,t,n,r){return arguments.length===1?N7(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Am(mn,sg,MC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(es(this.r),es(this.g),es(this.b),Du(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ob,formatHex:Ob,formatHex8:T7,formatRgb:Bb,toString:Bb}));function Ob(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function T7(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bb(){const e=Du(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Du(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function Ib(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function jC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof pl||(e=rs(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n<r)*6:n===l?u=(r-t)/o+2:u=(t-n)/o+4,o/=c<.5?l+a:2-l-a,u*=60):o=c>0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function R7(e,t,n,r){return arguments.length===1?jC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Am(Kn,R7,MC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(gp(e>=240?e-240:e+120,a,r),gp(e,a,r),gp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(zb(this.h),Jc(this.s),Jc(this.l),Du(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Du(this.opacity);return`${e===1?"hsl(":"hsla("}${zb(this.h)}, ${Jc(this.s)*100}%, ${Jc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zb(e){return e=(e||0)%360,e<0?e+360:e}function Jc(e){return Math.max(0,Math.min(1,e||0))}function gp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Nm=e=>()=>e;function D7(e,t){return function(n){return e+n*t}}function M7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function j7(e){return(e=+e)==1?LC:function(t,n){return n-t?M7(t,n,e):Nm(isNaN(t)?n:t)}}function LC(e,t){var n=t-e;return n?D7(e,n):Nm(isNaN(e)?t:e)}const Mu=(function e(t){var n=j7(t);function r(a,l){var u=n((a=sg(a)).r,(l=sg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=LC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function L7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function O7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function B7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=zo(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(o){for(u=0;u<r;++u)l[u]=a[u](o);return l}}function I7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ci(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function z7(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=zo(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var ag=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mp=new RegExp(ag.source,"g");function H7(e){return function(){return e}}function F7(e){return function(t){return e(t)+""}}function OC(e,t){var n=ag.lastIndex=mp.lastIndex=0,r,a,l,u=-1,o=[],c=[];for(e=e+"",t=t+"";(r=ag.exec(e))&&(a=mp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ci(r,a)})),n=mp.lastIndex;return n<t.length&&(l=t.slice(n),o[u]?o[u]+=l:o[++u]=l),o.length<2?c[0]?F7(c[0].x):H7(t):(t=c.length,function(f){for(var p=0,d;p<t;++p)o[(d=c[p]).i]=d.x(f);return o.join("")})}function zo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Nm(t):(n==="number"?ci:n==="string"?(r=rs(t))?(t=r,Mu):OC:t instanceof rs?Mu:t instanceof Date?I7:O7(t)?L7:Array.isArray(t)?B7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?z7:ci)(e,t)}var Hb=180/Math.PI,og={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function BC(e,t,n,r,a,l){var u,o,c;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Hb,skewX:Math.atan(c)*Hb,scaleX:u,scaleY:o}}var eu;function P7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?og:BC(t.a,t.b,t.c,t.d,t.e,t.f)}function U7(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?og:(e=e.matrix,BC(e.a,e.b,e.c,e.d,e.e,e.f))}function IC(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function l(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push("translate(",null,t,null,n);w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d||_)&&v.push("translate("+d+t+_+n)}function u(f,p,d,_){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),_.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ci(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,_){f!==p?_.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ci(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push(a(v)+"scale(",null,",",null,")");w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d!==1||_!==1)&&v.push(a(v)+"scale("+d+","+_+")")}return function(f,p){var d=[],_=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,_),u(f.rotate,p.rotate,d,_),o(f.skewX,p.skewX,d,_),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,_),f=p=null,function(v){for(var w=-1,C=_.length,b;++w<C;)d[(b=_[w]).i]=b.x(v);return d.join("")}}}var $7=IC(P7,"px, ","px)","deg)"),G7=IC(U7,", ",")",")"),q7=1e-12;function Fb(e){return((e=Math.exp(e))+1/e)/2}function V7(e){return((e=Math.exp(e))-1/e)/2}function Y7(e){return((e=Math.exp(2*e))-1)/(e+1)}const gu=(function e(t,n,r){function a(l,u){var o=l[0],c=l[1],f=l[2],p=u[0],d=u[1],_=u[2],v=p-o,w=d-c,C=v*v+w*w,b,S;if(C<q7)S=Math.log(_/f)/t,b=function(D){return[o+D*v,c+D*w,f*Math.exp(t*D*S)]};else{var x=Math.sqrt(C),y=(_*_-f*f+r*C)/(2*f*n*x),E=(_*_-f*f-r*C)/(2*_*n*x),R=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(E*E+1)-E);S=(N-R)/t,b=function(D){var T=D*S,j=Fb(R),B=f/(n*x)*(j*Y7(t*T+R)-V7(R));return[o+B*v,c+B*w,f*j/Fb(t*T+R)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return a.rho=function(l){var u=Math.max(.001,+l),o=u*u,c=o*o;return e(u,o,c)},a})(Math.SQRT2,2,4);var ga=0,Do=0,To=0,zC=1e3,ju,Mo,Lu=0,ss=0,vh=0,el=typeof performance=="object"&&performance.now?performance:Date,HC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return ss||(HC(W7),ss=el.now()+vh)}function W7(){ss=0}function Ou(){this._call=this._time=this._next=null}Ou.prototype=FC.prototype={constructor:Ou,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Tm():+n)+(t==null?0:+t),!this._next&&Mo!==this&&(Mo?Mo._next=this:ju=this,Mo=this),this._call=e,this._time=n,lg()},stop:function(){this._call&&(this._call=null,this._time=1/0,lg())}};function FC(e,t,n){var r=new Ou;return r.restart(e,t,n),r}function X7(){Tm(),++ga;for(var e=ju,t;e;)(t=ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ga}function Pb(){ss=(Lu=el.now())+vh,ga=Do=0;try{X7()}finally{ga=0,Z7(),ss=0}}function K7(){var e=el.now(),t=e-Lu;t>zC&&(vh-=t,Lu=e)}function Z7(){for(var e,t=ju,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ju=n);Mo=e,lg(r)}function lg(e){if(!ga){Do&&(Do=clearTimeout(Do));var t=e-ss;t>24?(e<1/0&&(Do=setTimeout(Pb,e-el.now()-vh)),To&&(To=clearInterval(To))):(To||(Lu=el.now(),To=setInterval(K7,zC)),ga=1,HC(Pb))}}function Ub(e,t,n){var r=new Ou;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var Q7=mh("start","end","cancel","interrupt"),J7=[],PC=0,$b=1,cg=2,mu=3,Gb=4,ug=5,_u=6;function yh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;e9(e,n,{name:t,index:r,group:a,on:Q7,tween:J7,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:PC})}function Rm(e,t){var n=ti(e,t);if(n.state>PC)throw new Error("too late; already scheduled");return n}function pi(e,t){var n=ti(e,t);if(n.state>mu)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=FC(l,0,n.time);function l(f){n.state=$b,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,_,v;if(n.state!==$b)return c();for(p in r)if(v=r[p],v.name===n.name){if(v.state===mu)return Ub(u);v.state===Gb?(v.state=_u,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[p]):+p<t&&(v.state=_u,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[p])}if(Ub(function(){n.state===mu&&(n.state=Gb,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=cg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===cg){for(n.state=mu,a=new Array(_=n.tween.length),p=0,d=-1;p<_;++p)(v=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=v);a.length=d+1}}function o(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=ug,1),d=-1,_=a.length;++d<_;)a[d].call(e,p);n.state===ug&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=_u,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function vu(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>cg&&r.state<ug,r.state=_u,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function t9(e){return this.each(function(){vu(this,e)})}function n9(e,t){var n,r;return function(){var a=pi(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,o=r.length;u<o;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function i9(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=pi(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var o={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=o;break}c===f&&a.push(o)}l.tween=a}}function r9(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ti(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?n9:i9)(n,e,t))}function Dm(e,t,n){var r=e._id;return e.each(function(){var a=pi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ti(a,r).value[t]}}function UC(e,t){var n;return(typeof t=="number"?ci:t instanceof rs?Mu:(n=rs(t))?(t=n,Mu):OC)(e,t)}function s9(e){return function(){this.removeAttribute(e)}}function a9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function l9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function c9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttribute(e):(u=this.getAttribute(e),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function u9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function h9(e,t){var n=_h(e),r=n==="transform"?G7:UC;return this.attrTween(e,typeof t=="function"?(n.local?u9:c9)(n,r,Dm(this,"attr."+e,t)):t==null?(n.local?a9:s9)(n):(n.local?l9:o9)(n,r,t))}function f9(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function d9(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function p9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&d9(e,l)),n}return a._value=t,a}function g9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&f9(e,l)),n}return a._value=t,a}function m9(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_h(e);return this.tween(n,(r.local?p9:g9)(r,t))}function _9(e,t){return function(){Rm(this,e).delay=+t.apply(this,arguments)}}function v9(e,t){return t=+t,function(){Rm(this,e).delay=t}}function y9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_9:v9)(t,e)):ti(this.node(),t).delay}function b9(e,t){return function(){pi(this,e).duration=+t.apply(this,arguments)}}function S9(e,t){return t=+t,function(){pi(this,e).duration=t}}function x9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?b9:S9)(t,e)):ti(this.node(),t).duration}function w9(e,t){if(typeof t!="function")throw new Error;return function(){pi(this,e).ease=t}}function C9(e){var t=this._id;return arguments.length?this.each(w9(t,e)):ti(this.node(),t).ease}function E9(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pi(this,e).ease=n}}function k9(e){if(typeof e!="function")throw new Error;return this.each(E9(this._id,e))}function A9(e){typeof e!="function"&&(e=yC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new Gi(r,this._parents,this._name,this._id)}function N9(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),o=0;o<l;++o)for(var c=t[o],f=n[o],p=c.length,d=u[o]=new Array(p),_,v=0;v<p;++v)(_=c[v]||f[v])&&(d[v]=_);for(;o<r;++o)u[o]=t[o];return new Gi(u,this._parents,this._name,this._id)}function T9(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function R9(e,t,n){var r,a,l=T9(t)?Rm:pi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function D9(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(R9(n,e,t))}function M9(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function j9(){return this.on("end.remove",M9(this._id))}function L9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Em(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var o=r[u],c=o.length,f=l[u]=new Array(c),p,d,_=0;_<c;++_)(p=o[_])&&(d=e.call(p,p.__data__,_,o))&&("__data__"in p&&(d.__data__=p.__data__),f[_]=d,yh(f[_],t,n,_,f,ti(p,n)));return new Gi(l,this._parents,t,n)}function O9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vC(e));for(var r=this._groups,a=r.length,l=[],u=[],o=0;o<a;++o)for(var c=r[o],f=c.length,p,d=0;d<f;++d)if(p=c[d]){for(var _=e.call(p,p.__data__,d,c),v,w=ti(p,n),C=0,b=_.length;C<b;++C)(v=_[C])&&yh(v,t,n,C,_,w);l.push(_),u.push(p)}return new Gi(l,u,t,n)}var B9=dl.prototype.constructor;function I9(){return new B9(this._groups,this._parents)}function z9(e,t){var n,r,a;return function(){var l=pa(this,e),u=(this.style.removeProperty(e),pa(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function $C(e){return function(){this.style.removeProperty(e)}}function H9(e,t,n){var r,a=n+"",l;return function(){var u=pa(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function F9(e,t,n){var r,a,l;return function(){var u=pa(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),pa(this,e))),u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o))}}function P9(e,t){var n,r,a,l="style."+t,u="end."+l,o;return function(){var c=pi(this,e),f=c.on,p=c.value[l]==null?o||(o=$C(t)):void 0;(f!==n||a!==p)&&(r=(n=f).copy()).on(u,a=p),c.on=r}}function U9(e,t,n){var r=(e+="")=="transform"?$7:UC;return t==null?this.styleTween(e,z9(e,r)).on("end.style."+e,$C(e)):typeof t=="function"?this.styleTween(e,F9(e,r,Dm(this,"style."+e,t))).each(P9(this._id,e)):this.styleTween(e,H9(e,r,t),n).on("end.style."+e,null)}function $9(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function G9(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&$9(e,u,n)),r}return l._value=t,l}function q9(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,G9(e,t,n??""))}function V9(e){return function(){this.textContent=e}}function Y9(e){return function(){var t=e(this);this.textContent=t??""}}function W9(e){return this.tween("text",typeof e=="function"?Y9(Dm(this,"text",e)):V9(e==null?"":e+""))}function X9(e){return function(t){this.textContent=e.call(this,t)}}function K9(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&X9(a)),t}return r._value=e,r}function Z9(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,K9(e))}function Q9(){for(var e=this._name,t=this._id,n=GC(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)if(c=u[f]){var p=ti(c,t);yh(c,e,n,f,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Gi(r,this._parents,e,n)}function J9(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var o={value:u},c={value:function(){--a===0&&l()}};n.each(function(){var f=pi(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),f.on=t}),a===0&&l()})}var ez=0;function Gi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function GC(){return++ez}var Fi=dl.prototype;Gi.prototype={constructor:Gi,select:L9,selectAll:O9,selectChild:Fi.selectChild,selectChildren:Fi.selectChildren,filter:A9,merge:N9,selection:I9,transition:Q9,call:Fi.call,nodes:Fi.nodes,node:Fi.node,size:Fi.size,empty:Fi.empty,each:Fi.each,on:D9,attr:h9,attrTween:m9,style:U9,styleTween:q9,text:W9,textTween:Z9,remove:j9,tween:r9,delay:y9,duration:x9,ease:C9,easeVarying:k9,end:J9,[Symbol.iterator]:Fi[Symbol.iterator]};function tz(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nz={time:null,delay:0,duration:250,ease:tz};function iz(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rz(e){var t,n;e instanceof Gi?(t=e._id,e=e._name):(t=GC(),(n=nz).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&yh(c,e,t,f,u,n||iz(c,t));return new Gi(r,this._parents,e,t)}dl.prototype.interrupt=t9;dl.prototype.transition=rz;const tu=e=>()=>e;function sz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Pi(e,t,n){this.k=e,this.x=t,this.y=n}Pi.prototype={constructor:Pi,scale:function(e){return e===1?this:new Pi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bh=new Pi(1,0,0);qC.prototype=Pi.prototype;function qC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bh;return e.__zoom}function _p(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function az(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function oz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qb(){return this.__zoom||bh}function lz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cz(){return navigator.maxTouchPoints||"ontouchstart"in this}function uz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function VC(){var e=az,t=oz,n=uz,r=lz,a=cz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=gu,f=mh("start","zoom","end"),p,d,_,v=500,w=150,C=0,b=10;function S(z){z.property("__zoom",qb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",F).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(z,V,G,X){var K=z.selection?z.selection():z;K.property("__zoom",qb),z!==K?R(z,V,G,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},S.scaleBy=function(z,V,G,X){S.scaleTo(z,function(){var K=this.__zoom.k,L=typeof V=="function"?V.apply(this,arguments):V;return K*L},G,X)},S.scaleTo=function(z,V,G,X){S.transform(z,function(){var K=t.apply(this,arguments),L=this.__zoom,M=G==null?E(K):typeof G=="function"?G.apply(this,arguments):G,O=L.invert(M),$=typeof V=="function"?V.apply(this,arguments):V;return n(y(x(L,$),M,O),K,u)},G,X)},S.translateBy=function(z,V,G,X){S.transform(z,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof G=="function"?G.apply(this,arguments):G),t.apply(this,arguments),u)},null,X)},S.translateTo=function(z,V,G,X,K){S.transform(z,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(bh.translate(O[0],O[1]).scale(M.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof G=="function"?-G.apply(this,arguments):-G),L,u)},X,K)};function x(z,V){return V=Math.max(l[0],Math.min(l[1],V)),V===z.k?z:new Pi(V,z.x,z.y)}function y(z,V,G){var X=V[0]-G[0]*z.k,K=V[1]-G[1]*z.k;return X===z.x&&K===z.y?z:new Pi(z.k,X,K)}function E(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function R(z,V,G,X){z.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),$=G==null?E(O):typeof G=="function"?G.apply(K,L):G,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof V=="function"?V.apply(K,L):V,ae=c(Q.invert($).concat(U/Q.k),re.invert($).concat(U/re.k));return function(Z){if(Z===1)Z=re;else{var P=ae(Z),ee=U/P[2];Z=new Pi(ee,$[0]-P[0]*ee,$[1]-P[1]*ee)}M.zoom(null,Z)}})}function N(z,V,G){return!G&&z.__zooming||new D(z,V)}function D(z,V){this.that=z,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(z,V),this.taps=0}D.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,V){return this.mouse&&z!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var V=An(this.that).datum();f.call(z,this.that,new sz(z,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),V)}};function T(z,...V){if(!e.apply(this,arguments))return;var G=N(this,V).event(z),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(z);if(G.wheel)(G.mouse[0][0]!==L[0]||G.mouse[0][1]!==L[1])&&(G.mouse[1]=X.invert(G.mouse[0]=L)),clearTimeout(G.wheel);else{if(X.k===K)return;G.mouse=[L,X.invert(L)],vu(this),G.start()}Ro(z),G.wheel=setTimeout(M,w),G.zoom("mouse",n(y(x(X,K),G.mouse[0],G.mouse[1]),G.extent,u));function M(){G.wheel=null,G.end()}}function j(z,...V){if(_||!e.apply(this,arguments))return;var G=z.currentTarget,X=N(this,V,!0).event(z),K=An(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),L=Xn(z,G),M=z.clientX,O=z.clientY;TC(z.view),_p(z),X.mouse=[L,this.__zoom.invert(L)],vu(this),X.start();function $(Q){if(Ro(Q),!X.moved){var re=Q.clientX-M,ae=Q.clientY-O;X.moved=re*re+ae*ae>C}X.event(Q).zoom("mouse",n(y(X.that.__zoom,X.mouse[0]=Xn(Q,G),X.mouse[1]),X.extent,u))}function U(Q){K.on("mousemove.zoom mouseup.zoom",null),RC(Q.view,X.moved),Ro(Q),X.event(Q).end()}}function B(z,...V){if(e.apply(this,arguments)){var G=this.__zoom,X=Xn(z.changedTouches?z.changedTouches[0]:z,this),K=G.invert(X),L=G.k*(z.shiftKey?.5:2),M=n(y(x(G,L),X,K),t.apply(this,V),u);Ro(z),o>0?An(this).transition().duration(o).call(R,M,X,z):An(this).call(S.transform,M,X,z)}}function F(z,...V){if(e.apply(this,arguments)){var G=z.touches,X=G.length,K=N(this,V,z.changedTouches.length===X).event(z),L,M,O,$;for(_p(z),M=0;M<X;++M)O=G[M],$=Xn(O,this),$=[$,this.__zoom.invert($),O.identifier],K.touch0?!K.touch1&&K.touch0[2]!==$[2]&&(K.touch1=$,K.taps=0):(K.touch0=$,L=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),L&&(K.taps<2&&(d=$[0],p=setTimeout(function(){p=null},v)),vu(this),K.start())}}function Y(z,...V){if(this.__zooming){var G=N(this,V).event(z),X=z.changedTouches,K=X.length,L,M,O,$;for(Ro(z),L=0;L<K;++L)M=X[L],O=Xn(M,this),G.touch0&&G.touch0[2]===M.identifier?G.touch0[0]=O:G.touch1&&G.touch1[2]===M.identifier&&(G.touch1[0]=O);if(M=G.that.__zoom,G.touch1){var U=G.touch0[0],Q=G.touch0[1],re=G.touch1[0],ae=G.touch1[1],Z=(Z=re[0]-U[0])*Z+(Z=re[1]-U[1])*Z,P=(P=ae[0]-Q[0])*P+(P=ae[1]-Q[1])*P;M=x(M,Math.sqrt(Z/P)),O=[(U[0]+re[0])/2,(U[1]+re[1])/2],$=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2]}else if(G.touch0)O=G.touch0[0],$=G.touch0[1];else return;G.zoom("touch",n(y(M,O,$),G.extent,u))}}function H(z,...V){if(this.__zooming){var G=N(this,V).event(z),X=z.changedTouches,K=X.length,L,M;for(_p(z),_&&clearTimeout(_),_=setTimeout(function(){_=null},v),L=0;L<K;++L)M=X[L],G.touch0&&G.touch0[2]===M.identifier?delete G.touch0:G.touch1&&G.touch1[2]===M.identifier&&delete G.touch1;if(G.touch1&&!G.touch0&&(G.touch0=G.touch1,delete G.touch1),G.touch0)G.touch0[1]=this.__zoom.invert(G.touch0[0]);else if(G.end(),G.taps===2&&(M=Xn(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<b)){var O=An(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return S.wheelDelta=function(z){return arguments.length?(r=typeof z=="function"?z:tu(+z),S):r},S.filter=function(z){return arguments.length?(e=typeof z=="function"?z:tu(!!z),S):e},S.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:tu(!!z),S):a},S.extent=function(z){return arguments.length?(t=typeof z=="function"?z:tu([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),S):t},S.scaleExtent=function(z){return arguments.length?(l[0]=+z[0],l[1]=+z[1],S):[l[0],l[1]]},S.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(z){return arguments.length?(n=z,S):n},S.duration=function(z){return arguments.length?(o=+z,S):o},S.interpolate=function(z){return arguments.length?(c=z,S):c},S.on=function(){var z=f.on.apply(f,arguments);return z===f?S:z},S.clickDistance=function(z){return arguments.length?(C=(z=+z)*z,S):Math.sqrt(C)},S.tapDistance=function(z){return arguments.length?(b=+z,S):b},S}const ei={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],YC=["Enter"," ","Escape"],WC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ma;(function(e){e.Strict="strict",e.Loose="loose"})(ma||(ma={}));var ts;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ts||(ts={}));var nl;(function(e){e.Partial="partial",e.Full="full"})(nl||(nl={}));const XC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Er;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Er||(Er={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var Me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Me||(Me={}));const Vb={[Me.Left]:Me.Right,[Me.Right]:Me.Left,[Me.Top]:Me.Bottom,[Me.Bottom]:Me.Top};function KC(e){return e===null?null:e?"valid":"invalid"}const ZC=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,hz=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mm=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gl=(e,t=[0,0])=>{const{width:n,height:r}=gi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},fz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Mm(a)?a:t.nodeLookup.get(a.id));const o=u?Iu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Sh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xh(n)},ml=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Sh(n,Iu(a)),r=!0)}),r?xh(n):{x:0,y:0,width:0,height:0}},jm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const _ of e.values()){const{measured:v,selectable:w=!0,hidden:C=!1}=_;if(u&&!w||C)continue;const b=v.width??_.width??_.initialWidth??0,S=v.height??_.height??_.initialHeight??0,{x,y}=_.internals.positionAbsolute,E=t2(o,c,f,p,x,y,b,S),R=b*S,N=l&&E>0;(!_.internals.handleBounds||N||E>=R||_.dragging)&&d.push(_)}return d},dz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function pz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{let l;if(t!=null&&t.includeHiddenNodes){const{width:u,height:o}=gi(a);l=u>0&&o>0}else l=!!(a.measured.width&&a.measured.height&&!a.hidden);l&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function gz({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=pz(e,u),c=ml(o),f=Om(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function QC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const v=o.measured.width,w=o.measured.height;v&&w&&(d=[[c,f],[c+v,f+w]])}else o&&os(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const _=os(d)?as(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:_.x-c+(u.measured.width??0)*p[0],y:_.y-f+(u.measured.height??0)*p[1]},positionAbsolute:_}}async function mz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(_=>_.id)),u=[];for(const _ of n){if(_.deletable===!1)continue;const v=l.has(_.id),w=!v&&_.parentId&&u.find(C=>C.id===_.parentId);(v||w)&&u.push(_)}const o=new Set(t.map(_=>_.id)),c=r.filter(_=>_.deletable!==!1),p=dz(u,c);for(const _ of c)o.has(_.id)&&!p.find(w=>w.id===_.id)&&p.push(_);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const _a=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),as=(e={x:0,y:0},t,n)=>({x:_a(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:_a(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function JC(e,t,n){const{width:r,height:a}=gi(n),{x:l,y:u}=n.internals.positionAbsolute;return as(e,[[l,u],[l+r,u+a]],t)}const Yb=(e,t,n)=>e<t?_a(Math.abs(e-t),1,t)/t:e>n?-_a(Math.abs(e-n),1,t)/t:0,Lm=(e,t,n=15,r=40)=>{const a=Yb(e.x,r,t.width-r)*n,l=Yb(e.y,r,t.height-r)*n;return[a,l]},Sh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),hg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),xh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),il=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Iu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},e2=(e,t)=>xh(Sh(hg(e),hg(t))),t2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},zu=(e,t)=>t2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Wb=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),n2=(e,t)=>(n,r)=>{},_l=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?_l(o,u):o},va=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ta(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function _z(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ta(e,n),a=ta(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ta(e.top??e.y??0,n),a=ta(e.bottom??e.y??0,n),l=ta(e.left??e.x??0,t),u=ta(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vz(e,t,n,r,a,l){const{x:u,y:o}=va(e,[t,n,r]),{x:c,y:f}=va({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Om=(e,t,n,r,a,l)=>{const u=_z(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=_a(f,r,a),d=e.x+e.width/2,_=e.y+e.height/2,v=t/2-d*p,w=n/2-_*p,C=vz(e,v,w,p,t,n),b={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-b.left+b.right,y:w-b.top+b.bottom,zoom:p}},rl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function os(e){return e!=null&&e!=="parent"}function gi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function i2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function r2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function Xb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yz(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function bz(e){return{...WC,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=vl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?_l(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Bm=e=>({width:e.offsetWidth,height:e.offsetHeight}),s2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Sz=["INPUT","SELECT","TEXTAREA"];function a2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Sz.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const o2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=o2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},Kb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Bm(u)}})};function l2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function nu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Zb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case Me.Left:return[t-nu(t-r,l),n];case Me.Right:return[t+nu(r-t,l),n];case Me.Top:return[t,n-nu(n-a,l)];case Me.Bottom:return[t,n+nu(a-n,l)]}}function c2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,curvature:u=.25}){const[o,c]=Zb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=Zb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,_,v,w]=l2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,_,v,w]}function u2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,o=r<t?r+u:r-u;return[l,o,a,u]}function xz({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+o}function wz({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=Sh(Iu(e),Iu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return zu(u,xh(l))>0}const Cz=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Ez=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),kz=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||Cz;let a;return ZC(e)?a={...e}:a={...e,id:r(e)},Ez(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function h2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=u2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const Qb={[Me.Left]:{x:-1,y:0},[Me.Right]:{x:1,y:0},[Me.Top]:{x:0,y:-1},[Me.Bottom]:{x:0,y:1}},Az=({source:e,sourcePosition:t=Me.Bottom,target:n})=>t===Me.Left||t===Me.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Jb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Nz({source:e,sourcePosition:t=Me.Bottom,target:n,targetPosition:r=Me.Top,center:a,offset:l,stepPosition:u}){const o=Qb[t],c=Qb[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=Az({source:f,sourcePosition:t,target:p}),_=d.x!==0?"x":"y",v=d[_];let w=[],C,b;const S={x:0,y:0},x={x:0,y:0},[,,y,E]=u2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[_]*c[_]===-1){_==="x"?(C=a.x??f.x+(p.x-f.x)*u,b=a.y??(f.y+p.y)/2):(C=a.x??(f.x+p.x)/2,b=a.y??f.y+(p.y-f.y)*u);const T=[{x:C,y:f.y},{x:C,y:p.y}],j=[{x:f.x,y:b},{x:p.x,y:b}];o[_]===v?w=_==="x"?T:j:w=_==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(_==="x"?w=o.x===v?j:T:w=o.y===v?T:j,t===r){const z=Math.abs(e[_]-n[_]);if(z<=l){const V=Math.min(l-1,l-z);o[_]===v?S[_]=(f[_]>e[_]?-1:1)*V:x[_]=(p[_]>n[_]?-1:1)*V}}if(t!==r){const z=_==="x"?"y":"x",V=o[_]===c[z],G=f[z]>p[z],X=f[z]<p[z];(o[_]===1&&(!V&&G||V&&X)||o[_]!==1&&(!V&&X||V&&G))&&(w=_==="x"?T:j)}const B={x:f.x+S.x,y:f.y+S.y},F={x:p.x+x.x,y:p.y+x.y},Y=Math.max(Math.abs(B.x-w[0].x),Math.abs(F.x-w[0].x)),H=Math.max(Math.abs(B.y-w[0].y),Math.abs(F.y-w[0].y));Y>=H?(C=(B.x+F.x)/2,b=w[0].y):(C=w[0].x,b=(B.y+F.y)/2)}const R={x:f.x+S.x,y:f.y+S.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...R.x!==w[0].x||R.y!==w[0].y?[R]:[],...w,...N.x!==w[w.length-1].x||N.y!==w[w.length-1].y?[N]:[],n],C,b,y,E]}function Tz(e,t,n,r){const a=Math.min(Jb(e,t)/2,Jb(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+a*f},${u}Q ${l},${u} ${l},${u+a*p}`}const o=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${l},${u+a*c}Q ${l},${u} ${l+a*o},${u}`}function fg({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,borderRadius:u=5,centerX:o,centerY:c,offset:f=20,stepPosition:p=.5}){const[d,_,v,w,C]=Nz({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:o,y:c},offset:f,stepPosition:p});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=Tz(d[S-1],d[S],d[S+1],u);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,_,v,w,C]}function eS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Rz(e){var d;const{sourceNode:t,targetNode:n}=e;if(!eS(t)||!eS(n))return null;const r=t.internals.handleBounds||tS(t.handles),a=n.internals.handleBounds||tS(n.handles),l=nS((r==null?void 0:r.source)??[],e.sourceHandle),u=nS(e.connectionMode===ma.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!u)return(d=e.onError)==null||d.call(e,"008",ei.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(l==null?void 0:l.position)||Me.Bottom,c=(u==null?void 0:u.position)||Me.Top,f=ls(t,l,o),p=ls(n,u,c);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:o,targetPosition:c}}function tS(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ls(e,t,n=Me.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:o}=t??gi(e);if(r)return{x:a+u/2,y:l+o/2};switch((t==null?void 0:t.position)??n){case Me.Top:return{x:a+u/2,y:l};case Me.Right:return{x:a+u,y:l+o/2};case Me.Bottom:return{x:a+u/2,y:l+o};case Me.Left:return{x:a,y:l+o/2}}}function nS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Dz(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=dg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const f2=1e3,Mz=10,Im={nodeOrigin:[0,0],nodeExtent:tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jz={...Im,checkEquality:!0};function zm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Lz(e,t,n){const r=zm(Im,n);for(const a of e.values())if(a.parentId)Fm(a,e,t,r);else{const l=gl(a,r.nodeOrigin),u=os(a.extent)?a.extent:r.nodeExtent,o=as(l,u,gi(a));a.internals.positionAbsolute=o}}function Oz(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Hm(e){return e==="manual"}function pg(e,t,n,r={}){var p,d;const a=zm(jz,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Hm(a.zIndexMode)?f2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const _ of e){let v=u.get(_.id);if(a.checkEquality&&_===(v==null?void 0:v.internals.userNode))t.set(_.id,v);else{const w=gl(_,a.nodeOrigin),C=os(_.extent)?_.extent:a.nodeExtent,b=as(w,C,gi(_));v={...a.defaults,..._,measured:{width:(p=_.measured)==null?void 0:p.width,height:(d=_.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:Oz(_,v),z:d2(_,o,a.zIndexMode),userNode:_}},t.set(_.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(c=!1),_.parentId&&Fm(v,t,n,r,l),f||(f=_.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function Bz(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Fm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=zm(Im,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Bz(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*Mz),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Hm(c)?f2:0,{x:_,y:v,z:w}=Iz(e,p,u,o,d,c),{positionAbsolute:C}=e.internals,b=_!==C.x||v!==C.y;(b||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:_,y:v}:C,z:w}})}function d2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Hm(n)?r:r+(e.selected?t:0)}function Iz(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=gi(e),f=gl(e,n),p=os(e.extent)?as(f,e.extent,c):f;let d=as({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=JC(d,c,t));const _=d2(e,a,l),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=_?v+1:_}}function Pm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??il(c),p=e2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var y;const p=c.internals.positionAbsolute,d=gi(c),_=c.origin??r,v=o.x<p.x?Math.round(Math.abs(p.x-o.x)):0,w=o.y<p.y?Math.round(Math.abs(p.y-o.y)):0,C=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),S=(C-d.width)*_[0],x=(b-d.height)*_[1];(v>0||w>0||S||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-v+S,y:c.position.y-w+x}}),(y=n.get(f))==null||y.forEach(E=>{e.some(R=>R.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+v,y:E.position.y+w}})})),(d.width<o.width||d.height<o.height||v||w)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:C+(v?_[0]*v-S:0),height:b+(w?_[1]*w-x:0)}})}),a}function zz(e,t,n,r,a,l,u){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],p=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(p.transform),_=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),c=!0;continue}const C=Bm(v.nodeElement),b=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(b||!w.internals.handleBounds||v.force))){const x=v.nodeElement.getBoundingClientRect(),y=os(w.extent)?w.extent:l;let{positionAbsolute:E}=w.internals;if(w.parentId&&w.extent==="parent"){const N=t.get(w.parentId);N&&(E=JC(E,C,N))}else y&&(E=as(E,y,C));const R={...w,measured:C,internals:{...w.internals,positionAbsolute:E,handleBounds:{source:Kb("source",v.nodeElement,x,d,w.id),target:Kb("target",v.nodeElement,x,d,w.id)}}};t.set(w.id,R),w.parentId&&Fm(R,t,n,{nodeOrigin:a,zIndexMode:u}),c=!0,b&&(f.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&_.push({id:w.id,parentId:w.parentId,rect:il(R,a)}))}}if(_.length>0){const v=Pm(_,t,n,a);f.push(...v)}return{changes:f,updatedInternals:c}}async function Hz({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function iS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function p2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;iS("source",c,p,e,a,u),iS("target",c,f,e,l,o),t.set(r.id,r)}}function g2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:g2(n,t):!1}function rS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Fz(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!g2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function vp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function Pz({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=_l(l,t);return{x:u.x-l.x,y:u.y-l.y}}function Uz({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,_=null,v=!1,w=!1,C=null;function b({noDragClassName:x,handleSelector:y,domNode:E,isSelectable:R,nodeId:N,nodeClickDistance:D=0}){_=An(E);function T({x:Y,y:H}){const{nodeLookup:z,nodeExtent:V,snapGrid:G,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:$}=t();l={x:Y,y:H};let U=!1;const Q=o.size>1,re=Q&&V?hg(ml(o)):null,ae=Q&&X?Pz({dragItems:o,snapGrid:G,x:Y,y:H}):null;for(const[Z,P]of o){if(!z.has(Z))continue;let ee={x:Y-P.distance.x,y:H-P.distance.y};X&&(ee=ae?{x:Math.round(ee.x+ae.x),y:Math.round(ee.y+ae.y)}:_l(ee,G));let ne=null;if(Q&&V&&!P.extent&&re){const{positionAbsolute:ye}=P.internals,be=ye.x-re.x+V[0][0],ke=ye.x+P.measured.width-re.x2+V[1][0],Ee=ye.y-re.y+V[0][1],Ce=ye.y+P.measured.height-re.y2+V[1][1];ne=[[be,Ee],[ke,Ce]]}const{position:ge,positionAbsolute:he}=QC({nodeId:Z,nextPosition:ee,nodeLookup:z,nodeExtent:ne||V,nodeOrigin:K,onError:O});U=U||P.position.x!==ge.x||P.position.y!==ge.y,P.position=ge,P.internals.positionAbsolute=he}if(w=w||U,!!U&&($(o,!0),C&&(r||L||!N&&M))){const[Z,P]=vp({nodeId:N,dragItems:o,nodeLookup:z});r==null||r(C,o,Z,P),L==null||L(C,Z,P),N||M==null||M(C,P)}}async function j(){if(!p)return;const{transform:Y,panBy:H,autoPanSpeed:z,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(u);return}const[G,X]=Lm(f,p,z);(G!==0||X!==0)&&(l.x=(l.x??0)-G/Y[2],l.y=(l.y??0)-X/Y[2],await H({x:G,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(Y){var Q;const{nodeLookup:H,multiSelectionActive:z,nodesDraggable:V,transform:G,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!L||!R)&&!z&&N&&((Q=H.get(N))!=null&&Q.selected||$()),R&&L&&N&&(e==null||e(N));const U=Ho(Y.sourceEvent,{transform:G,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=U,o=Fz(H,V,U,N),o.size>0&&(n||M||!N&&O)){const[re,ae]=vp({nodeId:N,dragItems:o,nodeLookup:H});n==null||n(Y.sourceEvent,o,re,ae),M==null||M(Y.sourceEvent,re,ae),N||O==null||O(Y.sourceEvent,ae)}}const F=DC().clickDistance(D).on("start",Y=>{const{domNode:H,nodeDragThreshold:z,transform:V,snapGrid:G,snapToGrid:X}=t();p=(H==null?void 0:H.getBoundingClientRect())||null,v=!1,w=!1,C=Y.sourceEvent,z===0&&B(Y),l=Ho(Y.sourceEvent,{transform:V,snapGrid:G,snapToGrid:X,containerBounds:p}),f=Qn(Y.sourceEvent,p)}).on("drag",Y=>{const{autoPanOnNodeDrag:H,transform:z,snapGrid:V,snapToGrid:G,nodeDragThreshold:X,nodeLookup:K}=t(),L=Ho(Y.sourceEvent,{transform:z,snapGrid:V,snapToGrid:G,containerBounds:p});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||N&&!K.has(N))&&(v=!0),!v){if(!c&&H&&d&&(c=!0,j()),!d){const M=Qn(Y.sourceEvent,p),O=M.x-f.x,$=M.y-f.y;Math.sqrt(O*O+$*$)>X&&B(Y)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(Y.sourceEvent,p),T(L))}}).on("end",Y=>{if(!d||v){v&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:H,updateNodePositions:z,onNodeDragStop:V,onSelectionDragStop:G}=t();if(w&&(z(o,!1),w=!1),a||V||!N&&G){const[X,K]=vp({nodeId:N,dragItems:o,nodeLookup:H,dragging:!1});a==null||a(Y.sourceEvent,o,X,K),V==null||V(Y.sourceEvent,X,K),N||G==null||G(Y.sourceEvent,K)}}}).filter(Y=>{const H=Y.target;return!Y.button&&(!x||!rS(H,`.${x}`,E))&&(!y||rS(H,y,E))});_.call(F)}function S(){_==null||_.on(".drag",null)}return{update:b,destroy:S}}function $z(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())zu(a,il(l))>0&&r.push(l);return r}const Gz=250;function qz(e,t,n,r){var o,c;let a=[],l=1/0;const u=$z(e,n,t+Gz);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:_,y:v}=ls(f,d,d.position,!0),w=Math.sqrt(Math.pow(_-e.x,2)+Math.pow(v-e.y,2));w>t||(w<l?(a=[{...d,x:_,y:v}],l=w):w===l&&a.push({...d,x:_,y:v}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function m2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(_=>_.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ls(u,c,c.position,!0)}:c}function _2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Vz(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const v2=()=>!0;function Yz(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:_,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:b,isValidConnection:S=v2,onReconnectEnd:x,updateConnection:y,getTransform:E,getFromHandle:R,autoPanSpeed:N,dragThreshold:D=1,handleDomNode:T}){const j=s2(e.target);let B=0,F;const{x:Y,y:H}=Qn(e),z=_2(l,T),V=o==null?void 0:o.getBoundingClientRect();let G=!1;if(!V||!z)return;const X=m2(a,z,r,c,t);if(!X)return;let K=Qn(e,V),L=!1,M=null,O=!1,$=null;function U(){if(!p||!V)return;const[ge,he]=Lm(K,V,N);_({x:ge,y:he}),B=requestAnimationFrame(U)}const Q={...X,nodeId:a,type:z,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ls(re,Q,Me.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:Vb[Q.position],toNode:null,pointer:K};function P(){G=!0,y(Z),w==null||w(e,{nodeId:a,handleId:r,handleType:z})}D===0&&P();function ee(ge){if(!G){const{x:Ce,y:rt}=Qn(ge),bt=Ce-Y,Ge=rt-H;if(!(bt*bt+Ge*Ge>D*D))return;P()}if(!R()||!Q){ne(ge);return}const he=E();K=Qn(ge,V),F=qz(vl(K,he,!1,[1,1]),n,c,Q),L||(U(),L=!0);const ye=y2(ge,{handle:F,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:S,doc:j,lib:f,flowId:d,nodeLookup:c});$=ye.handleDomNode,M=ye.connection,O=Vz(!!F,ye.isValid);const be=c.get(a),ke=be?ls(be,Q,Me.Left,!0):Z.from,Ee={...Z,from:ke,isValid:O,to:ye.toHandle&&O?va({x:ye.toHandle.x,y:ye.toHandle.y},he):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:Vb[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};y(Ee),Z=Ee}function ne(ge){if(!("touches"in ge&&ge.touches.length>0)){if(G){(F||$)&&M&&O&&(C==null||C(M));const{inProgress:he,...ye}=Z,be={...ye,toPosition:Z.toHandle?Z.toPosition:null};b==null||b(ge,be),l&&(x==null||x(ge,be))}v(),cancelAnimationFrame(B),L=!1,O=!1,M=null,$=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function y2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=v2,nodeLookup:p}){const d=l==="target",_=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:w}=Qn(e),C=u.elementFromPoint(v,w),b=C!=null&&C.classList.contains(`${o}-flow__handle`)?C:_,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const x=_2(void 0,b),y=b.getAttribute("data-nodeid"),E=b.getAttribute("data-handleid"),R=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!x)return S;const D={source:d?y:r,sourceHandle:d?E:a,target:d?r:y,targetHandle:d?a:E};S.connection=D;const j=R&&N&&(n===ma.Strict?d&&x==="source"||!d&&x==="target":y!==r||E!==a);S.isValid=j&&f(D),S.toHandle=m2(y,x,E,p,n,!0)}return S}const gg={onPointerDown:Yz,isValid:y2};function Wz({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:_=!0,inversePan:v=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=y.sourceEvent.ctrlKey&&rl()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,D=E[2]*Math.pow(2,N*R);t.scaleTo(D)};let C=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(C=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},S=y=>{const E=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const R=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[R[0]-C[0],R[1]-C[1]];C=R;const D=r()*Math.max(E[2],Math.log(E[2]))*(v?-1:1),T={x:E[0]-N[0]*D,y:E[1]-N[1]*D},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=VC().on("start",b).on("zoom",d?S:null).on("zoom.wheel",_?w:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const wh=e=>({x:e.x,y:e.y,zoom:e.k}),yp=({x:e,y:t,zoom:n})=>bh.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),b2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Xz=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bp=(e,t=0,n=Xz,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},S2=e=>{const t=e.ctrlKey&&rl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Kz({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(la(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const b=Xn(p),S=S2(p),x=d*Math.pow(2,S);r.scaleTo(n,x,b,p);return}const _=p.deltaMode===1?20:1;let v=a===ts.Vertical?0:p.deltaX*_,w=a===ts.Horizontal?0:p.deltaY*_;!rl()&&p.shiftKey&&a!==ts.Vertical&&(v=p.deltaY*_,w=0),r.translateBy(n,-(v/d)*l,-(w/d)*l,{internal:!0});const C=wh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c==null||c(p,C):(e.isPanScrolling=!0,o==null||o(p,C)),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,C),e.isPanScrolling=!1},150)}}function Zz({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=la(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function Qz({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=wh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function Jz({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&b2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,wh(l.transform)))}}function eH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&b2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=wh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function tH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var b;const _=e||t,v=n&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(la(d,`${f}-flow__node`)||la(d,`${f}-flow__edge`)))return!0;if(!r&&!_&&!a&&!l&&!n||u||p&&!w||la(d,o)&&w||la(d,c)&&(!w||a&&w&&!e)||!n&&d.ctrlKey&&w)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!_&&!a&&!v&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const C=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w)&&C}}function nH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect();let d=[[0,0],[p.width,p.height]];const _=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const z=H[0];z&&(d=[[0,0],[z.contentRect.width,z.contentRect.height]])}):null;_==null||_.observe(e);const v=VC().extent(()=>d).scaleExtent([t,n]).translateExtent(r),w=An(e).call(v);E({x:a.x,y:a.y,zoom:_a(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const C=w.on("wheel.zoom"),b=w.on("dblclick.zoom");v.wheelDelta(S2);async function S(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).transform(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}function x({noWheelClassName:H,noPanClassName:z,onPaneContextMenu:V,userSelectionActive:G,panOnScroll:X,panOnDrag:K,panOnScrollMode:L,panOnScrollSpeed:M,preventScrolling:O,zoomOnPinch:$,zoomOnScroll:U,zoomOnDoubleClick:Q,zoomActivationKeyPressed:re,lib:ae,onTransformChange:Z,connectionInProgress:P,paneClickDistance:ee,selectionOnDrag:ne}){G&&!f.isZoomingOrPanning&&y();const ge=X&&!re&&!G;v.clickDistance(ne?1/0:!Zn(ee)||ee<0?0:ee);const he=ge?Kz({zoomPanValues:f,noWheelClassName:H,d3Selection:w,d3Zoom:v,panOnScrollMode:L,panOnScrollSpeed:M,zoomOnPinch:$,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):Zz({noWheelClassName:H,preventScrolling:O,d3ZoomHandler:C});w.on("wheel.zoom",he,{passive:!1});const ye=Qz({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});v.on("start",ye);const be=Jz({zoomPanValues:f,panOnDrag:K,onPaneContextMenu:!!V,onPanZoom:l,onTransformChange:Z});v.on("zoom",be);const ke=eH({zoomPanValues:f,panOnDrag:K,panOnScroll:X,onPaneContextMenu:V,onPanZoomEnd:o,onDraggingChange:c});v.on("end",ke);const Ee=tH({zoomActivationKeyPressed:re,panOnDrag:K,zoomOnScroll:U,panOnScroll:X,zoomOnDoubleClick:Q,zoomOnPinch:$,userSelectionActive:G,noPanClassName:z,noWheelClassName:H,lib:ae,connectionInProgress:P});v.filter(Ee),Q?w.on("dblclick.zoom",b):w.on("dblclick.zoom",null)}function y(){v.on("zoom",null)}async function E(H,z,V){const G=yp(H),X=v==null?void 0:v.constrain()(G,z,V);return X&&await S(X),X}async function R(H,z){const V=yp(H);return await S(V,z),V}function N(H){if(w){const z=yp(H),V=w.property("__zoom");(V.k!==H.zoom||V.x!==H.x||V.y!==H.y)&&(v==null||v.transform(w,z,null,{sync:!0}))}}function D(){const H=w?qC(w.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function T(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).scaleTo(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}async function j(H,z){return w?new Promise(V=>{v==null||v.interpolate((z==null?void 0:z.interpolate)==="linear"?zo:gu).scaleBy(bp(w,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),H)}):!1}function B(H){v==null||v.scaleExtent(H)}function F(H){v==null||v.translateExtent(H)}function Y(H){const z=!Zn(H)||H<0?0:H;v==null||v.clickDistance(z)}return{update:x,destroy:y,setViewport:R,setViewportConstrained:E,getViewport:D,scaleTo:T,scaleBy:j,setScaleExtent:B,setTranslateExtent:F,syncViewport:N,setClickDistance:Y}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function iH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function sS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Cr(e,t){return Math.max(0,e-t)}function iu(e,t,n){return Math.max(0,t-e,e-n)}function aS(e,t){return e?!t:t}function rH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,_=p&&d,{xSnapped:v,ySnapped:w}=n,{minWidth:C,maxWidth:b,minHeight:S,maxHeight:x}=r,{x:y,y:E,width:R,height:N,aspectRatio:D}=e;let T=Math.floor(p?v-e.pointerX:0),j=Math.floor(d?w-e.pointerY:0);const B=R+(c?-T:T),F=N+(f?-j:j),Y=-l[0]*R,H=-l[1]*N;let z=iu(B,C,b),V=iu(F,S,x);if(u){let K=0,L=0;c&&T<0?K=wr(y+T+Y,u[0][0]):!c&&T>0&&(K=Cr(y+B+Y,u[1][0])),f&&j<0?L=wr(E+j+H,u[0][1]):!f&&j>0&&(L=Cr(E+F+H,u[1][1])),z=Math.max(z,K),V=Math.max(V,L)}if(o){let K=0,L=0;c&&T>0?K=Cr(y+T,o[0][0]):!c&&T<0&&(K=wr(y+B,o[1][0])),f&&j>0?L=Cr(E+j,o[0][1]):!f&&j<0&&(L=wr(E+F,o[1][1])),z=Math.max(z,K),V=Math.max(V,L)}if(a){if(p){const K=iu(B/D,S,x)*D;if(z=Math.max(z,K),u){let L=0;!c&&!f||c&&!f&&_?L=Cr(E+H+B/D,u[1][1])*D:L=wr(E+H+(c?T:-T)/D,u[0][1])*D,z=Math.max(z,L)}if(o){let L=0;!c&&!f||c&&!f&&_?L=wr(E+B/D,o[1][1])*D:L=Cr(E+(c?T:-T)/D,o[0][1])*D,z=Math.max(z,L)}}if(d){const K=iu(F*D,C,b)/D;if(V=Math.max(V,K),u){let L=0;!c&&!f||f&&!c&&_?L=Cr(y+F*D+Y,u[1][0])/D:L=wr(y+(f?j:-j)*D+Y,u[0][0])/D,V=Math.max(V,L)}if(o){let L=0;!c&&!f||f&&!c&&_?L=wr(y+F*D,o[1][0])/D:L=Cr(y+(f?j:-j)*D,o[0][0])/D,V=Math.max(V,L)}}}j=j+(j<0?V:-V),T=T+(T<0?z:-z),a&&(_?B>F*D?j=(aS(c,f)?-T:T)/D:T=(aS(c,f)?-j:j)*D:p?(j=T/D,f=c):(T=j*D,c=f));const G=c?y+T:y,X=f?E+j:E;return{width:R+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+G,y:l[1]*j*(f?-1:1)+X}}const x2={width:0,height:0,x:0,y:0},sH={...x2,pointerX:0,pointerY:0,aspectRatio:1};function aH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function oH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:sS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:_,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:b}){let S={...x2},x={...sH};u={boundaries:p,resizeDirection:_,keepAspectRatio:d,controlDirection:sS(f)};let y,E=null,R=[],N,D,T,j=!1;const B=DC().on("start",F=>{const{nodeLookup:Y,transform:H,snapGrid:z,snapToGrid:V,nodeOrigin:G,paneDomNode:X}=n();if(y=Y.get(t),!y)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Ho(F.sourceEvent,{transform:H,snapGrid:z,snapToGrid:V,containerBounds:E});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...S,pointerX:K,pointerY:L,aspectRatio:S.width/S.height},N=void 0,D=os(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=Y.get(y.parentId)),N&&y.extent==="parent"&&(D=[[0,0],[N.measured.width,N.measured.height]]),R=[],T=void 0;for(const[M,O]of Y)if(O.parentId===t&&(R.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=aH(O,y,O.origin??G);T?T=[[Math.min($[0][0],T[0][0]),Math.min($[0][1],T[0][1])],[Math.max($[1][0],T[1][0]),Math.max($[1][1],T[1][1])]]:T=$}v==null||v(F,{...S})}).on("drag",F=>{const{transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V}=n(),G=Ho(F.sourceEvent,{transform:Y,snapGrid:H,snapToGrid:z,containerBounds:E}),X=[];if(!y)return;const{x:K,y:L,width:M,height:O}=S,$={},U=y.origin??V,{width:Q,height:re,x:ae,y:Z}=rH(x,u.controlDirection,G,u.boundaries,u.keepAspectRatio,U,D,T),P=Q!==M,ee=re!==O,ne=ae!==K&&P,ge=Z!==L&ⅇif(!ne&&!ge&&!P&&!ee)return;if((ne||ge||U[0]===1||U[1]===1)&&($.x=ne?ae:S.x,$.y=ge?Z:S.y,S.x=$.x,S.y=$.y,R.length>0)){const ke=ae-K,Ee=Z-L;for(const Ce of R)Ce.position={x:Ce.position.x-ke+U[0]*(Q-M),y:Ce.position.y-Ee+U[1]*(re-O)},X.push(Ce)}if((P||ee)&&($.width=P&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:S.width,$.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:S.height,S.width=$.width,S.height=$.height),N&&y.expandParent){const ke=U[0]*($.width??0);$.x&&$.x<ke&&(S.x=ke,x.x=x.x-($.x-ke));const Ee=U[1]*($.height??0);$.y&&$.y<Ee&&(S.y=Ee,x.y=x.y-($.y-Ee))}const he=iH({width:S.width,prevWidth:M,height:S.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ye={...S,direction:he};(b==null?void 0:b(F,ye))!==!1&&(j=!0,w==null||w(F,ye),r($,X))}).on("end",F=>{j&&(C==null||C(F,{...S}),a==null||a({...S}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Sp={exports:{}},xp={},wp={exports:{}},Cp={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oS;function lH(){if(oS)return Cp;oS=1;var e=al();function t(d,_){return d===_&&(d!==0||1/d===1/_)||d!==d&&_!==_}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,_){var v=_(),w=r({inst:{value:v,getSnapshot:_}}),C=w[0].inst,b=w[1];return l(function(){C.value=v,C.getSnapshot=_,c(C)&&b({inst:C})},[d,v,_]),a(function(){return c(C)&&b({inst:C}),d(function(){c(C)&&b({inst:C})})},[d]),u(v),v}function c(d){var _=d.getSnapshot;d=d.value;try{var v=_();return!n(d,v)}catch{return!0}}function f(d,_){return _()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Cp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Cp}var lS;function cH(){return lS||(lS=1,wp.exports=lH()),wp.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var cS;function uH(){if(cS)return xp;cS=1;var e=al(),t=cH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(f,p,d,_,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=o(function(){function S(N){if(!x){if(x=!0,y=N,N=_(N),v!==void 0&&C.hasValue){var D=C.value;if(v(D,N))return E=D}return E=N}if(D=E,r(y,N))return D;var T=_(N);return v!==void 0&&v(D,T)?(y=N,D):(y=N,E=T)}var x=!1,y,E,R=d===void 0?null:d;return[function(){return S(p())},R===null?void 0:function(){return S(R())}]},[p,d,_,v]);var b=a(f,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=b},[b]),c(b),b},xp}var uS;function hH(){return uS||(uS=1,Sp.exports=uH()),Sp.exports}var fH=hH();const dH=Pu(fH),pH={},hS=e=>{let t;const n=new Set,r=(p,d)=>{const _=typeof p=="function"?p(t):p;if(!Object.is(_,t)){const v=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(w=>w(t,v))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(pH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},gH=e=>e?hS(e):hS,{useDebugValue:mH}=dA,{useSyncExternalStoreWithSelector:_H}=dH,vH=e=>e;function w2(e,t=vH,n){const r=_H(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return mH(r),r}const fS=(e,t)=>{const n=gH(e),r=(a,l=t)=>w2(n,a,l);return Object.assign(r,n),r},yH=(e,t)=>e?fS(e,t):fS;function At(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}FS();const Ch=q.createContext(null),bH=Ch.Provider,C2=ei.error001("react");function tt(e,t){const n=q.useContext(Ch);if(n===null)throw new Error(C2);return w2(n,e,t)}function Ct(){const e=q.useContext(Ch);if(e===null)throw new Error(C2);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const dS={display:"none"},SH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},E2="react-flow__node-desc",k2="react-flow__edge-desc",xH="react-flow__aria-live",wH=e=>e.ariaLiveMessage,CH=e=>e.ariaLabelConfig;function EH({rfId:e}){const t=tt(wH);return m.jsx("div",{id:`${xH}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SH,children:t})}function kH({rfId:e,disableKeyboardA11y:t}){const n=tt(CH);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${E2}-${e}`,style:dS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${k2}-${e}`,style:dS,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(EH,{rfId:e})]})}const Eh=q.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return m.jsx("div",{className:Ft(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Eh.displayName="Panel";const pS="https://reactflow.dev?utm_source=attribution";function AH({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Eh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${pS}`,children:m.jsx("a",{href:pS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const NH=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ru=e=>e.id;function TH(e,t){return At(e.selectedNodes.map(ru),t.selectedNodes.map(ru))&&At(e.selectedEdges.map(ru),t.selectedEdges.map(ru))}function RH({onSelectionChange:e}){const t=Ct(),{selectedNodes:n,selectedEdges:r}=tt(NH,TH);return q.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const DH=e=>!!e.onSelectionChangeHandlers;function MH({onSelectionChange:e}){const t=tt(DH);return e||t?m.jsx(RH,{onSelectionChange:e}):null}const A2=[0,0],jH={x:0,y:0,zoom:1},LH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],gS=[...LH,"rfId"],OH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),mS={translateExtent:tl,nodeOrigin:A2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function BH(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=tt(OH,At),f=Ct();q.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=mS,o()}),[]);const p=q.useRef(mS);return q.useEffect(()=>{for(const d of gS){const _=e[d],v=p.current[d];_!==v&&(typeof e[d]>"u"||(d==="nodes"?t(_):d==="edges"?n(_):d==="minZoom"?r(_):d==="maxZoom"?a(_):d==="translateExtent"?l(_):d==="nodeExtent"?u(_):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:bz(_)}):d==="fitView"?f.setState({fitViewQueued:_}):d==="fitViewOptions"?f.setState({fitViewOptions:_}):f.setState({[d]:_})))}p.current=e},gS.map(d=>e[d])),null}function _S(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function IH(e){var r;const[t,n]=q.useState(e==="system"?null:e);return q.useEffect(()=>{if(e!=="system"){n(e);return}const a=_S(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=_S())!=null&&r.matches?"dark":"light"}const vS=typeof document<"u"?document:null;function sl(e=null,t={target:vS,actInsideInputWithModifier:!0}){const[n,r]=q.useState(!1),a=q.useRef(!1),l=q.useRef(new Set([])),[u,o]=q.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),p=f.reduce((d,_)=>d.concat(..._),[]);return[f,p]}return[[],[]]},[e]);return q.useEffect(()=>{const c=(t==null?void 0:t.target)??vS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=v=>{var b,S;if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!f)&&a2(v))return!1;const C=bS(v.code,o);if(l.current.add(v[C]),yS(u,l.current,!1)){const x=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!y)&&v.preventDefault(),r(!0)}},d=v=>{const w=bS(v.code,o);yS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),a.current=!1},_=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,r]),n}function yS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function bS(e,t){return t.includes(e)?"code":"key"}const zH=()=>{const e=Ct();return q.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Om(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return vl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=va(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function N2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)HH(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function HH(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function FH(e,t){return N2(e,t)}function PH(e,t){return N2(e,t)}function Zr(e,t){return{id:e,type:"select",selected:t}}function ca(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(Zr(l.id,u)))}return r}function SS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function xS(e){return{id:e.id,type:"remove"}}const UH=n2();function $H(e,t,n={}){return kz(e,t,{...n,onError:n.onError??UH})}const wS=e=>hz(e),GH=e=>ZC(e);function T2(e){return q.forwardRef(e)}const R2=typeof window<"u"?q.useLayoutEffect:q.useEffect;function CS(e){const[t,n]=q.useState(BigInt(0)),[r]=q.useState(()=>qH(()=>n(a=>a+BigInt(1))));return R2(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function qH(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const D2=q.createContext(null);function VH({children:e}){const t=Ct(),n=q.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:_,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=c;for(const S of o)C=typeof S=="function"?S(C):S;let b=SS({items:C,lookup:_});for(const S of w.values())b=S(b);p&&f(C),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:x,setNodes:y}=t.getState();S&&y(x)})},[]),r=CS(n),a=q.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:_}=t.getState();let v=c;for(const w of o)v=typeof w=="function"?w(v):w;p?f(v):d&&d(SS({items:v,lookup:_}))},[]),l=CS(a),u=q.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return m.jsx(D2.Provider,{value:u,children:e})}function YH(){const e=q.useContext(D2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const WH=e=>!!e.panZoom;function Um(){const e=zH(),t=Ct(),n=YH(),r=tt(WH),a=q.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var S,x;const{nodeLookup:_,nodeOrigin:v}=t.getState(),w=wS(d)?d:_.get(d.id),C=w.parentId?r2(w.position,w.measured,w.parentId,_,v):w.position,b={...w,position:C,width:((S=w.measured)==null?void 0:S.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return il(b)},f=(d,_,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&wS(b)?b:{...C,...b}}return C}))},p=(d,_,v={replace:!1})=>{o(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&GH(b)?b:{...C,...b}}return C}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var _;return(_=l(d))==null?void 0:_.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(_=>({..._}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const _=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,..._])},addEdges:d=>{const _=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,..._])},toObject:()=>{const{nodes:d=[],edges:_=[],transform:v}=t.getState(),[w,C,b]=v;return{nodes:d.map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:w,y:C,zoom:b}}},deleteElements:async({nodes:d=[],edges:_=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:E}=t.getState(),{nodes:R,edges:N}=await mz({nodesToRemove:d,edgesToRemove:_,nodes:v,edges:w,onBeforeDelete:E}),D=N.length>0,T=R.length>0;if(D){const j=N.map(xS);b==null||b(N),x(j)}if(T){const j=R.map(xS);C==null||C(R),S(j)}return(T||D)&&(y==null||y({nodes:R,edges:N})),{deletedNodes:R,deletedEdges:N}},getIntersectingNodes:(d,_=!0,v)=>{const w=Wb(d),C=w?d:c(d),b=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const x=t.getState().nodeLookup.get(S.id);if(x&&!w&&(S.id===d.id||!x.internals.positionAbsolute))return!1;const y=il(b?S:x),E=zu(y,C);return _&&E>0||E>=y.width*y.height||E>=C.width*C.height}):[]},isNodeIntersecting:(d,_,v=!0)=>{const C=Wb(d)?d:c(d);if(!C)return!1;const b=zu(C,_);return v&&b>0||b>=_.width*_.height||b>=C.width*C.height},updateNode:f,updateNodeData:(d,_,v={replace:!1})=>{f(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(d,_,v={replace:!1})=>{p(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:d=>{const{nodeLookup:_,nodeOrigin:v}=t.getState();return fz(d,{nodeLookup:_,nodeOrigin:v})},getHandleConnections:({type:d,id:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}-${d}${_?`-${_}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:d,handleId:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}${d?_?`-${d}-${_}`:`-${d}`:""}`))==null?void 0:w.values())??[])},fitView:async d=>{const _=t.getState().fitViewResolver??yz();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:_}),n.nodeQueue.push(v=>[...v]),_.promise}}},[]);return q.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const ES=e=>e.selected,XH=typeof window<"u"?window:void 0;function KH({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Ct(),{deleteElements:r}=Um(),a=sl(e,{actInsideInputWithModifier:!1}),l=sl(t,{target:XH});q.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(ES),edges:u.filter(ES)}),n.setState({nodesSelectionActive:!1})}},[a]),q.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function ZH(e){const t=Ct();q.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Bm(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},QH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function JH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ts.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:_,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:b,onViewportChange:S,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:E}){const R=Ct(),N=q.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:j}=tt(QH,At),B=sl(_),F=q.useRef();ZH(N);const Y=q.useCallback(H=>{S==null||S({x:H[0],y:H[1],zoom:H[2]}),x||R.setState({transform:H})},[S,x]);return q.useEffect(()=>{if(N.current){F.current=nH({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:G=>R.setState(X=>X.paneDragging===G?X:{paneDragging:G}),onPanZoomStart:(G,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=R.getState();L==null||L(G,X),K==null||K(X)},onPanZoom:(G,X)=>{const{onViewportChange:K,onMove:L}=R.getState();L==null||L(G,X),K==null||K(X)},onPanZoomEnd:(G,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=R.getState();L==null||L(G,X),K==null||K(X)}});const{x:H,y:z,zoom:V}=F.current.getViewport();return R.setState({panZoom:F.current,transform:[H,z,V],domNode:N.current.closest(".react-flow")}),()=>{var G;(G=F.current)==null||G.destroy()}}},[]),q.useEffect(()=>{var H;(H=F.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:b,userSelectionActive:D,noWheelClassName:C,lib:T,onTransformChange:Y,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:y})},[e,t,n,r,a,l,u,o,B,v,b,D,C,T,Y,j,E,y]),m.jsx("div",{className:"react-flow__renderer",ref:N,style:kh,children:w})}const eF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function tF(){const{userSelectionActive:e,userSelectionRect:t}=tt(eF,At);return e&&t?m.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ep=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function iF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nl.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:_,onPaneMouseMove:v,onPaneMouseLeave:w,children:C}){const b=q.useRef(0),S=Ct(),{userSelectionActive:x,elementsSelectable:y,dragging:E,panBy:R,autoPanSpeed:N}=tt(nF,At),D=y&&(e||x),T=q.useRef(null),j=q.useRef(),B=q.useRef(new Set),F=q.useRef(new Set),Y=q.useRef(!1),H=q.useRef(!1),z=q.useRef({x:0,y:0}),V=q.useRef(!1),G=P=>{if(H.current||Y.current||S.getState().connection.inProgress){H.current=!1,Y.current=!1;return}f==null||f(P),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},X=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}p==null||p(P)},K=d?P=>d(P):void 0,L=P=>{H.current&&(P.stopPropagation(),H.current=!1)},M=P=>{var Ce,rt;const{domNode:ee,transform:ne}=S.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const ge=P.target===T.current;if(!ge&&!!P.target.closest(".nokey")||!e||!(u&&ge||t)||P.button!==0||!P.isPrimary)return;(rt=(Ce=P.target)==null?void 0:Ce.setPointerCapture)==null||rt.call(Ce,P.pointerId),H.current=!1;const{x:be,y:ke}=Qn(P.nativeEvent,j.current),Ee=vl({x:be,y:ke},ne);S.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:be,y:ke}}),ge||(P.stopPropagation(),P.preventDefault())};function O(P,ee){const{userSelectionRect:ne}=S.getState();if(!ne)return;const{transform:ge,nodeLookup:he,edgeLookup:ye,connectionLookup:be,triggerNodeChanges:ke,triggerEdgeChanges:Ee,defaultEdgeOptions:Ce}=S.getState(),rt={x:ne.startX,y:ne.startY},{x:bt,y:Ge}=va(rt,ge),ct={startX:rt.x,startY:rt.y,x:P<bt?P:bt,y:ee<Ge?ee:Ge,width:Math.abs(P-bt),height:Math.abs(ee-Ge)},Pt=B.current,ht=F.current;B.current=new Set(jm(he,ct,ge,n===nl.Partial,!0).map(fe=>fe.id)),F.current=new Set;const Fe=(Ce==null?void 0:Ce.selectable)??!0;for(const fe of B.current){const ie=be.get(fe);if(ie)for(const{edgeId:de}of ie.values()){const Se=ye.get(de);Se&&(Se.selectable??Fe)&&F.current.add(de)}}if(!Xb(Pt,B.current)){const fe=ca(he,B.current,!0);ke(fe)}if(!Xb(ht,F.current)){const fe=ca(ye,F.current);Ee(fe)}S.setState({userSelectionRect:ct,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!a||!j.current)return;const[P,ee]=Lm(z.current,j.current,N);R({x:P,y:ee}).then(ne=>{if(!H.current||!ne){b.current=requestAnimationFrame($);return}const{x:ge,y:he}=z.current;O(ge,he),b.current=requestAnimationFrame($)})}const U=()=>{cancelAnimationFrame(b.current),b.current=0,V.current=!1};q.useEffect(()=>()=>U(),[]);const Q=P=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:ge}=S.getState();if(!j.current||!ee)return;const{x:he,y:ye}=Qn(P.nativeEvent,j.current);z.current={x:he,y:ye};const be=va({x:ee.startX,y:ee.startY},ne);if(!H.current){const ke=t?0:l;if(Math.hypot(he-be.x,ye-be.y)<=ke)return;ge(),o==null||o(P)}H.current=!0,V.current||($(),V.current=!0),O(he,ye)},re=P=>{var ee,ne;if(!D){P.target===T.current&&S.getState().connection.inProgress&&(Y.current=!0);return}P.button===0&&((ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),!x&&P.target===T.current&&S.getState().userSelectionRect&&(G==null||G(P)),S.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(c==null||c(P),S.setState({nodesSelectionActive:B.current.size>0})),U())},ae=P=>{var ee,ne;(ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),U()},Z=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:Ft(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:D?void 0:Ep(G,T),onContextMenu:Ep(X,T),onWheel:Ep(K,T),onPointerEnter:D?void 0:_,onPointerMove:D?Q:v,onPointerUp:re,onPointerCancel:D?ae:void 0,onPointerDownCapture:D?M:void 0,onClickCapture:D?L:void 0,onPointerLeave:w,ref:T,style:kh,children:[C,m.jsx(tF,{})]})}function mg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function M2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=Ct(),[c,f]=q.useState(!1),p=q.useRef();return q.useEffect(()=>{if(!t)return p.current=Uz({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{mg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}}),()=>{var d;(d=p.current)==null||d.destroy(),p.current=void 0}},[t,o,e]),q.useEffect(()=>{t||!e.current||!p.current||p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u})},[n,r,t,l,e,a,u]),c}const rF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function j2(){const e=Ct();return q.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,_=rF(u),v=a?l[0]:5,w=a?l[1]:5,C=n.direction.x*v*n.factor,b=n.direction.y*w*n.factor;for(const[,S]of f){if(!_(S))continue;let x={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+b};a&&(x=_l(x,l));const{position:y,positionAbsolute:E}=QC({nodeId:S.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});S.position=y,S.internals.positionAbsolute=E,d.set(S.id,S)}c(d)},[])}const $m=q.createContext(null),sF=$m.Provider;$m.Consumer;const L2=()=>q.useContext($m),aF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),O2=q.createContext(null);function oF({children:e}){const t=tt(aF,At);return m.jsx(O2.Provider,{value:t,children:e})}function lF(){const e=q.useContext(O2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const cF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return cF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===ma.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function hF({type:e="source",position:t=Me.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,..._},v){var V,G;const w=u||null,C=e==="target",b=Ct(),S=L2(),{connectOnClick:x,noPanClassName:y,rfId:E}=lF(),{connectingFrom:R,connectingTo:N,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:F}=tt(uF(S,w,e),At);S||(G=(V=b.getState()).onError)==null||G.call(V,"010",ei.error010());const Y=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=b.getState(),O={...K,...X};if(M){const{edges:$,setEdges:U,onError:Q}=b.getState();U($H(O,$,{onError:Q}))}L==null||L(O),o==null||o(O)},H=X=>{if(!S)return;const K=o2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=b.getState();gg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:C,handleId:w,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,$;return($=(O=b.getState()).onConnectEnd)==null?void 0:$.call(O,...M)},updateConnection:L.updateConnection,onConnect:Y,isValidConnection:n||((...M)=>{var O,$;return(($=(O=b.getState()).isValidConnection)==null?void 0:$.call(O,...M))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},z=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:$,lib:U,rfId:Q,nodeLookup:re,connection:ae}=b.getState();if(!S||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:S,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const Z=s2(X.target),P=n||$,{connection:ee,isValid:ne}=gg.isValid(X.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:P,flowId:Q,doc:Z,lib:U,nodeLookup:re});ne&&ee&&Y(ee);const ge=structuredClone(ae);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(X,ge),b.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${E}-${S}-${w}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,f,{source:!C,target:C,connectable:r,connectablestart:a,connectableend:l,clickconnecting:D,connectingfrom:R,connectingto:N,valid:F,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:H,onTouchStart:H,onClick:x?z:void 0,ref:v,..._,children:c})}const ba=q.memo(T2(hF));function fF({data:e,isConnectable:t,sourcePosition:n=Me.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(ba,{type:"source",position:n,isConnectable:t})]})}function dF({data:e,isConnectable:t,targetPosition:n=Me.Top,sourcePosition:r=Me.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(ba,{type:"source",position:r,isConnectable:t})]})}function pF(){return null}function gF({data:e,isConnectable:t,targetPosition:n=Me.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Hu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},kS={input:fF,default:dF,output:gF,group:pF};function mF(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const _F=e=>{const{width:t,height:n,x:r,y:a}=ml(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function vF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ct(),{width:a,height:l,transformString:u,userSelectionActive:o}=tt(_F,At),c=j2(),f=q.useRef(null);q.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(M2({nodeRef:f,disabled:!p}),!p)return null;const d=e?v=>{const w=r.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,_=v=>{Object.prototype.hasOwnProperty.call(Hu,v.key)&&(v.preventDefault(),c({direction:Hu[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Ft(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:_,style:{width:a,height:l}})})}const AS=typeof window<"u"?window:void 0,yF=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function B2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:F,minZoom:Y,maxZoom:H,preventScrolling:z,onSelectionContextMenu:V,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:$}=tt(yF,At),U=sl(f,{target:AS}),Q=sl(C,{target:AS}),re=Q||T,ae=Q||E,Z=p&&re!==!0,P=U||$||Z;return KH({deleteKeyCode:c,multiSelectionKeyCode:w}),m.jsx(JH,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:!U&&re,defaultViewport:B,translateExtent:F,minZoom:Y,maxZoom:H,zoomActivationKeyCode:b,preventScrolling:z,noWheelClassName:G,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:m.jsxs(iF,{onSelectionStart:_,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!P,selectionMode:d,selectionKeyPressed:U,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&m.jsx(vF,{onSelectionContextMenu:V,noPanClassName:X,disableKeyboardA11y:K})]})})}B2.displayName="FlowRenderer";const bF=q.memo(B2),SF=e=>t=>e?jm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function xF(e){return tt(q.useCallback(SF(e),[e]),At)}const wF=e=>e.updateNodeInternals;function CF(){const e=tt(wF),[t]=q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return q.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function EF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Ct(),l=q.useRef(null),u=q.useRef(null),o=q.useRef(e.sourcePosition),c=q.useRef(e.targetPosition),f=q.useRef(t),p=n&&!!e.internals.handleBounds;return q.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),q.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),q.useEffect(()=>{if(l.current){const d=f.current!==t,_=o.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||_||v)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function kF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:_,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:b,nodeClickDistance:S,onError:x}){const{node:y,internals:E,isParent:R}=tt(P=>{const ee=P.nodeLookup.get(e),ne=P.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},At);let N=y.type||"default",D=(b==null?void 0:b[N])||kS[N];D===void 0&&(x==null||x("003",ei.error003(N)),N="default",D=(b==null?void 0:b.default)||kS.default);const T=!!(y.draggable||o&&typeof y.draggable>"u"),j=!!(y.selectable||c&&typeof y.selectable>"u"),B=!!(y.connectable||f&&typeof y.connectable>"u"),F=!!(y.focusable||p&&typeof y.focusable>"u"),Y=Ct(),H=i2(y),z=EF({node:y,nodeType:N,hasDimensions:H,resizeObserver:d}),V=M2({nodeRef:z,disabled:y.hidden||!T,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:S}),G=j2();if(y.hidden)return null;const X=gi(y),K=mF(y),L=j||T||t||n||r||a,M=n?P=>n(P,{...E.userNode}):void 0,O=r?P=>r(P,{...E.userNode}):void 0,$=a?P=>a(P,{...E.userNode}):void 0,U=l?P=>l(P,{...E.userNode}):void 0,Q=u?P=>u(P,{...E.userNode}):void 0,re=P=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=Y.getState();j&&(!ee||!T||ne>0)&&mg({id:e,store:Y,nodeRef:z}),t&&t(P,{...E.userNode})},ae=P=>{if(!(a2(P.nativeEvent)||w)){if(YC.includes(P.key)&&j){const ee=P.key==="Escape";mg({id:e,store:Y,unselect:ee,nodeRef:z})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(Hu,P.key)){P.preventDefault();const{ariaLabelConfig:ee}=Y.getState();Y.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:P.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),G({direction:Hu[P.key],factor:P.shiftKey?4:1})}}},Z=()=>{var be;if(w||!((be=z.current)!=null&&be.matches(":focus-visible")))return;const{transform:P,width:ee,height:ne,autoPanOnNodeFocus:ge,setCenter:he}=Y.getState();if(!ge)return;jm(new Map([[e,y]]),{x:0,y:0,width:ee,height:ne},P,!0).length>0||he(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:P[2]})};return m.jsx("div",{className:Ft(["react-flow__node",`react-flow__node-${N}`,{[v]:T},y.className,{selected:y.selected,selectable:j,parent:R,draggable:T,dragging:V}]),ref:z,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:H?"visible":"hidden",...y.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:re,onDoubleClick:Q,onKeyDown:F?ae:void 0,tabIndex:F?0:void 0,onFocus:F?Z:void 0,role:y.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${E2}-${C}`,"aria-label":y.ariaLabel,...y.domAttributes,children:m.jsx(sF,{value:e,children:m.jsx(D,{id:e,data:y.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:j,draggable:T,deletable:y.deletable??!0,isConnectable:B,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:V,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...X})})})}var AF=q.memo(kF);const NF=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function I2(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:a}=tt(NF,At),l=xF(e.onlyRenderVisibleElements),u=CF();return m.jsx("div",{className:"react-flow__nodes",style:kh,children:l.map(o=>m.jsx(AF,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}I2.displayName="NodeRenderer";const TF=q.memo(I2);function RF(e){return tt(q.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&wz({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),At)}const DF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},MF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},NS={[Bu.Arrow]:DF,[Bu.ArrowClosed]:MF};function jF(e){const t=Ct();return q.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(NS,e)?NS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const LF=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=jF(t);return c?m.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:m.jsx(c,{color:n,strokeWidth:u})}):null},z2=({defaultColor:e,rfId:t})=>{const n=tt(l=>l.edges),r=tt(l=>l.defaultEdgeOptions),a=q.useMemo(()=>Dz(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:a.map(l=>m.jsx(LF,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};z2.displayName="MarkerDefinitions";var OF=q.memo(z2);function H2({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,_]=q.useState({x:1,y:0,width:0,height:0}),v=Ft(["react-flow__edge-textwrapper",f]),w=q.useRef(null);return q.useEffect(()=>{if(w.current){const C=w.current.getBBox();_({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?m.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...p,children:[a&&m.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),m.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}H2.displayName="EdgeText";const BF=q.memo(H2);function Ah({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...p,d:e,fill:"none",className:Ft(["react-flow__edge-path",p.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?m.jsx(BF,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function TS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Me.Left||e===Me.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function F2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top}){const[u,o]=TS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=TS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,_,v]=l2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,_,v]}function P2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})=>{const[x,y,E]=F2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),R=e.isInternal?void 0:t;return m.jsx(Ah,{id:R,path:x,labelX:y,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})})}const IF=P2({isInternal:!1}),U2=P2({isInternal:!0});IF.displayName="SimpleBezierEdge";U2.displayName="SimpleBezierEdgeInternal";function $2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,sourcePosition:v=Me.Bottom,targetPosition:w=Me.Top,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=fg({sourceX:n,sourceY:r,sourcePosition:v,targetX:a,targetY:l,targetPosition:w,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:C,markerStart:b,interactionWidth:x})})}const G2=$2({isInternal:!1}),q2=$2({isInternal:!0});G2.displayName="SmoothStepEdge";q2.displayName="SmoothStepEdgeInternal";function V2(e){return q.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return m.jsx(G2,{...n,id:r,pathOptions:q.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const zF=V2({isInternal:!1}),Y2=V2({isInternal:!0});zF.displayName="StepEdge";Y2.displayName="StepEdgeInternal";function W2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[b,S,x]=h2({sourceX:n,sourceY:r,targetX:a,targetY:l}),y=e.isInternal?void 0:t;return m.jsx(Ah,{id:y,path:b,labelX:S,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})})}const HF=W2({isInternal:!1}),X2=W2({isInternal:!0});HF.displayName="StraightEdge";X2.displayName="StraightEdgeInternal";function K2(e){return q.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=Me.Bottom,targetPosition:o=Me.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=c2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:S==null?void 0:S.curvature}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:x})})}const FF=K2({isInternal:!1}),Z2=K2({isInternal:!0});FF.displayName="BezierEdge";Z2.displayName="BezierEdgeInternal";const RS={default:Z2,straight:X2,step:Y2,smoothstep:q2,simplebezier:U2},DS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},PF=(e,t,n)=>n===Me.Left?e-t:n===Me.Right?e+t:e,UF=(e,t,n)=>n===Me.Top?e-t:n===Me.Bottom?e+t:e,MS="react-flow__edgeupdater";function jS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return m.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Ft([MS,`${MS}-${o}`]),cx:PF(t,r,e),cy:UF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function $F({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:_,setUpdateHover:v}){const w=Ct(),C=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:D,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:F,cancelConnection:Y,nodeLookup:H,rfId:z,panBy:V,updateConnection:G}=w.getState(),X=R.type==="target",K=(O,$)=>{_(!1),d==null||d(O,n,R.type,$)},L=O=>f==null?void 0:f(n,O),M=(O,$)=>{_(!0),p==null||p(E,n,R.type),F==null||F(O,$)};gg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:D,handleId:R.id,nodeId:R.nodeId,nodeLookup:H,isTarget:X,edgeUpdaterType:R.type,lib:B,flowId:z,cancelConnection:Y,panBy:V,isValidConnection:(...O)=>{var $,U;return((U=($=w.getState()).isValidConnection)==null?void 0:U.call($,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var $,U;return(U=($=w.getState()).onConnectEnd)==null?void 0:U.call($,...O)},onReconnectEnd:K,updateConnection:G,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},b=E=>C(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=E=>C(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>v(!0),y=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(jS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&m.jsx(jS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function GF({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:b,onError:S,disableKeyboardA11y:x}){let y=tt(he=>he.edgeLookup.get(e));const E=tt(he=>he.defaultEdgeOptions);y=E?{...E,...y}:y;let R=y.type||"default",N=(C==null?void 0:C[R])||RS[R];N===void 0&&(S==null||S("011",ei.error011(R)),R="default",N=(C==null?void 0:C.default)||RS.default);const D=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),j=!!(y.selectable||r&&typeof y.selectable>"u"),B=q.useRef(null),[F,Y]=q.useState(!1),[H,z]=q.useState(!1),V=Ct(),{zIndex:G=y.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$}=tt(q.useCallback(he=>{const ye=he.nodeLookup.get(y.source),be=he.nodeLookup.get(y.target);if(!ye||!be)return DS;const ke=Rz({id:e,sourceNode:ye,targetNode:be,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:he.connectionMode,onError:S}),Ee=xz({selected:y.selected,zIndex:y.zIndex,sourceNode:ye,targetNode:be,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode});return{...ke||DS,zIndex:Ee}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),At),U=q.useMemo(()=>y.markerStart?`url('#${dg(y.markerStart,w)}')`:void 0,[y.markerStart,w]),Q=q.useMemo(()=>y.markerEnd?`url('#${dg(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||X===null||K===null||L===null||M===null)return null;const re=he=>{var Ee;const{addSelectedEdges:ye,unselectNodesAndEdges:be,multiSelectionActive:ke}=V.getState();j&&(V.setState({nodesSelectionActive:!1}),y.selected&&ke?(be({nodes:[],edges:[y]}),(Ee=B.current)==null||Ee.blur()):ye([e])),a&&a(he,y)},ae=l?he=>{l(he,{...y})}:void 0,Z=u?he=>{u(he,{...y})}:void 0,P=o?he=>{o(he,{...y})}:void 0,ee=c?he=>{c(he,{...y})}:void 0,ne=f?he=>{f(he,{...y})}:void 0,ge=he=>{var ye;if(!x&&YC.includes(he.key)&&j){const{unselectNodesAndEdges:be,addSelectedEdges:ke}=V.getState();he.key==="Escape"?((ye=B.current)==null||ye.blur(),be({edges:[y]})):ke([e])}};return m.jsx("svg",{style:{zIndex:G},children:m.jsxs("g",{className:Ft(["react-flow__edge",`react-flow__edge-${R}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!j&&!a,updating:F,selectable:j}]),onClick:re,onDoubleClick:ae,onContextMenu:Z,onMouseEnter:P,onMouseMove:ee,onMouseLeave:ne,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,role:y.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":D?`${k2}-${w}`:void 0,ref:B,...y.domAttributes,children:[!H&&m.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:j,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:U,markerEnd:Q,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&m.jsx($F,{edge:y,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,setUpdateHover:Y,setReconnecting:z})]})})}var qF=q.memo(GF);const VF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Q2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,onError:y}=tt(VF,At),E=RF(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(OF,{defaultColor:e,rfId:n}),E.map(R=>m.jsx(qF,{id:R,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:C},R))]})}Q2.displayName="EdgeRenderer";const YF=q.memo(Q2),LS=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function WF({children:e}){const t=Ct(),n=q.useRef(null),[r]=q.useState(()=>t.getState().transform);return R2(()=>{let a=null;const l=()=>{const u=t.getState().transform;a&&u[0]===a[0]&&u[1]===a[1]&&u[2]===a[2]||(a=u,n.current&&(n.current.style.transform=LS(u)))};return l(),t.subscribe(l)},[t]),m.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:LS(r)},children:e})}function XF(e){const t=Um(),n=q.useRef(!1);q.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const KF=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ZF(e){const t=tt(KF),n=Ct();return q.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function QF(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function JF(e){return QF}function eP(e){const t=JF();return tt(t,At)}const tP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=tt(tP,At);return!(l&&a&&c)?null:m.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:Ft(["react-flow__connection",KC(o)]),children:m.jsx(J2,{style:t,type:n,CustomComponent:r,isValid:o})})})}const J2=({style:e,type:t=Er.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:_,pointer:v}=eP();if(!a)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:_,connectionStatus:KC(r),toNode:p,toHandle:d,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:_};switch(t){case Er.Bezier:[w]=c2(C);break;case Er.SimpleBezier:[w]=F2(C);break;case Er.Step:[w]=fg({...C,borderRadius:0});break;case Er.SmoothStep:[w]=fg(C);break;default:[w]=h2(C)}return m.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};J2.displayName="ConnectionLine";const iP={};function OS(e=iP){q.useRef(e),Ct(),q.useEffect(()=>{},[e])}function rP(){Ct(),q.useRef(!1),q.useEffect(()=>{},[])}function eE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:_,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:F,translateExtent:Y,minZoom:H,maxZoom:z,preventScrolling:V,defaultMarkerColor:G,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:ge,nodeClickDistance:he,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,viewport:de,onViewportChange:Se,nodesDraggable:Ae}){return OS(e),OS(t),rP(),XF(n),ZF(de),m.jsx(bF,{onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:$,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:U,autoPanOnSelection:Q,defaultViewport:F,translateExtent:Y,minZoom:H,maxZoom:z,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,onViewportChange:Se,isControlledViewport:!!de,children:m.jsxs(WF,{children:[m.jsx(YF,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,defaultMarkerColor:G,noPanClassName:ht,disableKeyboardA11y:Fe,rfId:ie}),m.jsx(nP,{style:C,type:w,component:b,containerStyle:S}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(TF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:he,onlyRenderVisibleElements:j,noPanClassName:ht,noDragClassName:ct,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,nodesDraggable:Ae}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}eE.displayName="GraphView";const sP=q.memo(eE),aP=n2(),BS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:_="basic"}={})=>{const v=new Map,w=new Map,C=new Map,b=new Map,S=r??t??[],x=n??e??[],y=p??[0,0],E=d??tl;p2(C,b,S);const{nodesInitialized:R}=pg(x,v,w,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let N=[0,0,1];if(u&&a&&l){const D=ml(v,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:T,y:j,zoom:B}=Om(D,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:R,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:b,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:tl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ma.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...XC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:aP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:WC,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},oP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_})=>yH((v,w)=>{async function C(){const{nodeLookup:b,panZoom:S,fitViewOptions:x,fitViewResolver:y,width:E,height:R,minZoom:N,maxZoom:D}=w();S&&(await gz({nodes:b,width:E,height:R,panZoom:S,minZoom:N,maxZoom:D},x),y==null||y.resolve(!0),v({fitViewResolver:null}))}return{...BS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:_}),setNodes:b=>{const{nodeLookup:S,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:N,nodesSelectionActive:D}=w(),{nodesInitialized:T,hasSelectedNodes:j}=pg(b,S,x,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=D&&j;R&&T?(C(),v({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):v({nodes:b,nodesInitialized:T,nodesSelectionActive:B})},setEdges:b=>{const{connectionLookup:S,edgeLookup:x}=w();p2(S,x,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:x}=w();x(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:x}=w();x(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:x,parentLookup:y,domNode:E,nodeOrigin:R,nodeExtent:N,debug:D,fitViewQueued:T,zIndexMode:j}=w(),{changes:B,updatedInternals:F}=zz(b,x,y,E,R,N,j);F&&(Lz(x,y,{nodeOrigin:R,nodeExtent:N,zIndexMode:j}),T?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(D&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(b,S=!1)=>{const x=[];let y=[];const{nodeLookup:E,triggerNodeChanges:R,connection:N,updateConnection:D,onNodesChangeMiddlewareMap:T}=w();for(const[j,B]of b){const F=E.get(j),Y=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(B!=null&&B.position)),H={id:j,type:"position",position:Y?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(F&&N.inProgress&&N.fromNode.id===F.id){const z=ls(F,N.fromHandle,Me.Left,!0);D({...N,from:z})}Y&&F.parentId&&x.push({id:j,parentId:F.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),y.push(H)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=w(),F=Pm(x,E,j,B);y.push(...F)}for(const j of T.values())y=j(y);R(y)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:x,nodes:y,hasDefaultNodes:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=FH(b,y);x(N)}R&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:x,edges:y,hasDefaultEdges:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=PH(b,y);x(N)}R&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));E(N);return}E(ca(y,new Set([...b]),!0)),R(ca(x))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));R(N);return}R(ca(x,new Set([...b]))),E(ca(y,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:x,nodes:y,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:N}=w(),D=b||y,T=S||x,j=[];for(const F of D){if(!F.selected)continue;const Y=E.get(F.id);Y&&(Y.selected=!1),j.push(Zr(F.id,!1))}const B=[];for(const F of T)F.selected&&B.push(Zr(F.id,!1));R(j),N(B)},setMinZoom:b=>{const{panZoom:S,maxZoom:x}=w();S==null||S.setScaleExtent([b,x]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:x}=w();S==null||S.setScaleExtent([x,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=w().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:E}=w();if(!E)return;const R=S.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]),N=b.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]);x(R),y(N)},setNodeExtent:b=>{const{nodes:S,nodeLookup:x,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:N,zIndexMode:D}=w();b[0][0]===N[0][0]&&b[0][1]===N[0][1]&&b[1][0]===N[1][0]&&b[1][1]===N[1][1]||(pg(S,x,y,{nodeOrigin:E,nodeExtent:b,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:D}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:x,height:y,panZoom:E,translateExtent:R}=w();return Hz({delta:b,panZoom:E,transform:S,translateExtent:R,width:x,height:y})},setCenter:async(b,S,x)=>{const{width:y,height:E,maxZoom:R,panZoom:N}=w();if(!N)return!1;const D=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:R;return await N.setViewport({x:y/2-b*D,y:E/2-S*D,zoom:D},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{v({connection:{...XC}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...BS()})}},Object.is);function lP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_,children:v}){const[w]=q.useState(()=>oP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:_}));return m.jsx(bH,{value:w,children:m.jsx(VH,{children:m.jsx(oF,{children:v})})})}function cP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v}){return q.useContext(Ch)?m.jsx(m.Fragment,{children:e}):m.jsx(lP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v,children:e})}const uP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:_,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:F,onDelete:Y,onSelectionChange:H,onSelectionDragStart:z,onSelectionDrag:V,onSelectionDragStop:G,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:$=Er.Bezier,connectionLineStyle:U,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:ae="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:P=!1,selectionMode:ee=nl.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ge=rl()?"Meta":"Control",zoomActivationKeyCode:he=rl()?"Meta":"Control",snapToGrid:ye,snapGrid:be,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ee,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,nodeOrigin:ct=A2,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe=!0,defaultViewport:fe=jH,minZoom:ie=.5,maxZoom:de=2,translateExtent:Se=tl,preventScrolling:Ae=!0,nodeExtent:De,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:Ie=!0,zoomOnPinch:Nt=!0,panOnScroll:Et=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:st=ts.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:Ut=!0,onPaneClick:ps,onPaneMouseEnter:mi,onPaneMouseMove:_i,onPaneMouseLeave:vi,onPaneScroll:On,onPaneContextMenu:yi,paneClickDistance:ni=1,nodeClickDistance:oe=0,children:we,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl=10,onNodesChange:bl,onEdgesChange:ii,noDragClassName:$t="nodrag",noWheelClassName:Qt="nowheel",noPanClassName:Si="nopan",fitView:ms,fitViewOptions:Sl,connectOnClick:Nh,attributionPosition:xl,proOptions:Rr,defaultEdgeOptions:Na,elevateNodesOnSelect:Yi=!0,elevateEdgesOnSelect:Wi=!1,disableKeyboardA11y:Xi=!1,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanOnSelection:wl=!0,autoPanSpeed:Cl,connectionRadius:xi,isValidConnection:Zi,onError:Th,style:El,id:Ta,nodeDragThreshold:Rh,connectionDragThreshold:_s,viewport:vs,onViewportChange:qn,width:an,height:kl,colorMode:Dh="light",debug:Ra,onScroll:Dr,ariaLabelConfig:ys,zIndexMode:Al="basic",...on},Da){const bs=Ta||"1",Ma=IH(Dh),Qi=q.useCallback(ja=>{ja.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(ja)},[Dr]);return m.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:Qi,style:{...El,...uP},ref:Da,className:Ft(["react-flow",a,Ma]),id:Ta,role:"application",children:m.jsxs(cP,{nodes:e,edges:t,width:an,height:kl,fitView:ms,fitViewOptions:Sl,minZoom:ie,maxZoom:de,nodeOrigin:ct,nodeExtent:De,zIndexMode:Al,children:[m.jsx(BH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe,elevateNodesOnSelect:Yi,elevateEdgesOnSelect:Wi,minZoom:ie,maxZoom:de,nodeExtent:De,onNodesChange:bl,onEdgesChange:ii,snapToGrid:ye,snapGrid:be,connectionMode:O,translateExtent:Se,connectOnClick:Nh,defaultEdgeOptions:Na,fitView:ms,fitViewOptions:Sl,onNodesDelete:B,onEdgesDelete:F,onDelete:Y,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:V,onSelectionDragStart:z,onSelectionDragStop:G,onMove:p,onMoveStart:d,onMoveEnd:_,noPanClassName:Si,nodeOrigin:ct,rfId:bs,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanSpeed:Cl,onError:Th,connectionRadius:xi,isValidConnection:Zi,selectNodesOnDrag:Ee,nodeDragThreshold:Rh,connectionDragThreshold:_s,onBeforeDelete:M,debug:Ra,ariaLabelConfig:ys,zIndexMode:Al}),m.jsx(sP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:P,selectionMode:ee,deleteKeyCode:ae,multiSelectionKeyCode:ge,panActivationKeyCode:ne,zoomActivationKeyCode:he,onlyRenderVisibleElements:ke,defaultViewport:fe,translateExtent:Se,minZoom:ie,maxZoom:de,preventScrolling:Ae,zoomOnScroll:Ie,zoomOnPinch:Nt,zoomOnDoubleClick:Ln,panOnScroll:Et,panOnScrollSpeed:qt,panOnScrollMode:st,panOnDrag:Ut,autoPanOnSelection:wl,onPaneClick:ps,onPaneMouseEnter:mi,onPaneMouseMove:_i,onPaneMouseLeave:vi,onPaneScroll:On,onPaneContextMenu:yi,paneClickDistance:ni,nodeClickDistance:oe,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl,defaultMarkerColor:Ve,noDragClassName:$t,noWheelClassName:Qt,noPanClassName:Si,rfId:bs,disableKeyboardA11y:Xi,nodeExtent:De,viewport:vs,onViewportChange:qn,nodesDraggable:Ce}),m.jsx(MH,{onSelectionChange:H}),we,m.jsx(AH,{proOptions:Rr,position:xl}),m.jsx(kH,{rfId:bs,disableKeyboardA11y:Xi})]})})}var fP=T2(hP);function dP({dimensions:e,lineWidth:t,variant:n,className:r}){return m.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ft(["react-flow__background-pattern",n,r])})}function pP({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Ft(["react-flow__background-pattern","dots",t])})}var Ui;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ui||(Ui={}));const gP={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},mP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tE({id:e,variant:t=Ui.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=q.useRef(null),{transform:_,patternId:v}=tt(mP,At),w=r||gP[t],C=t===Ui.Dots,b=t===Ui.Cross,S=Array.isArray(n)?n:[n,n],x=[S[0]*_[2]||1,S[1]*_[2]||1],y=w*_[2],E=Array.isArray(l)?l:[l,l],R=b?[y,y]:x,N=[E[0]*_[2]||1+R[0]/2,E[1]*_[2]||1+R[1]/2],D=`${v}${e||""}`;return m.jsxs("svg",{className:Ft(["react-flow__background",f]),style:{...c,...kh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[m.jsx("pattern",{id:D,x:_[0]%x[0],y:_[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:C?m.jsx(pP,{radius:y/2,className:p}):m.jsx(dP,{dimensions:R,lineWidth:a,variant:t,className:p})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}tE.displayName="Background";const _P=q.memo(tE);function vP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function SP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function xP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function su({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Ft(["react-flow__controls-button",t]),...n,children:e})}const wP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:_="vertical","aria-label":v}){const w=Ct(),{isInteractive:C,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:x}=tt(wP,At),{zoomIn:y,zoomOut:E,fitView:R}=Um(),N=()=>{y(),l==null||l()},D=()=>{E(),u==null||u()},T=()=>{R(a),o==null||o()},j=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),c==null||c(!C)},B=_==="horizontal"?"horizontal":"vertical";return m.jsxs(Eh,{className:Ft(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??x["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(su,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:S,children:m.jsx(vP,{})}),m.jsx(su,{onClick:D,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:b,children:m.jsx(yP,{})})]}),n&&m.jsx(su,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:m.jsx(bP,{})}),r&&m.jsx(su,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:C?m.jsx(xP,{}):m.jsx(SP,{})}),p]})}nE.displayName="Controls";q.memo(nE);function CP({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:_,onClick:v}){const{background:w,backgroundColor:C}=l||{},b=u||w||C;return m.jsx("rect",{className:Ft(["react-flow__minimap-node",{selected:_},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:b,stroke:o,strokeWidth:c},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const EP=q.memo(CP),kP=e=>e.nodes.map(t=>t.id),kp=e=>e instanceof Function?e:()=>e;function AP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=EP,onClick:u}){const o=tt(kP,At),c=kp(t),f=kp(e),p=kp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:o.map(_=>m.jsx(TP,{id:_,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},_))})}function NP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:_,height:v}=tt(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const b=C.internals.userNode,{x:S,y:x}=C.internals.positionAbsolute,{width:y,height:E}=gi(b);return{node:b,x:S,y:x,width:y,height:E}},At);return!f||f.hidden||!i2(f)?null:m.jsx(o,{x:p,y:d,width:_,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const TP=q.memo(NP);var RP=q.memo(AP);const DP=200,MP=150,jP=e=>!e.hidden,LP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?e2(ml(e.nodeLookup,{filter:jP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},IS=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,OP=(e,t)=>IS(e.viewBB,t.viewBB)&&IS(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,BP="react-flow__minimap-desc";function iE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:_="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:b=!1,ariaLabel:S,inversePan:x,zoomStep:y=1,offsetScale:E=5}){const R=Ct(),N=q.useRef(null),{boundingRect:D,viewBB:T,rfId:j,panZoom:B,translateExtent:F,flowWidth:Y,flowHeight:H,ariaLabelConfig:z}=tt(LP,OP),V=(e==null?void 0:e.width)??DP,G=(e==null?void 0:e.height)??MP,X=D.width/V,K=D.height/G,L=Math.max(X,K),M=L*V,O=L*G,$=E*L,U=D.x-(M-D.width)/2-$,Q=D.y-(O-D.height)/2-$,re=M+$*2,ae=O+$*2,Z=`${BP}-${j}`,P=q.useRef(0),ee=q.useRef();P.current=L,q.useEffect(()=>{if(N.current&&B)return ee.current=Wz({domNode:N.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>P.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),q.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:F,width:Y,height:H,inversePan:x,pannable:C,zoomStep:y,zoomable:b})},[C,b,x,y,F,Y,H]);const ne=v?ye=>{var Ee;const[be,ke]=((Ee=ee.current)==null?void 0:Ee.pointer(ye))||[0,0];v(ye,{x:be,y:ke})}:void 0,ge=w?q.useCallback((ye,be)=>{const ke=R.getState().nodeLookup.get(be).internals.userNode;w(ye,ke)},[]):void 0,he=S??z["minimap.ariaLabel"];return m.jsx(Eh,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Ft(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:V,height:G,viewBox:`${U} ${Q} ${re} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[he&&m.jsx("title",{id:Z,children:he}),m.jsx(RP,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${Q-$}h${re+$*2}v${ae+$*2}h${-re-$*2}z + M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}iE.displayName="MiniMap";q.memo(iE);const IP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,zP={[ya.Line]:"right",[ya.Handle]:"bottom-right"};function HP({nodeId:e,position:t,variant:n=ya.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:_,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:b,onResizeEnd:S}){const x=L2(),y=typeof e=="string"?e:x,E=Ct(),R=q.useRef(null),N=n===ya.Handle,D=tt(q.useCallback(IP(N&&v),[N,v]),At),T=q.useRef(null),j=t??zP[n];q.useEffect(()=>{if(!(!R.current||!y))return T.current||(T.current=oH({domNode:R.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:F,transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V,domNode:G}=E.getState();return{nodeLookup:F,transform:Y,snapGrid:H,snapToGrid:z,nodeOrigin:V,paneDomNode:G}},onChange:(F,Y)=>{const{triggerNodeChanges:H,nodeLookup:z,parentLookup:V,nodeOrigin:G}=E.getState(),X=[],K={x:F.x,y:F.y},L=z.get(y);if(L&&L.expandParent&&L.parentId){const M=L.origin??G,O=F.width??L.measured.width??0,$=F.height??L.measured.height??0,U={id:L.id,parentId:L.parentId,rect:{width:O,height:$,...r2({x:F.x??L.position.x,y:F.y??L.position.y},{width:O,height:$},L.parentId,z,M)}},Q=Pm([U],z,V,G);X.push(...Q),K.x=F.x?Math.max(M[0]*O,F.x):void 0,K.y=F.y?Math.max(M[1]*$,F.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:y,type:"position",position:{...K}};X.push(M)}if(F.width!==void 0&&F.height!==void 0){const O={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};X.push(O)}for(const M of Y){const O={...M,type:"position"};X.push(O)}H(X)},onEnd:({width:F,height:Y})=>{const H={id:y,type:"dimensions",resizing:!1,dimensions:{width:F,height:Y}};E.getState().triggerNodeChanges([H])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:_,onResizeStart:C,onResize:b,onResizeEnd:S,shouldResize:w}),()=>{var F;(F=T.current)==null||F.destroy()}},[j,o,c,f,p,d,C,b,S,w]);const B=j.split("-");return m.jsx("div",{className:Ft(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...a,scale:D,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}q.memo(HP);const _g=264,FP=132,yu=44,PP=72;function UP(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function bu(e){if(e.children.length===0)return _g;const t=e.children.reduce((n,r)=>n+bu(r),0)+yu*(e.children.length-1);return Math.max(_g,t)}function $P(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const GP=q.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",_=l?"BASELINE":d?"RUNNING":"EXPERIMENT",v=a.slice(-8);return m.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[m.jsx(ba,{type:"target",position:Me.Top}),m.jsxs("div",{className:"node-eyebrow",children:[m.jsx("span",{children:_}),m.jsx(Vo,{status:p??"idle"})]}),m.jsx("div",{className:"node-head",children:m.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&m.jsx("div",{className:"node-title",children:n.title||n.description}),m.jsxs("div",{className:"node-meta",children:[m.jsx("span",{children:"RUNS"}),v.length>0?m.jsx("span",{className:"run-squares",children:v.map(w=>m.jsx("span",{className:`run-sq ${$P(w.status)}`,title:w.status},w.id))}):m.jsx("span",{children:"no runs"}),m.jsx("span",{style:{flex:1}}),r&&m.jsx("span",{children:Sa(r.createdAt)})]}),m.jsxs("div",{className:"node-actions",onClick:w=>w.stopPropagation(),children:[m.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[m.jsx($u,{size:13}),"Changes"]}),a.length>0&&m.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[m.jsx(XS,{size:13}),"Logs"]}),m.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[m.jsx(VS,{size:13}),"Code"]}),m.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:xg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:m.jsx(pm,{size:13})})]}),m.jsx(ba,{type:"source",position:Me.Bottom})]})}),qP={exp:GP},VP={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function YP({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=q.useMemo(()=>{const o=new Map;for(const v of t){const w=o.get(v.experimentId);w?w.push(v):o.set(v.experimentId,[v])}for(const v of o.values())v.sort((w,C)=>w.createdAt-C.createdAt);const c=[],f=[],p=UP(e);function d(v,w,C){const b=o.get(v.exp.id)??[];if(c.push({id:v.exp.id,type:"exp",position:{x:w-_g/2,y:C},data:{exp:v.exp,latestRun:b[b.length-1]??null,runs:b,isBaseline:!v.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),v.children.length===0)return;const S=v.children.reduce((y,E)=>y+bu(E),0)+yu*(v.children.length-1);let x=w-S/2;for(const y of v.children){const E=bu(y);f.push({id:`e-${v.exp.id}-${y.exp.id}`,source:v.exp.id,target:y.exp.id}),d(y,x+E/2,C+FP+PP),x+=E+yu}}let _=0;for(const v of p){const w=bu(v);d(v,_+w/2,0),_+=w+yu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?m.jsxs("div",{className:"empty-state empty-state-cta",children:[m.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),m.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):m.jsx(fP,{nodes:l,edges:u,nodeTypes:qP,defaultEdgeOptions:VP,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:m.jsx(_P,{variant:Ui.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const au=(e,t)=>e.id===t.id&&e.view===t.view,ou=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,zS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function WP(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const HS="orx:onboarded",rE="orx:panel-width",Fu=360,XP=10,KP=232,ZP=380,QP=KP+56,JP=80;function vg(){return Math.max(Fu,window.innerWidth-QP-ZP)}function eU(){const e=vg();try{const t=Number(localStorage.getItem(rE));if(Number.isFinite(t)&&t>=Fu)return Math.min(t,e)}catch{}return Math.max(Fu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function lu(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function tU(){var ht,Fe;const[e,t]=q.useState(null),[n,r]=q.useState(null),[a,l]=q.useState([]),[u,o]=q.useState([]),[c,f]=q.useState(null),[p,d]=q.useState("tree"),[_,v]=q.useState(null),[w,C]=q.useState("experiments"),[b,S]=q.useState([]),[x,y]=q.useState([]),[E,R]=q.useState([]),[N,D]=q.useState(null),[T,j]=q.useState(!0),[B,F]=q.useState(!1),[Y,H]=q.useState(eU),[z,V]=q.useState(!0),[G,X]=q.useState(!1),[K,L]=q.useState("chat"),[M,O]=q.useState(()=>{try{return localStorage.getItem(HS)==="1"}catch{return!0}}),$=q.useRef(n);$.current=n,q.useEffect(()=>{DN().then(fe=>{t(fe),r(ie=>{var de;return ie??((de=fe[0])==null?void 0:de.id)??null})}).catch(()=>t([]))},[]),q.useEffect(()=>{const fe=()=>H(ie=>Math.min(ie,vg()));return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[]),q.useEffect(()=>{n&&(ON(n).catch(()=>{}),l([]),o([]),f(null),v(null),S([]),y([]),R([]),D(null),C("experiments"),IN(n).then(l).catch(()=>{}),zN(n).then(o).catch(()=>{}),Iy(n).then(f).catch(()=>{}))},[n]);const U=q.useCallback(()=>{const fe=$.current;fe&&Iy(fe).then(f).catch(()=>{})},[]);DT({onRun:fe=>{fe.projectId===$.current&&o(ie=>lu(ie,fe))},onExperiment:fe=>{fe.projectId===$.current&&l(ie=>lu(ie,fe))},onProject:fe=>{t(ie=>ie?lu(ie,fe):[fe])},onFiles:fe=>{fe===$.current&&U()}});const Q=q.useCallback((fe,ie="changes")=>{const de={id:fe,view:ie};S(Se=>Se.some(Ae=>au(Ae,de))?Se:[...Se,de]),C(de),j(!0)},[]),re=q.useCallback(fe=>{const ie=b.findIndex(Se=>au(Se,fe));if(ie===-1)return;const de=b.filter((Se,Ae)=>Ae!==ie);S(de),typeof w=="object"&&"view"in w&&au(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[b,w]),ae=q.useCallback((fe,ie,de)=>{var De;const Se=(De=e==null?void 0:e.find(Ve=>Ve.id===n))==null?void 0:De.repoPath,Ae=WP(fe,Se,ie);Ae&&(de&&(Ae.ref=de),y(Ve=>Ve.some(Ie=>ou(Ie,Ae))?Ve:[...Ve,Ae]),C(Ae),j(!0))},[e,n]),Z=q.useCallback(fe=>{const ie=x.findIndex(Se=>ou(Se,fe));if(ie===-1)return;const de=x.filter((Se,Ae)=>Ae!==ie);y(de),typeof w=="object"&&"path"in w&&ou(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[x,w]),P=q.useCallback((fe,ie,de)=>{const Se={kind:"plan",sessionId:ie,promptId:de,plan:fe};R(Ae=>{const De=Ae.findIndex(Ie=>Ie.promptId===de);if(De===-1)return[...Ae,Se];const Ve=Ae.slice();return Ve[De]=Se,Ve}),C(Se),j(!0)},[]),ee=q.useCallback(fe=>{const ie=E.findIndex(Se=>Se.promptId===fe.promptId);if(ie===-1)return;const de=E.filter((Se,Ae)=>Ae!==ie);R(de),typeof w=="object"&&"kind"in w&&w.promptId===fe.promptId&&C(de[Math.min(ie,de.length-1)]??"experiments")},[E,w]),ne=q.useCallback(fe=>{const ie={code:!0,sel:fe,toggled:new Set};D(de=>de?{...de,sel:fe}:ie),C(ie),j(!0)},[]),ge=q.useCallback(fe=>{D(ie=>ie&&{...ie,...fe})},[]),he=q.useCallback(()=>{D(null),C(fe=>typeof fe=="object"&&"code"in fe?"experiments":fe)},[]),ye=fe=>{fe.preventDefault(),fe.currentTarget.setPointerCapture(fe.pointerId);const ie=document.body.style.userSelect;document.body.style.userSelect="none";const de=Ae=>{const De=Math.round(window.innerWidth-Ae.clientX-XP),Ve=vg();if(De>Ve+JP){F(!0);return}F(!1);const Ie=Math.min(Math.max(De,Fu),Ve);H(Ie);try{localStorage.setItem(rE,String(Ie))}catch{}},Se=()=>{window.removeEventListener("pointermove",de),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se),document.body.style.userSelect=ie};window.addEventListener("pointermove",de),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se)},be=fe=>{t(ie=>ie?lu(ie,fe):[fe]),r(fe.id),X(!1)},ke=fe=>{t(ie=>ie&&ie.filter(de=>de.id!==fe)),n===fe&&r(null)},Ee=typeof w=="object"&&"view"in w?w:null,Ce=typeof w=="object"&&"path"in w?w:null,rt=typeof w=="object"&&"kind"in w?w:null,bt=typeof w=="object"&&"code"in w,Ge=(e==null?void 0:e.find(fe=>fe.id===n))??null,ct=Ee?a.find(fe=>fe.id===Ee.id)??null:null;if(e===null)return m.jsx("div",{className:"app",children:m.jsx("div",{className:"empty-state",children:m.jsx("span",{className:"spinner"})})});if(e.length===0)return m.jsx("div",{className:"app",children:M?m.jsx(Nb,{projects:e,onOpen:r,onCreated:be,onDeleted:ke}):m.jsx(SB,{onDone:()=>{try{localStorage.setItem(HS,"1")}catch{}O(!0)}})});const Pt=m.jsx(bB,{projectName:((ht=e.find(fe=>fe.id===n))==null?void 0:ht.name)??"",onHome:()=>X(!0),onCollapse:()=>V(!1)});return m.jsx("div",{className:"app",children:G?m.jsx(Nb,{projects:e,onOpen:fe=>{r(fe),X(!1)},onCreated:be,onDeleted:ke}):m.jsxs("div",{className:"app-body",children:[n&&m.jsx(ML,{projectId:n,paperId:(Fe=e.find(fe=>fe.id===n))==null?void 0:Fe.paperId,railHeader:Pt,railOpen:z,onShowRail:()=>V(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&F(!1),j(!T)},onOpenFile:ae,onOpenPlan:P,children:K==="files"?(()=>{const fe=e.find(ie=>ie.id===n);return fe?m.jsx(GL,{project:fe,files:c,onChanged:U,onOpenStorage:()=>L("storage")}):null})():K!=="chat"?m.jsx(_L,{tab:K}):null}),K==="chat"&&T&&m.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:Y},children:[!B&&m.jsx("div",{className:"panel-resizer",onPointerDown:ye}),m.jsxs("div",{className:"tabs",children:[m.jsxs("div",{className:"tab-strip",children:[m.jsx("button",{className:`tab ${w==="experiments"?"active":""}`,onClick:()=>C("experiments"),children:"Experiments"}),b.map(fe=>{const ie=a.find(de=>de.id===fe.id);return m.jsx(Gc,{active:Ee!==null&&au(Ee,fe),label:ie?ie.title||ie.slug:"…",icon:fe.view==="terminal"?m.jsx(XS,{size:12,style:{flexShrink:0}}):m.jsx($u,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>re(fe)},`${fe.id}:${fe.view}`)}),x.map(fe=>m.jsx(Gc,{active:Ce!==null&&ou(Ce,fe),label:fe.path.split("/").pop()||fe.path,icon:m.jsx(GS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>Z(fe)},`file:${zS(fe)}`)),E.map(fe=>m.jsx(Gc,{active:rt!==null&&rt.promptId===fe.promptId,label:"Plan",icon:m.jsx(WS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>ee(fe)},`plan:${fe.promptId}`)),N&&m.jsx(Gc,{active:bt,label:"Code",icon:m.jsx(VS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(N),onClose:he},"code")]}),m.jsxs("div",{className:"panel-controls",children:[m.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>F(fe=>!fe),children:B?m.jsx(_N,{size:14}):m.jsx(gN,{size:14})}),m.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),F(!1)},children:m.jsx(Fo,{size:14})})]})]}),w==="experiments"?m.jsxs("div",{className:"tab-body",children:[m.jsx("div",{className:"pane-toolbar",children:m.jsxs("div",{className:"seg",children:[m.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),m.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),m.jsx("div",{className:"pane-content",children:p==="tree"?Ge&&m.jsx(YP,{experiments:a,runs:u,project:Ge,onOpenView:Q,onOpenCodeBranch:ne}):m.jsx(DB,{runs:u,experiments:a,onOpen:fe=>{v(fe.id),Q(fe.experimentId,"terminal")},onOpenChanges:fe=>Q(fe,"changes"),onCancel:fe=>void ZS(fe).catch(()=>{})})})]}):Ce?m.jsx("div",{className:"tab-body",children:n&&m.jsx(yB,{projectId:n,path:Ce.path,sessionId:Ce.sessionId,gitRef:Ce.ref,onOpenFile:ae},zS(Ce))}):rt?m.jsx("div",{className:"tab-body",children:m.jsx("div",{className:"pane-content plan-tab-content",children:m.jsx(qo,{text:rt.plan,onOpenFile:fe=>ae(fe,rt.sessionId)})})}):bt?m.jsx("div",{className:"tab-body",children:n&&Ge&&N&&m.jsx(OL,{projectId:n,project:Ge,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:fe=>ge({sel:fe}),onToggledChange:fe=>ge({toggled:fe}),onOpenFile:ae},"code")}):m.jsx("div",{className:"tab-body",children:Ee&&ct&&Ge&&m.jsx(gB,{experiment:ct,project:Ge,view:Ee.view,runs:u,selectedRunId:_,onSelectRun:v},`${Ee.id}:${Ee.view}`)})]})]})})}yA.createRoot(document.getElementById("root")).render(m.jsx(q.StrictMode,{children:m.jsx(tU,{})})); diff --git a/ui/dist/index.html b/ui/dist/index.html index 938440f..15a3269 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -8,8 +8,8 @@ html { background: #ffffff; } @media (prefers-color-scheme: dark) { html { background: #0e0c0c; } } </style> - <script type="module" crossorigin src="/assets/index-DE9xlq83.js"></script> - <link rel="stylesheet" crossorigin href="/assets/index-Dj5p3Wr0.css"> + <script type="module" crossorigin src="/assets/index-DgScguTc.js"></script> + <link rel="stylesheet" crossorigin href="/assets/index-BsmS7b0n.css"> </head> <body> <div id="root"></div> From a6c6fae8b02f12381775fbadfbb5801c8d7cd0a4 Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 16:58:59 -0700 Subject: [PATCH 4/7] =?UTF-8?q?Drop=20leftover=20rebuilt=20dist=20assets?= =?UTF-8?q?=20=E2=80=94=20ui/dist=20now=20matches=20origin/main=20exactly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/dist/assets/index-DE9xlq83.js | 381 ------------------------------ ui/dist/assets/index-Dj5p3Wr0.css | 32 --- 2 files changed, 413 deletions(-) delete mode 100644 ui/dist/assets/index-DE9xlq83.js delete mode 100644 ui/dist/assets/index-Dj5p3Wr0.css diff --git a/ui/dist/assets/index-DE9xlq83.js b/ui/dist/assets/index-DE9xlq83.js deleted file mode 100644 index 862f450..0000000 --- a/ui/dist/assets/index-DE9xlq83.js +++ /dev/null @@ -1,381 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Pu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Id={exports:{}},xo={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ey;function aA(){if(Ey)return xo;Ey=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return xo.Fragment=t,xo.jsx=n,xo.jsxs=n,xo}var ky;function oA(){return ky||(ky=1,Id.exports=aA()),Id.exports}var m=oA(),zd={exports:{}},He={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ay;function lA(){if(Ay)return He;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),_=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=_&&O[_]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function S(O,$,F){this.props=O,this.context=$,this.refs=b,this.updater=F||w}S.prototype.isReactComponent={},S.prototype.setState=function(O,$){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,$,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function x(){}x.prototype=S.prototype;function y(O,$,F){this.props=O,this.context=$,this.refs=b,this.updater=F||w}var E=y.prototype=new x;E.constructor=y,C(E,S.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function j(O,$,F){var Q=F.ref;return{$$typeof:e,type:O,key:$,ref:Q!==void 0?Q:null,props:F}}function B(O,$){return j(O.type,$,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function G(O){var $={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(F){return $[F]})}var U=/\/+/g;function H(O,$){return typeof O=="object"&&O!==null&&O.key!=null?G(""+O.key):$.toString(36)}function Y(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function($){O.status==="pending"&&(O.status="fulfilled",O.value=$)},function($){O.status==="pending"&&(O.status="rejected",O.reason=$)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function q(O,$,F,Q,re){var ae=typeof O;(ae==="undefined"||ae==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case t:Z=!0;break;case p:return Z=O._init,q(Z(O._payload),$,F,Q,re)}}if(Z)return re=re(O),Z=Q===""?"."+H(O,0):Q,R(re)?(F="",Z!=null&&(F=Z.replace(U,"$&/")+"/"),q(re,$,F,"",function(ne){return ne})):re!=null&&(z(re)&&(re=B(re,F+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(U,"$&/")+"/")+Z)),$.push(re)),1;Z=0;var P=Q===""?".":Q+":";if(R(O))for(var ee=0;ee<O.length;ee++)Q=O[ee],ae=P+H(Q,ee),Z+=q(Q,$,F,ae,re);else if(ee=v(O),typeof ee=="function")for(O=ee.call(O),ee=0;!(Q=O.next()).done;)Q=Q.value,ae=P+H(Q,ee++),Z+=q(Q,$,F,ae,re);else if(ae==="object"){if(typeof O.then=="function")return q(Y(O),$,F,Q,re);throw $=String(O),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Z}function X(O,$,F){if(O==null)return O;var Q=[],re=0;return q(O,Q,"","",function(ae){return $.call(F,ae,re++)}),Q}function K(O){if(O._status===-1){var $=O._result;$=$(),$.then(function(F){(O._status===0||O._status===-1)&&(O._status=1,O._result=F)},function(F){(O._status===0||O._status===-1)&&(O._status=2,O._result=F)}),O._status===-1&&(O._status=0,O._result=$)}if(O._status===1)return O._result.default;throw O._result}var L=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},M={map:X,forEach:function(O,$,F){X(O,function(){$.apply(this,arguments)},F)},count:function(O){var $=0;return X(O,function(){$++}),$},toArray:function(O){return X(O,function($){return $})||[]},only:function(O){if(!z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return He.Activity=d,He.Children=M,He.Component=S,He.Fragment=n,He.Profiler=a,He.PureComponent=y,He.StrictMode=r,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},He.cache=function(O){return function(){return O.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(O,$,F){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Q=C({},O.props),re=O.key;if($!=null)for(ae in $.key!==void 0&&(re=""+$.key),$)!T.call($,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&$.ref===void 0||(Q[ae]=$[ae]);var ae=arguments.length-2;if(ae===1)Q.children=F;else if(1<ae){for(var Z=Array(ae),P=0;P<ae;P++)Z[P]=arguments[P+2];Q.children=Z}return j(O.type,re,Q)},He.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},He.createElement=function(O,$,F){var Q,re={},ae=null;if($!=null)for(Q in $.key!==void 0&&(ae=""+$.key),$)T.call($,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=$[Q]);var Z=arguments.length-2;if(Z===1)re.children=F;else if(1<Z){for(var P=Array(Z),ee=0;ee<Z;ee++)P[ee]=arguments[ee+2];re.children=P}if(O&&O.defaultProps)for(Q in Z=O.defaultProps,Z)re[Q]===void 0&&(re[Q]=Z[Q]);return j(O,ae,re)},He.createRef=function(){return{current:null}},He.forwardRef=function(O){return{$$typeof:o,render:O}},He.isValidElement=z,He.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:K}},He.memo=function(O,$){return{$$typeof:f,type:O,compare:$===void 0?null:$}},He.startTransition=function(O){var $=D.T,F={};D.T=F;try{var Q=O(),re=D.S;re!==null&&re(F,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,L)}catch(ae){L(ae)}finally{$!==null&&F.types!==null&&($.types=F.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(O){return D.H.use(O)},He.useActionState=function(O,$,F){return D.H.useActionState(O,$,F)},He.useCallback=function(O,$){return D.H.useCallback(O,$)},He.useContext=function(O){return D.H.useContext(O)},He.useDebugValue=function(){},He.useDeferredValue=function(O,$){return D.H.useDeferredValue(O,$)},He.useEffect=function(O,$){return D.H.useEffect(O,$)},He.useEffectEvent=function(O){return D.H.useEffectEvent(O)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(O,$,F){return D.H.useImperativeHandle(O,$,F)},He.useInsertionEffect=function(O,$){return D.H.useInsertionEffect(O,$)},He.useLayoutEffect=function(O,$){return D.H.useLayoutEffect(O,$)},He.useMemo=function(O,$){return D.H.useMemo(O,$)},He.useOptimistic=function(O,$){return D.H.useOptimistic(O,$)},He.useReducer=function(O,$,F){return D.H.useReducer(O,$,F)},He.useRef=function(O){return D.H.useRef(O)},He.useState=function(O){return D.H.useState(O)},He.useSyncExternalStore=function(O,$,F){return D.H.useSyncExternalStore(O,$,F)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.7",He}var Ny;function al(){return Ny||(Ny=1,zd.exports=lA()),zd.exports}var V=al();const cA=Pu(V);var Hd={exports:{}},wo={},Fd={exports:{}},Pd={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ty;function uA(){return Ty||(Ty=1,(function(e){function t(q,X){var K=q.length;q.push(X);e:for(;0<K;){var L=K-1>>>1,M=q[L];if(0<a(M,X))q[L]=X,q[K]=M,K=L;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var X=q[0],K=q.pop();if(K!==X){q[0]=K;e:for(var L=0,M=q.length,O=M>>>1;L<O;){var $=2*(L+1)-1,F=q[$],Q=$+1,re=q[Q];if(0>a(F,K))Q<M&&0>a(re,F)?(q[L]=re,q[Q]=K,L=Q):(q[L]=F,q[$]=K,L=$);else if(Q<M&&0>a(re,K))q[L]=re,q[Q]=K,L=Q;else break e}}return X}function a(q,X){var K=q.sortIndex-X.sortIndex;return K!==0?K:q.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,_=3,v=!1,w=!1,C=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=q)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function R(q){if(C=!1,E(q),!w)if(n(c)!==null)w=!0,N||(N=!0,G());else{var X=n(f);X!==null&&Y(R,X.startTime-q)}}var N=!1,D=-1,T=5,j=-1;function B(){return b?!0:!(e.unstable_now()-j<T)}function z(){if(b=!1,N){var q=e.unstable_now();j=q;var X=!0;try{e:{w=!1,C&&(C=!1,x(D),D=-1),v=!0;var K=_;try{t:{for(E(q),d=n(c);d!==null&&!(d.expirationTime>q&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,_=d.priorityLevel;var M=L(d.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){d.callback=M,E(q),X=!0;break t}d===n(c)&&r(c),E(q)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&Y(R,O.startTime-q),X=!1}}break e}finally{d=null,_=K,v=!1}X=void 0}}finally{X?G():N=!1}}}var G;if(typeof y=="function")G=function(){y(z)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=z,G=function(){H.postMessage(null)}}else G=function(){S(z,0)};function Y(q,X){D=S(function(){q(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(q){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var K=_;_=X;try{return q()}finally{_=K}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var K=_;_=q;try{return X()}finally{_=K}},e.unstable_scheduleCallback=function(q,X,K){var L=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?L+K:L):K=L,q){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=K+M,q={id:p++,callback:X,priorityLevel:q,startTime:K,expirationTime:M,sortIndex:-1},K>L?(q.sortIndex=K,t(f,q),n(c)===null&&q===n(f)&&(C?(x(D),D=-1):C=!0,Y(R,K-L))):(q.sortIndex=M,t(c,q),w||v||(w=!0,N||(N=!0,G()))),q},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(q){var X=_;return function(){var K=_;_=X;try{return q.apply(this,arguments)}finally{_=K}}}})(Pd)),Pd}var Ry;function hA(){return Ry||(Ry=1,Fd.exports=uA()),Fd.exports}var Ud={exports:{}},Jt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Dy;function fA(){if(Dy)return Jt;Dy=1;var e=al();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(c,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jt.createPortal=function(c,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(c,f,null,p)},Jt.flushSync=function(c){var f=u.T,p=r.p;try{if(u.T=null,r.p=2,c)return c()}finally{u.T=f,r.p=p,r.d.f()}},Jt.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Jt.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Jt.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:_,fetchPriority:v}):p==="script"&&r.d.X(c,{crossOrigin:d,integrity:_,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Jt.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=o(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Jt.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=o(p,f.crossOrigin);r.d.L(c,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Jt.preloadModule=function(c,f){if(typeof c=="string")if(f){var p=o(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Jt.requestFormReset=function(c){r.d.r(c)},Jt.unstable_batchedUpdates=function(c,f){return c(f)},Jt.useFormState=function(c,f,p){return u.H.useFormState(c,f,p)},Jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Jt.version="19.2.7",Jt}var My;function zS(){if(My)return Ud.exports;My=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ud.exports=fA(),Ud.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var jy;function dA(){if(jy)return wo;jy=1;var e=hA(),t=al(),n=zS();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)s+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,h=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(h=s.return),i=s.return;while(i)}return s.tag===3?h:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function o(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(l(i)!==i)throw Error(r(188))}function f(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var h=i,g=s;;){var k=h.return;if(k===null)break;var A=k.alternate;if(A===null){if(g=k.return,g!==null){h=g;continue}break}if(k.child===A.child){for(A=k.child;A;){if(A===h)return c(k),i;if(A===g)return c(k),s;A=A.sibling}throw Error(r(188))}if(h.return!==g.return)h=k,g=A;else{for(var I=!1,W=k.child;W;){if(W===h){I=!0,h=k,g=A;break}if(W===g){I=!0,g=k,h=A;break}W=W.sibling}if(!I){for(W=A.child;W;){if(W===h){I=!0,h=A,g=k;break}if(W===g){I=!0,g=A,h=k;break}W=W.sibling}if(!I)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var d=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=z&&i[z]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case R:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case y:return i.displayName||"Context";case x:return(i._context.displayName||"Context")+".Consumer";case E:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return s=i.displayName||null,s!==null?s:H(i.type)||"Memo";case T:s=i._payload,i=i._init;try{return H(i(s))}catch{}}return null}var Y=Array.isArray,q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},L=[],M=-1;function O(i){return{current:i}}function $(i){0>M||(i.current=L[M],L[M]=null,M--)}function F(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),ae=O(null),Z=O(null);function P(i,s){switch(F(ae,s),F(re,i),F(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Wv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Wv(s),i=Xv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(Q),F(Q,i)}function ee(){$(Q),$(re),$(ae)}function ne(i){i.memoizedState!==null&&F(Z,i);var s=Q.current,h=Xv(s,i.type);s!==h&&(F(re,i),F(Q,h))}function ge(i){re.current===i&&($(Q),$(re)),Z.current===i&&($(Z),vo._currentValue=K)}var he,ye;function be(i){if(he===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);he=s&&s[1]||"",ye=-1<h.stack.indexOf(` - at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return` -`+he+i+ye}var ke=!1;function Ee(i,s){if(!i||ke)return"";ke=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(s){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(pe){var ue=pe}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(pe){ue=pe}i.call(ve.prototype)}}else{try{throw Error()}catch(pe){ue=pe}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(pe){if(pe&&ue&&typeof pe.stack=="string")return[pe.stack,ue.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var k=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");k&&k.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=g.DetermineComponentFrameRoot(),I=A[0],W=A[1];if(I&&W){var J=I.split(` -`),ce=W.split(` -`);for(k=g=0;g<J.length&&!J[g].includes("DetermineComponentFrameRoot");)g++;for(;k<ce.length&&!ce[k].includes("DetermineComponentFrameRoot");)k++;if(g===J.length||k===ce.length)for(g=J.length-1,k=ce.length-1;1<=g&&0<=k&&J[g]!==ce[k];)k--;for(;1<=g&&0<=k;g--,k--)if(J[g]!==ce[k]){if(g!==1||k!==1)do if(g--,k--,0>k||J[g]!==ce[k]){var me=` -`+J[g].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=g&&0<=k);break}}}finally{ke=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?be(h):""}function Ce(i,s){switch(i.tag){case 26:case 27:case 5:return be(i.type);case 16:return be("Lazy");case 13:return i.child!==s&&s!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ee(i.type,!1);case 11:return Ee(i.type.render,!1);case 1:return Ee(i.type,!0);case 31:return be("Activity");default:return""}}function rt(i){try{var s="",h=null;do s+=Ce(i,h),h=i,i=i.return;while(i);return s}catch(g){return` -Error generating stack: `+g.message+` -`+g.stack}}var bt=Object.prototype.hasOwnProperty,Ge=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,Pt=e.unstable_shouldYield,ht=e.unstable_requestPaint,Fe=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Ae=e.unstable_LowPriority,De=e.unstable_IdlePriority,Ve=e.log,Ie=e.unstable_setDisableYieldValue,Nt=null,Ct=null;function qt(i){if(typeof Ve=="function"&&Ie(i),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Nt,i)}catch{}}var st=Math.clz32?Math.clz32:ps,Ln=Math.log,Ut=Math.LN2;function ps(i){return i>>>=0,i===0?32:31-(Ln(i)/Ut|0)|0}var gi=256,mi=262144,_i=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function vi(i,s,h){var g=i.pendingLanes;if(g===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var W=g&134217727;return W!==0?(g=W&~A,g!==0?k=On(g):(I&=W,I!==0?k=On(I):h||(h=W&~i,h!==0&&(k=On(h))))):(W=g&~A,W!==0?k=On(W):I!==0?k=On(I):h||(h=g&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ni(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function oe(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function we(){var i=_i;return _i<<=1,(_i&62914560)===0&&(_i=4194304),i}function Ne(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function qe(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function at(i,s,h,g,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var W=i.entanglements,J=i.expirationTimes,ce=i.hiddenUpdates;for(h=I&~h;0<h;){var me=31-st(h),ve=1<<me;W[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var pe=ue[me];pe!==null&&(pe.lane&=-536870913)}h&=~ve}g!==0&&yi(i,g,0),A!==0&&k===0&&i.tag!==0&&(i.suspendedLanes|=A&~(I&~s))}function yi(i,s,h){i.pendingLanes|=s,i.suspendedLanes&=~s;var g=31-st(s);i.entangledLanes|=s,i.entanglements[g]=i.entanglements[g]|1073741824|h&261930}function nn(i,s){var h=i.entangledLanes|=s;for(i=i.entanglements;h;){var g=31-st(h),k=1<<g;k&s|i[g]&s&&(i[g]|=s),h&=~k}}function gs(i,s){var h=s&-s;return h=(h&42)!==0?1:ka(h),(h&(i.suspendedLanes|s))!==0?0:h}function ka(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Aa(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function yl(){var i=X.p;return i!==0?i:(i=window.event,i===void 0?32:vy(i.type))}function bl(i,s){var h=X.p;try{return X.p=i,s()}finally{X.p=h}}var ii=Math.random().toString(36).slice(2),$t="__reactFiber$"+ii,Qt="__reactProps$"+ii,bi="__reactContainer$"+ii,ms="__reactEvents$"+ii,Sl="__reactListeners$"+ii,Nh="__reactHandles$"+ii,xl="__reactResources$"+ii,Rr="__reactMarker$"+ii;function Na(i){delete i[$t],delete i[Qt],delete i[ms],delete i[Sl],delete i[Nh]}function Yi(i){var s=i[$t];if(s)return s;for(var h=i.parentNode;h;){if(s=h[bi]||h[$t]){if(h=s.alternate,s.child!==null||h!==null&&h.child!==null)for(i=ny(i);i!==null;){if(h=i[$t])return h;i=ny(i)}return s}i=h,h=i.parentNode}return null}function Wi(i){if(i=i[$t]||i[bi]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Xi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ki(i){var s=i[xl];return s||(s=i[xl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[Rr]=!0}var wl=new Set,Cl={};function Si(i,s){Zi(i,s),Zi(i+"Capture",s)}function Zi(i,s){for(Cl[i]=s,i=0;i<s.length;i++)wl.add(s[i])}var Th=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),El={},Ta={};function Rh(i){return bt.call(Ta,i)?!0:bt.call(El,i)?!1:Th.test(i)?Ta[i]=!0:(El[i]=!0,!1)}function _s(i,s,h){if(Rh(s))if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var g=s.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+h)}}function vs(i,s,h){if(h===null)i.removeAttribute(s);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+h)}}function qn(i,s,h,g){if(g===null)i.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(h);return}i.setAttributeNS(s,h,""+g)}}function an(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function kl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Dh(i,s,h){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var k=g.get,A=g.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return k.call(this)},set:function(I){h=""+I,A.call(this,I)}}),Object.defineProperty(i,s,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(I){h=""+I},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ra(i){if(!i._valueTracker){var s=kl(i)?"checked":"value";i._valueTracker=Dh(i,s,""+i[s])}}function Dr(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var h=s.getValue(),g="";return i&&(g=kl(i)?i.checked?"true":"false":i.value),i=g,i!==h?(s.setValue(i),!0):!1}function ys(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Al=/[\n"\\]/g;function on(i){return i.replace(Al,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Da(i,s,h,g,k,A,I,W){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?Ma(i,I,an(s)):h!=null?Ma(i,I,an(h)):g!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+an(W):i.removeAttribute("name")}function bs(i,s,h,g,k,A,I,W){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Ra(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,W||s===i.value||(i.value=s),i.defaultValue=s}g=g??k,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=W?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ra(i)}function Ma(i,s,h){s==="number"&&ys(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function Qi(i,s,h,g){if(i=i.options,s){s={};for(var k=0;k<h.length;k++)s["$"+h[k]]=!0;for(h=0;h<i.length;h++)k=s.hasOwnProperty("$"+i[h].value),i[h].selected!==k&&(i[h].selected=k),k&&g&&(i[h].defaultSelected=!0)}else{for(h=""+an(h),s=null,k=0;k<i.length;k++){if(i[k].value===h){i[k].selected=!0,g&&(i[k].defaultSelected=!0);return}s!==null||i[k].disabled||(s=i[k])}s!==null&&(s.selected=!0)}}function ja(i,s,h){if(s!=null&&(s=""+an(s),s!==i.value&&(i.value=s),h==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=h!=null?""+an(h):""}function Gm(i,s,h,g){if(s==null){if(g!=null){if(h!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),s=h}h=an(s),i.defaultValue=h,g=i.textContent,g===h&&g!==""&&g!==null&&(i.value=g),Ra(i)}function Ss(i,s){if(s){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=s;return}}i.textContent=s}var tE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qm(i,s,h){var g=s.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":g?i.setProperty(s,h):typeof h!="number"||h===0||tE.has(s)?s==="float"?i.cssFloat=h:i[s]=(""+h).trim():i[s]=h+"px"}function Vm(i,s,h){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||s!=null&&s.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var k in s)g=s[k],s.hasOwnProperty(k)&&h[k]!==g&&qm(i,k,g)}else for(var A in s)s.hasOwnProperty(A)&&qm(i,A,s[A])}function Mh(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),iE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(i){return iE.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function xi(){}var jh=null;function Lh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xs=null,ws=null;function Ym(i){var s=Wi(i);if(s&&(i=s.stateNode)){var h=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Da(i,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),s=h.name,h.type==="radio"&&s!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+on(""+s)+'"][type="radio"]'),s=0;s<h.length;s++){var g=h[s];if(g!==i&&g.form===i.form){var k=g[Qt]||null;if(!k)throw Error(r(90));Da(g,k.value,k.defaultValue,k.defaultValue,k.checked,k.defaultChecked,k.type,k.name)}}for(s=0;s<h.length;s++)g=h[s],g.form===i.form&&Dr(g)}break e;case"textarea":ja(i,h.value,h.defaultValue);break e;case"select":s=h.value,s!=null&&Qi(i,!!h.multiple,s,!1)}}}var Oh=!1;function Wm(i,s,h){if(Oh)return i(s,h);Oh=!0;try{var g=i(s);return g}finally{if(Oh=!1,(xs!==null||ws!==null)&&(gc(),xs&&(s=xs,i=ws,ws=xs=null,Ym(s),i)))for(s=0;s<i.length;s++)Ym(i[s])}}function La(i,s){var h=i.stateNode;if(h===null)return null;var g=h[Qt]||null;if(g===null)return null;h=g[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(r(231,s,typeof h));return h}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bh=!1;if(wi)try{var Oa={};Object.defineProperty(Oa,"passive",{get:function(){Bh=!0}}),window.addEventListener("test",Oa,Oa),window.removeEventListener("test",Oa,Oa)}catch{Bh=!1}var Ji=null,Ih=null,Tl=null;function Xm(){if(Tl)return Tl;var i,s=Ih,h=s.length,g,k="value"in Ji?Ji.value:Ji.textContent,A=k.length;for(i=0;i<h&&s[i]===k[i];i++);var I=h-i;for(g=1;g<=I&&s[h-g]===k[A-g];g++);return Tl=k.slice(i,1<g?1-g:void 0)}function Rl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Dl(){return!0}function Km(){return!1}function ln(i){function s(h,g,k,A,I){this._reactName=h,this._targetInst=k,this.type=g,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(h=i[W],this[W]=h?h(A):A[W]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Dl:Km,this.isPropagationStopped=Km,this}return d(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Dl)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Dl)},persist:function(){},isPersistent:Dl}),s}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=ln(Mr),Ba=d({},Mr,{view:0,detail:0}),rE=ln(Ba),zh,Hh,Ia,jl=d({},Ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ia&&(Ia&&i.type==="mousemove"?(zh=i.screenX-Ia.screenX,Hh=i.screenY-Ia.screenY):Hh=zh=0,Ia=i),zh)},movementY:function(i){return"movementY"in i?i.movementY:Hh}}),Zm=ln(jl),sE=d({},jl,{dataTransfer:0}),aE=ln(sE),oE=d({},Ba,{relatedTarget:0}),Fh=ln(oE),lE=d({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),cE=ln(lE),uE=d({},Mr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),hE=ln(uE),fE=d({},Mr,{data:0}),Qm=ln(fE),dE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mE(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=gE[i])?!!s[i]:!1}function Ph(){return mE}var _E=d({},Ba,{key:function(i){if(i.key){var s=dE[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Rl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?pE[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(i){return i.type==="keypress"?Rl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Rl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),vE=ln(_E),yE=d({},jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jm=ln(yE),bE=d({},Ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),SE=ln(bE),xE=d({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),wE=ln(xE),CE=d({},jl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),EE=ln(CE),kE=d({},Mr,{newState:0,oldState:0}),AE=ln(kE),NE=[9,13,27,32],Uh=wi&&"CompositionEvent"in window,za=null;wi&&"documentMode"in document&&(za=document.documentMode);var TE=wi&&"TextEvent"in window&&!za,e0=wi&&(!Uh||za&&8<za&&11>=za),t0=" ",n0=!1;function i0(i,s){switch(i){case"keyup":return NE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Cs=!1;function RE(i,s){switch(i){case"compositionend":return r0(s);case"keypress":return s.which!==32?null:(n0=!0,t0);case"textInput":return i=s.data,i===t0&&n0?null:i;default:return null}}function DE(i,s){if(Cs)return i==="compositionend"||!Uh&&i0(i,s)?(i=Xm(),Tl=Ih=Ji=null,Cs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return e0&&s.locale!=="ko"?null:s.data;default:return null}}var ME={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s0(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!ME[i.type]:s==="textarea"}function a0(i,s,h,g){xs?ws?ws.push(g):ws=[g]:xs=g,s=xc(s,"onChange"),0<s.length&&(h=new Ml("onChange","change",null,h,g),i.push({event:h,listeners:s}))}var Ha=null,Fa=null;function jE(i){Uv(i,0)}function Ll(i){var s=Xi(i);if(Dr(s))return i}function o0(i,s){if(i==="change")return s}var l0=!1;if(wi){var $h;if(wi){var Gh="oninput"in document;if(!Gh){var c0=document.createElement("div");c0.setAttribute("oninput","return;"),Gh=typeof c0.oninput=="function"}$h=Gh}else $h=!1;l0=$h&&(!document.documentMode||9<document.documentMode)}function u0(){Ha&&(Ha.detachEvent("onpropertychange",h0),Fa=Ha=null)}function h0(i){if(i.propertyName==="value"&&Ll(Fa)){var s=[];a0(s,Fa,i,Lh(i)),Wm(jE,s)}}function LE(i,s,h){i==="focusin"?(u0(),Ha=s,Fa=h,Ha.attachEvent("onpropertychange",h0)):i==="focusout"&&u0()}function OE(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ll(Fa)}function BE(i,s){if(i==="click")return Ll(s)}function IE(i,s){if(i==="input"||i==="change")return Ll(s)}function zE(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var yn=typeof Object.is=="function"?Object.is:zE;function Pa(i,s){if(yn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var h=Object.keys(i),g=Object.keys(s);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var k=h[g];if(!bt.call(s,k)||!yn(i[k],s[k]))return!1}return!0}function f0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function d0(i,s){var h=f0(i);i=0;for(var g;h;){if(h.nodeType===3){if(g=i+h.textContent.length,i<=s&&g>=s)return{node:h,offset:s-i};i=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=f0(h)}}function p0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?p0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function g0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=ys(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=ys(i.document)}return s}function qh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var HE=wi&&"documentMode"in document&&11>=document.documentMode,Es=null,Vh=null,Ua=null,Yh=!1;function m0(i,s,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yh||Es==null||Es!==ys(g)||(g=Es,"selectionStart"in g&&qh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Ua&&Pa(Ua,g)||(Ua=g,g=xc(Vh,"onSelect"),0<g.length&&(s=new Ml("onSelect","select",null,s,h),i.push({event:s,listeners:g}),s.target=Es)))}function jr(i,s){var h={};return h[i.toLowerCase()]=s.toLowerCase(),h["Webkit"+i]="webkit"+s,h["Moz"+i]="moz"+s,h}var ks={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},Wh={},_0={};wi&&(_0=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Lr(i){if(Wh[i])return Wh[i];if(!ks[i])return i;var s=ks[i],h;for(h in s)if(s.hasOwnProperty(h)&&h in _0)return Wh[i]=s[h];return i}var v0=Lr("animationend"),y0=Lr("animationiteration"),b0=Lr("animationstart"),FE=Lr("transitionrun"),PE=Lr("transitionstart"),UE=Lr("transitioncancel"),S0=Lr("transitionend"),x0=new Map,Xh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xh.push("scrollEnd");function Vn(i,s){x0.set(i,s),Si(s,[i])}var Ol=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Bn=[],As=0,Kh=0;function Bl(){for(var i=As,s=Kh=As=0;s<i;){var h=Bn[s];Bn[s++]=null;var g=Bn[s];Bn[s++]=null;var k=Bn[s];Bn[s++]=null;var A=Bn[s];if(Bn[s++]=null,g!==null&&k!==null){var I=g.pending;I===null?k.next=k:(k.next=I.next,I.next=k),g.pending=k}A!==0&&w0(h,k,A)}}function Il(i,s,h,g){Bn[As++]=i,Bn[As++]=s,Bn[As++]=h,Bn[As++]=g,Kh|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function Zh(i,s,h,g){return Il(i,s,h,g),zl(i)}function Or(i,s){return Il(i,null,null,s),zl(i)}function w0(i,s,h){i.lanes|=h;var g=i.alternate;g!==null&&(g.lanes|=h);for(var k=!1,A=i.return;A!==null;)A.childLanes|=h,g=A.alternate,g!==null&&(g.childLanes|=h),A.tag===22&&(i=A.stateNode,i===null||i._visibility&1||(k=!0)),i=A,A=A.return;return i.tag===3?(A=i.stateNode,k&&s!==null&&(k=31-st(h),i=A.hiddenUpdates,g=i[k],g===null?i[k]=[s]:g.push(s),s.lane=h|536870912),A):null}function zl(i){if(50<uo)throw uo=0,od=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ns={};function $E(i,s,h,g){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(i,s,h,g){return new $E(i,s,h,g)}function Qh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ci(i,s){var h=i.alternate;return h===null?(h=bn(i.tag,s,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=s,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&65011712,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,s=i.dependencies,h.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h.refCleanup=i.refCleanup,h}function C0(i,s){i.flags&=65011714;var h=i.alternate;return h===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=h.childLanes,i.lanes=h.lanes,i.child=h.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=h.memoizedProps,i.memoizedState=h.memoizedState,i.updateQueue=h.updateQueue,i.type=h.type,s=h.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Hl(i,s,h,g,k,A){var I=0;if(g=i,typeof i=="function")Qh(i)&&(I=1);else if(typeof i=="string")I=Wk(i,h,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case j:return i=bn(31,h,s,k),i.elementType=j,i.lanes=A,i;case C:return Br(h.children,k,A,s);case b:I=8,k|=24;break;case S:return i=bn(12,h,s,k|2),i.elementType=S,i.lanes=A,i;case R:return i=bn(13,h,s,k),i.elementType=R,i.lanes=A,i;case N:return i=bn(19,h,s,k),i.elementType=N,i.lanes=A,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case y:I=10;break e;case x:I=9;break e;case E:I=11;break e;case D:I=14;break e;case T:I=16,g=null;break e}I=29,h=Error(r(130,i===null?"null":typeof i,"")),g=null}return s=bn(I,h,s,k),s.elementType=i,s.type=g,s.lanes=A,s}function Br(i,s,h,g){return i=bn(7,i,g,s),i.lanes=h,i}function Jh(i,s,h){return i=bn(6,i,null,s),i.lanes=h,i}function E0(i){var s=bn(18,null,null,0);return s.stateNode=i,s}function ef(i,s,h){return s=bn(4,i.children!==null?i.children:[],i.key,s),s.lanes=h,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var k0=new WeakMap;function In(i,s){if(typeof i=="object"&&i!==null){var h=k0.get(i);return h!==void 0?h:(s={value:i,source:s,stack:rt(s)},k0.set(i,s),s)}return{value:i,source:s,stack:rt(s)}}var Ts=[],Rs=0,Fl=null,$a=0,zn=[],Hn=0,er=null,ri=1,si="";function Ei(i,s){Ts[Rs++]=$a,Ts[Rs++]=Fl,Fl=i,$a=s}function A0(i,s,h){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,er=i;var g=ri;i=si;var k=32-st(g)-1;g&=~(1<<k),h+=1;var A=32-st(s)+k;if(30<A){var I=k-k%5;A=(g&(1<<I)-1).toString(32),g>>=I,k-=I,ri=1<<32-st(s)+k|h<<k|g,si=A+i}else ri=1<<A|h<<k|g,si=i}function tf(i){i.return!==null&&(Ei(i,1),A0(i,1,0))}function nf(i){for(;i===Fl;)Fl=Ts[--Rs],Ts[Rs]=null,$a=Ts[--Rs],Ts[Rs]=null;for(;i===er;)er=zn[--Hn],zn[Hn]=null,si=zn[--Hn],zn[Hn]=null,ri=zn[--Hn],zn[Hn]=null}function N0(i,s){zn[Hn++]=ri,zn[Hn++]=si,zn[Hn++]=er,ri=s.id,si=s.overflow,er=i}var Wt=null,St=null,Qe=!1,tr=null,Fn=!1,rf=Error(r(519));function nr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ga(In(s,i)),rf}function T0(i){var s=i.stateNode,h=i.type,g=i.memoizedProps;switch(s[$t]=i,s[Qt]=g,h){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(h=0;h<fo.length;h++)We(fo[h],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),bs(s,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),Gm(s,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||s.textContent===""+h||g.suppressHydrationWarning===!0||Vv(s.textContent,h)?(g.popover!=null&&(We("beforetoggle",s),We("toggle",s)),g.onScroll!=null&&We("scroll",s),g.onScrollEnd!=null&&We("scrollend",s),g.onClick!=null&&(s.onclick=xi),s=!0):s=!1,s||nr(i,!0)}function R0(i){for(Wt=i.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Wt=Wt.return}}function Ds(i){if(i!==Wt)return!1;if(!Qe)return R0(i),Qe=!0,!1;var s=i.tag,h;if((h=s!==3&&s!==27)&&((h=s===5)&&(h=i.type,h=!(h!=="form"&&h!=="button")||xd(i.type,i.memoizedProps)),h=!h),h&&St&&nr(i),R0(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));St=ty(i)}else s===27?(s=St,mr(i.type)?(i=Ad,Ad=null,St=i):St=s):St=Wt?Un(i.stateNode.nextSibling):null;return!0}function Ir(){St=Wt=null,Qe=!1}function sf(){var i=tr;return i!==null&&(fn===null?fn=i:fn.push.apply(fn,i),tr=null),i}function Ga(i){tr===null?tr=[i]:tr.push(i)}var af=O(null),zr=null,ki=null;function ir(i,s,h){F(af,s._currentValue),s._currentValue=h}function Ai(i){i._currentValue=af.current,$(af)}function of(i,s,h){for(;i!==null;){var g=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),i===h)break;i=i.return}}function lf(i,s,h,g){var k=i.child;for(k!==null&&(k.return=i);k!==null;){var A=k.dependencies;if(A!==null){var I=k.child;A=A.firstContext;e:for(;A!==null;){var W=A;A=k;for(var J=0;J<s.length;J++)if(W.context===s[J]){A.lanes|=h,W=A.alternate,W!==null&&(W.lanes|=h),of(A.return,h,i),g||(I=null);break e}A=W.next}}else if(k.tag===18){if(I=k.return,I===null)throw Error(r(341));I.lanes|=h,A=I.alternate,A!==null&&(A.lanes|=h),of(I,h,i),I=null}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===i){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}}function Ms(i,s,h,g){i=null;for(var k=s,A=!1;k!==null;){if(!A){if((k.flags&524288)!==0)A=!0;else if((k.flags&262144)!==0)break}if(k.tag===10){var I=k.alternate;if(I===null)throw Error(r(387));if(I=I.memoizedProps,I!==null){var W=k.type;yn(k.pendingProps.value,I.value)||(i!==null?i.push(W):i=[W])}}else if(k===Z.current){if(I=k.alternate,I===null)throw Error(r(387));I.memoizedState.memoizedState!==k.memoizedState.memoizedState&&(i!==null?i.push(vo):i=[vo])}k=k.return}i!==null&&lf(s,i,h,g),s.flags|=262144}function Pl(i){for(i=i.firstContext;i!==null;){if(!yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Hr(i){zr=i,ki=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Xt(i){return D0(zr,i)}function Ul(i,s){return zr===null&&Hr(i),D0(i,s)}function D0(i,s){var h=s._currentValue;if(s={context:s,memoizedValue:h,next:null},ki===null){if(i===null)throw Error(r(308));ki=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ki=ki.next=s;return h}var GE=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(h,g){i.push(g)}};this.abort=function(){s.aborted=!0,i.forEach(function(h){return h()})}},qE=e.unstable_scheduleCallback,VE=e.unstable_NormalPriority,Ot={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cf(){return{controller:new GE,data:new Map,refCount:0}}function qa(i){i.refCount--,i.refCount===0&&qE(VE,function(){i.controller.abort()})}var Va=null,uf=0,js=0,Ls=null;function YE(i,s){if(Va===null){var h=Va=[];uf=0,js=dd(),Ls={status:"pending",value:void 0,then:function(g){h.push(g)}}}return uf++,s.then(M0,M0),s}function M0(){if(--uf===0&&Va!==null){Ls!==null&&(Ls.status="fulfilled");var i=Va;Va=null,js=0,Ls=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function WE(i,s){var h=[],g={status:"pending",value:null,reason:null,then:function(k){h.push(k)}};return i.then(function(){g.status="fulfilled",g.value=s;for(var k=0;k<h.length;k++)(0,h[k])(s)},function(k){for(g.status="rejected",g.reason=k,k=0;k<h.length;k++)(0,h[k])(void 0)}),g}var j0=q.S;q.S=function(i,s){mv=Fe(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&YE(i,s),j0!==null&&j0(i,s)};var Fr=O(null);function hf(){var i=Fr.current;return i!==null?i:_t.pooledCache}function $l(i,s){s===null?F(Fr,Fr.current):F(Fr,s.pool)}function L0(){var i=hf();return i===null?null:{parent:Ot._currentValue,pool:i}}var Os=Error(r(460)),ff=Error(r(474)),Gl=Error(r(542)),ql={then:function(){}};function O0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function B0(i,s,h){switch(h=i[h],h===void 0?i.push(s):h!==s&&(s.then(xi,xi),s=h),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i;default:if(typeof s.status=="string")s.then(xi,xi);else{if(i=_t,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var k=s;k.status="fulfilled",k.value=g}},function(g){if(s.status==="pending"){var k=s;k.status="rejected",k.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,z0(i),i}throw Ur=s,Os}}function Pr(i){try{var s=i._init;return s(i._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Ur=h,Os):h}}var Ur=null;function I0(){if(Ur===null)throw Error(r(459));var i=Ur;return Ur=null,i}function z0(i){if(i===Os||i===Gl)throw Error(r(483))}var Bs=null,Ya=0;function Vl(i){var s=Ya;return Ya+=1,Bs===null&&(Bs=[]),B0(Bs,i,s)}function Wa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Yl(i,s){throw s.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function H0(i){function s(se,te){if(i){var le=se.deletions;le===null?(se.deletions=[te],se.flags|=16):le.push(te)}}function h(se,te){if(!i)return null;for(;te!==null;)s(se,te),te=te.sibling;return null}function g(se){for(var te=new Map;se!==null;)se.key!==null?te.set(se.key,se):te.set(se.index,se),se=se.sibling;return te}function k(se,te){return se=Ci(se,te),se.index=0,se.sibling=null,se}function A(se,te,le){return se.index=le,i?(le=se.alternate,le!==null?(le=le.index,le<te?(se.flags|=67108866,te):le):(se.flags|=67108866,te)):(se.flags|=1048576,te)}function I(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function W(se,te,le,_e){return te===null||te.tag!==6?(te=Jh(le,se.mode,_e),te.return=se,te):(te=k(te,le),te.return=se,te)}function J(se,te,le,_e){var Le=le.type;return Le===C?me(se,te,le.props.children,_e,le.key):te!==null&&(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type)?(te=k(te,le.props),Wa(te,le),te.return=se,te):(te=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(te,le),te.return=se,te)}function ce(se,te,le,_e){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=ef(le,se.mode,_e),te.return=se,te):(te=k(te,le.children||[]),te.return=se,te)}function me(se,te,le,_e,Le){return te===null||te.tag!==7?(te=Br(le,se.mode,_e,Le),te.return=se,te):(te=k(te,le),te.return=se,te)}function ve(se,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Jh(""+te,se.mode,le),te.return=se,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return le=Hl(te.type,te.key,te.props,null,se.mode,le),Wa(le,te),le.return=se,le;case w:return te=ef(te,se.mode,le),te.return=se,te;case T:return te=Pr(te),ve(se,te,le)}if(Y(te)||G(te))return te=Br(te,se.mode,le,null),te.return=se,te;if(typeof te.then=="function")return ve(se,Vl(te),le);if(te.$$typeof===y)return ve(se,Ul(se,te),le);Yl(se,te)}return null}function ue(se,te,le,_e){var Le=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Le!==null?null:W(se,te,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case v:return le.key===Le?J(se,te,le,_e):null;case w:return le.key===Le?ce(se,te,le,_e):null;case T:return le=Pr(le),ue(se,te,le,_e)}if(Y(le)||G(le))return Le!==null?null:me(se,te,le,_e,null);if(typeof le.then=="function")return ue(se,te,Vl(le),_e);if(le.$$typeof===y)return ue(se,te,Ul(se,le),_e);Yl(se,le)}return null}function pe(se,te,le,_e,Le){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return se=se.get(le)||null,W(te,se,""+_e,Le);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case v:return se=se.get(_e.key===null?le:_e.key)||null,J(te,se,_e,Le);case w:return se=se.get(_e.key===null?le:_e.key)||null,ce(te,se,_e,Le);case T:return _e=Pr(_e),pe(se,te,le,_e,Le)}if(Y(_e)||G(_e))return se=se.get(le)||null,me(te,se,_e,Le,null);if(typeof _e.then=="function")return pe(se,te,le,Vl(_e),Le);if(_e.$$typeof===y)return pe(se,te,le,Ul(te,_e),Le);Yl(te,_e)}return null}function Te(se,te,le,_e){for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null;Re!==null&&Ue<le.length;Ue++){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var it=ue(se,Re,le[Ue],_e);if(it===null){Re===null&&(Re=Ze);break}i&&Re&&it.alternate===null&&s(se,Re),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it,Re=Ze}if(Ue===le.length)return h(se,Re),Qe&&Ei(se,Ue),Le;if(Re===null){for(;Ue<le.length;Ue++)Re=ve(se,le[Ue],_e),Re!==null&&(te=A(Re,te,Ue),nt===null?Le=Re:nt.sibling=Re,nt=Re);return Qe&&Ei(se,Ue),Le}for(Re=g(Re);Ue<le.length;Ue++)Ze=pe(Re,se,Ue,le[Ue],_e),Ze!==null&&(i&&Ze.alternate!==null&&Re.delete(Ze.key===null?Ue:Ze.key),te=A(Ze,te,Ue),nt===null?Le=Ze:nt.sibling=Ze,nt=Ze);return i&&Re.forEach(function(Sr){return s(se,Sr)}),Qe&&Ei(se,Ue),Le}function Be(se,te,le,_e){if(le==null)throw Error(r(151));for(var Le=null,nt=null,Re=te,Ue=te=0,Ze=null,it=le.next();Re!==null&&!it.done;Ue++,it=le.next()){Re.index>Ue?(Ze=Re,Re=null):Ze=Re.sibling;var Sr=ue(se,Re,it.value,_e);if(Sr===null){Re===null&&(Re=Ze);break}i&&Re&&Sr.alternate===null&&s(se,Re),te=A(Sr,te,Ue),nt===null?Le=Sr:nt.sibling=Sr,nt=Sr,Re=Ze}if(it.done)return h(se,Re),Qe&&Ei(se,Ue),Le;if(Re===null){for(;!it.done;Ue++,it=le.next())it=ve(se,it.value,_e),it!==null&&(te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return Qe&&Ei(se,Ue),Le}for(Re=g(Re);!it.done;Ue++,it=le.next())it=pe(Re,se,Ue,it.value,_e),it!==null&&(i&&it.alternate!==null&&Re.delete(it.key===null?Ue:it.key),te=A(it,te,Ue),nt===null?Le=it:nt.sibling=it,nt=it);return i&&Re.forEach(function(sA){return s(se,sA)}),Qe&&Ei(se,Ue),Le}function mt(se,te,le,_e){if(typeof le=="object"&&le!==null&&le.type===C&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case v:e:{for(var Le=le.key;te!==null;){if(te.key===Le){if(Le=le.type,Le===C){if(te.tag===7){h(se,te.sibling),_e=k(te,le.props.children),_e.return=se,se=_e;break e}}else if(te.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&Pr(Le)===te.type){h(se,te.sibling),_e=k(te,le.props),Wa(_e,le),_e.return=se,se=_e;break e}h(se,te);break}else s(se,te);te=te.sibling}le.type===C?(_e=Br(le.props.children,se.mode,_e,le.key),_e.return=se,se=_e):(_e=Hl(le.type,le.key,le.props,null,se.mode,_e),Wa(_e,le),_e.return=se,se=_e)}return I(se);case w:e:{for(Le=le.key;te!==null;){if(te.key===Le)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){h(se,te.sibling),_e=k(te,le.children||[]),_e.return=se,se=_e;break e}else{h(se,te);break}else s(se,te);te=te.sibling}_e=ef(le,se.mode,_e),_e.return=se,se=_e}return I(se);case T:return le=Pr(le),mt(se,te,le,_e)}if(Y(le))return Te(se,te,le,_e);if(G(le)){if(Le=G(le),typeof Le!="function")throw Error(r(150));return le=Le.call(le),Be(se,te,le,_e)}if(typeof le.then=="function")return mt(se,te,Vl(le),_e);if(le.$$typeof===y)return mt(se,te,Ul(se,le),_e);Yl(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(h(se,te.sibling),_e=k(te,le),_e.return=se,se=_e):(h(se,te),_e=Jh(le,se.mode,_e),_e.return=se,se=_e),I(se)):h(se,te)}return function(se,te,le,_e){try{Ya=0;var Le=mt(se,te,le,_e);return Bs=null,Le}catch(Re){if(Re===Os||Re===Gl)throw Re;var nt=bn(29,Re,null,se.mode);return nt.lanes=_e,nt.return=se,nt}finally{}}}var $r=H0(!0),F0=H0(!1),rr=!1;function df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function sr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ar(i,s,h){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(ot&2)!==0){var k=g.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),g.pending=s,s=zl(i),w0(i,null,h),s}return Il(i,g,s,h),zl(i)}function Xa(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}function gf(i,s){var h=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:g.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:g.shared,callbacks:g.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var mf=!1;function Ka(){if(mf){var i=Ls;if(i!==null)throw i}}function Za(i,s,h,g){mf=!1;var k=i.updateQueue;rr=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,W=k.shared.pending;if(W!==null){k.shared.pending=null;var J=W,ce=J.next;J.next=null,I===null?A=ce:I.next=ce,I=J;var me=i.alternate;me!==null&&(me=me.updateQueue,W=me.lastBaseUpdate,W!==I&&(W===null?me.firstBaseUpdate=ce:W.next=ce,me.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,me=ce=J=null,W=A;do{var ue=W.lane&-536870913,pe=ue!==W.lane;if(pe?(Ke&ue)===ue:(g&ue)===ue){ue!==0&&ue===js&&(mf=!0),me!==null&&(me=me.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Te=i,Be=W;ue=s;var mt=h;switch(Be.tag){case 1:if(Te=Be.payload,typeof Te=="function"){ve=Te.call(mt,ve,ue);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Be.payload,ue=typeof Te=="function"?Te.call(mt,ve,ue):Te,ue==null)break e;ve=d({},ve,ue);break e;case 2:rr=!0}}ue=W.callback,ue!==null&&(i.flags|=64,pe&&(i.flags|=8192),pe=k.callbacks,pe===null?k.callbacks=[ue]:pe.push(ue))}else pe={lane:ue,tag:W.tag,payload:W.payload,callback:W.callback,next:null},me===null?(ce=me=pe,J=ve):me=me.next=pe,I|=ue;if(W=W.next,W===null){if(W=k.shared.pending,W===null)break;pe=W,W=pe.next,pe.next=null,k.lastBaseUpdate=pe,k.shared.pending=null}}while(!0);me===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=ce,k.lastBaseUpdate=me,A===null&&(k.shared.lanes=0),hr|=I,i.lanes=I,i.memoizedState=ve}}function P0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function U0(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;i<h.length;i++)P0(h[i],s)}var Is=O(null),Wl=O(0);function $0(i,s){i=Bi,F(Wl,i),F(Is,s),Bi=i|s.baseLanes}function _f(){F(Wl,Bi),F(Is,Is.current)}function vf(){Bi=Wl.current,$(Is),$(Wl)}var Sn=O(null),Pn=null;function or(i){var s=i.alternate;F(Mt,Mt.current&1),F(Sn,i),Pn===null&&(s===null||Is.current!==null||s.memoizedState!==null)&&(Pn=i)}function yf(i){F(Mt,Mt.current),F(Sn,i),Pn===null&&(Pn=i)}function G0(i){i.tag===22?(F(Mt,Mt.current),F(Sn,i),Pn===null&&(Pn=i)):lr()}function lr(){F(Mt,Mt.current),F(Sn,Sn.current)}function xn(i){$(Sn),Pn===i&&(Pn=null),$(Mt)}var Mt=O(0);function Xl(i){for(var s=i;s!==null;){if(s.tag===13){var h=s.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ed(h)||kd(h)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ni=0,Pe=null,pt=null,Bt=null,Kl=!1,zs=!1,Gr=!1,Zl=0,Qa=0,Hs=null,XE=0;function Tt(){throw Error(r(321))}function bf(i,s){if(s===null)return!1;for(var h=0;h<s.length&&h<i.length;h++)if(!yn(i[h],s[h]))return!1;return!0}function Sf(i,s,h,g,k,A){return Ni=A,Pe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,q.H=i===null||i.memoizedState===null?A_:Bf,Gr=!1,A=h(g,k),Gr=!1,zs&&(A=V0(s,h,g,k)),q0(i),A}function q0(i){q.H=to;var s=pt!==null&&pt.next!==null;if(Ni=0,Bt=pt=Pe=null,Kl=!1,Qa=0,Hs=null,s)throw Error(r(300));i===null||It||(i=i.dependencies,i!==null&&Pl(i)&&(It=!0))}function V0(i,s,h,g){Pe=i;var k=0;do{if(zs&&(Hs=null),Qa=0,zs=!1,25<=k)throw Error(r(301));if(k+=1,Bt=pt=null,i.updateQueue!=null){var A=i.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}q.H=N_,A=s(h,g)}while(zs);return A}function KE(){var i=q.H,s=i.useState()[0];return s=typeof s.then=="function"?Ja(s):s,i=i.useState()[0],(pt!==null?pt.memoizedState:null)!==i&&(Pe.flags|=1024),s}function xf(){var i=Zl!==0;return Zl=0,i}function wf(i,s,h){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~h}function Cf(i){if(Kl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Kl=!1}Ni=0,Bt=pt=Pe=null,zs=!1,Qa=Zl=0,Hs=null}function rn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i,Bt}function jt(){if(pt===null){var i=Pe.alternate;i=i!==null?i.memoizedState:null}else i=pt.next;var s=Bt===null?Pe.memoizedState:Bt.next;if(s!==null)Bt=s,pt=i;else{if(i===null)throw Pe.alternate===null?Error(r(467)):Error(r(310));pt=i,i={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},Bt===null?Pe.memoizedState=Bt=i:Bt=Bt.next=i}return Bt}function Ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(i){var s=Qa;return Qa+=1,Hs===null&&(Hs=[]),i=B0(Hs,i,s),s=Pe,(Bt===null?s.memoizedState:Bt.next)===null&&(s=s.alternate,q.H=s===null||s.memoizedState===null?A_:Bf),i}function Jl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ja(i);if(i.$$typeof===y)return Xt(i)}throw Error(r(438,String(i)))}function Ef(i){var s=null,h=Pe.updateQueue;if(h!==null&&(s=h.memoCache),s==null){var g=Pe.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(s={data:g.data.map(function(k){return k.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),h===null&&(h=Ql(),Pe.updateQueue=h),h.memoCache=s,h=s.data[s.index],h===void 0)for(h=s.data[s.index]=Array(i),g=0;g<i;g++)h[g]=B;return s.index++,h}function Ti(i,s){return typeof s=="function"?s(i):s}function ec(i){var s=jt();return kf(s,pt,i)}function kf(i,s,h){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var k=i.baseQueue,A=g.pending;if(A!==null){if(k!==null){var I=k.next;k.next=A.next,A.next=I}s.baseQueue=k=A,g.pending=null}if(A=i.baseState,k===null)i.memoizedState=A;else{s=k.next;var W=I=null,J=null,ce=s,me=!1;do{var ve=ce.lane&-536870913;if(ve!==ce.lane?(Ke&ve)===ve:(Ni&ve)===ve){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ve===js&&(me=!0);else if((Ni&ue)===ue){ce=ce.next,ue===js&&(me=!0);continue}else ve={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ve,I=A):J=J.next=ve,Pe.lanes|=ue,hr|=ue;ve=ce.action,Gr&&h(A,ve),A=ce.hasEagerState?ce.eagerState:h(A,ve)}else ue={lane:ve,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(W=J=ue,I=A):J=J.next=ue,Pe.lanes|=ve,hr|=ve;ce=ce.next}while(ce!==null&&ce!==s);if(J===null?I=A:J.next=W,!yn(A,i.memoizedState)&&(It=!0,me&&(h=Ls,h!==null)))throw h;i.memoizedState=A,i.baseState=I,i.baseQueue=J,g.lastRenderedState=A}return k===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Af(i){var s=jt(),h=s.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=i;var g=h.dispatch,k=h.pending,A=s.memoizedState;if(k!==null){h.pending=null;var I=k=k.next;do A=i(A,I.action),I=I.next;while(I!==k);yn(A,s.memoizedState)||(It=!0),s.memoizedState=A,s.baseQueue===null&&(s.baseState=A),h.lastRenderedState=A}return[A,g]}function Y0(i,s,h){var g=Pe,k=jt(),A=Qe;if(A){if(h===void 0)throw Error(r(407));h=h()}else h=s();var I=!yn((pt||k).memoizedState,h);if(I&&(k.memoizedState=h,It=!0),k=k.queue,Rf(K0.bind(null,g,k,i),[i]),k.getSnapshot!==s||I||Bt!==null&&Bt.memoizedState.tag&1){if(g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,k,h,s),null),_t===null)throw Error(r(349));A||(Ni&127)!==0||W0(g,s,h)}return h}function W0(i,s,h){i.flags|=16384,i={getSnapshot:s,value:h},s=Pe.updateQueue,s===null?(s=Ql(),Pe.updateQueue=s,s.stores=[i]):(h=s.stores,h===null?s.stores=[i]:h.push(i))}function X0(i,s,h,g){s.value=h,s.getSnapshot=g,Z0(s)&&Q0(i)}function K0(i,s,h){return h(function(){Z0(s)&&Q0(i)})}function Z0(i){var s=i.getSnapshot;i=i.value;try{var h=s();return!yn(i,h)}catch{return!0}}function Q0(i){var s=Or(i,2);s!==null&&dn(s,i,2)}function Nf(i){var s=rn();if(typeof i=="function"){var h=i;if(i=h(),Gr){qt(!0);try{h()}finally{qt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:i},s}function J0(i,s,h,g){return i.baseState=h,kf(i,pt,typeof g=="function"?g:Ti)}function ZE(i,s,h,g,k){if(ic(i))throw Error(r(485));if(i=s.action,i!==null){var A={payload:k,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};q.T!==null?h(!0):A.isTransition=!1,g(A),h=s.pending,h===null?(A.next=s.pending=A,e_(s,A)):(A.next=h.next,s.pending=h.next=A)}}function e_(i,s){var h=s.action,g=s.payload,k=i.state;if(s.isTransition){var A=q.T,I={};q.T=I;try{var W=h(k,g),J=q.S;J!==null&&J(I,W),t_(i,s,W)}catch(ce){Tf(i,s,ce)}finally{A!==null&&I.types!==null&&(A.types=I.types),q.T=A}}else try{A=h(k,g),t_(i,s,A)}catch(ce){Tf(i,s,ce)}}function t_(i,s,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){n_(i,s,g)},function(g){return Tf(i,s,g)}):n_(i,s,h)}function n_(i,s,h){s.status="fulfilled",s.value=h,i_(s),i.state=h,s=i.pending,s!==null&&(h=s.next,h===s?i.pending=null:(h=h.next,s.next=h,e_(i,h)))}function Tf(i,s,h){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do s.status="rejected",s.reason=h,i_(s),s=s.next;while(s!==g)}i.action=null}function i_(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function r_(i,s){return s}function s_(i,s){if(Qe){var h=_t.formState;if(h!==null){e:{var g=Pe;if(Qe){if(St){t:{for(var k=St,A=Fn;k.nodeType!==8;){if(!A){k=null;break t}if(k=Un(k.nextSibling),k===null){k=null;break t}}A=k.data,k=A==="F!"||A==="F"?k:null}if(k){St=Un(k.nextSibling),g=k.data==="F!";break e}}nr(g)}g=!1}g&&(s=h[0])}}return h=rn(),h.memoizedState=h.baseState=s,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r_,lastRenderedState:s},h.queue=g,h=C_.bind(null,Pe,g),g.dispatch=h,g=Nf(!1),A=Of.bind(null,Pe,!1,g.queue),g=rn(),k={state:s,dispatch:null,action:i,pending:null},g.queue=k,h=ZE.bind(null,Pe,k,A,h),k.dispatch=h,g.memoizedState=i,[s,h,!1]}function a_(i){var s=jt();return o_(s,pt,i)}function o_(i,s,h){if(s=kf(i,s,r_)[0],i=ec(Ti)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var g=Ja(s)}catch(I){throw I===Os?Gl:I}else g=s;s=jt();var k=s.queue,A=k.dispatch;return h!==s.memoizedState&&(Pe.flags|=2048,Fs(9,{destroy:void 0},QE.bind(null,k,h),null)),[g,A,i]}function QE(i,s){i.action=s}function l_(i){var s=jt(),h=pt;if(h!==null)return o_(s,h,i);jt(),s=s.memoizedState,h=jt();var g=h.queue.dispatch;return h.memoizedState=i,[s,g,!1]}function Fs(i,s,h,g){return i={tag:i,create:h,deps:g,inst:s,next:null},s=Pe.updateQueue,s===null&&(s=Ql(),Pe.updateQueue=s),h=s.lastEffect,h===null?s.lastEffect=i.next=i:(g=h.next,h.next=i,i.next=g,s.lastEffect=i),i}function c_(){return jt().memoizedState}function tc(i,s,h,g){var k=rn();Pe.flags|=i,k.memoizedState=Fs(1|s,{destroy:void 0},h,g===void 0?null:g)}function nc(i,s,h,g){var k=jt();g=g===void 0?null:g;var A=k.memoizedState.inst;pt!==null&&g!==null&&bf(g,pt.memoizedState.deps)?k.memoizedState=Fs(s,A,h,g):(Pe.flags|=i,k.memoizedState=Fs(1|s,A,h,g))}function u_(i,s){tc(8390656,8,i,s)}function Rf(i,s){nc(2048,8,i,s)}function JE(i){Pe.flags|=4;var s=Pe.updateQueue;if(s===null)s=Ql(),Pe.updateQueue=s,s.events=[i];else{var h=s.events;h===null?s.events=[i]:h.push(i)}}function h_(i){var s=jt().memoizedState;return JE({ref:s,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function f_(i,s){return nc(4,2,i,s)}function d_(i,s){return nc(4,4,i,s)}function p_(i,s){if(typeof s=="function"){i=i();var h=s(i);return function(){typeof h=="function"?h():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function g_(i,s,h){h=h!=null?h.concat([i]):null,nc(4,4,p_.bind(null,s,i),h)}function Df(){}function m_(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;return s!==null&&bf(s,g[1])?g[0]:(h.memoizedState=[i,s],i)}function __(i,s){var h=jt();s=s===void 0?null:s;var g=h.memoizedState;if(s!==null&&bf(s,g[1]))return g[0];if(g=i(),Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g}function Mf(i,s,h){return h===void 0||(Ni&1073741824)!==0&&(Ke&261930)===0?i.memoizedState=s:(i.memoizedState=h,i=vv(),Pe.lanes|=i,hr|=i,h)}function v_(i,s,h,g){return yn(h,s)?h:Is.current!==null?(i=Mf(i,h,g),yn(i,s)||(It=!0),i):(Ni&42)===0||(Ni&1073741824)!==0&&(Ke&261930)===0?(It=!0,i.memoizedState=h):(i=vv(),Pe.lanes|=i,hr|=i,s)}function y_(i,s,h,g,k){var A=X.p;X.p=A!==0&&8>A?A:8;var I=q.T,W={};q.T=W,Of(i,!1,s,h);try{var J=k(),ce=q.S;if(ce!==null&&ce(W,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=WE(J,g);eo(i,s,me,En(i))}else eo(i,s,g,En(i))}catch(ve){eo(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&W.types!==null&&(I.types=W.types),q.T=I}}function ek(){}function jf(i,s,h,g){if(i.tag!==5)throw Error(r(476));var k=b_(i).queue;y_(i,k,s,K,h===null?ek:function(){return S_(i),h(g)})}function b_(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function S_(i){var s=b_(i);s.next===null&&(s=i.alternate.memoizedState),eo(i,s.next.queue,{},En())}function Lf(){return Xt(vo)}function x_(){return jt().memoizedState}function w_(){return jt().memoizedState}function tk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=sr(h);var g=ar(s,i,h);g!==null&&(dn(g,s,h),Xa(g,s,h)),s={cache:cf()},i.payload=s;return}s=s.return}}function nk(i,s,h){var g=En();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ic(i)?E_(s,h):(h=Zh(i,s,h,g),h!==null&&(dn(h,i,g),k_(h,s,g)))}function C_(i,s,h){var g=En();eo(i,s,h,g)}function eo(i,s,h,g){var k={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ic(i))E_(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,W=A(I,h);if(k.hasEagerState=!0,k.eagerState=W,yn(W,I))return Il(i,s,k,0),_t===null&&Bl(),!1}catch{}finally{}if(h=Zh(i,s,k,g),h!==null)return dn(h,i,g),k_(h,s,g),!0}return!1}function Of(i,s,h,g){if(g={lane:2,revertLane:dd(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},ic(i)){if(s)throw Error(r(479))}else s=Zh(i,h,g,2),s!==null&&dn(s,i,2)}function ic(i){var s=i.alternate;return i===Pe||s!==null&&s===Pe}function E_(i,s){zs=Kl=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function k_(i,s,h){if((h&4194048)!==0){var g=s.lanes;g&=i.pendingLanes,h|=g,s.lanes=h,nn(i,h)}}var to={readContext:Xt,use:Jl,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};to.useEffectEvent=Tt;var A_={readContext:Xt,use:Jl,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Xt,useEffect:u_,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,tc(4194308,4,p_.bind(null,s,i),h)},useLayoutEffect:function(i,s){return tc(4194308,4,i,s)},useInsertionEffect:function(i,s){tc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var g=i();if(Gr){qt(!0);try{i()}finally{qt(!1)}}return h.memoizedState=[g,s],g},useReducer:function(i,s,h){var g=rn();if(h!==void 0){var k=h(s);if(Gr){qt(!0);try{h(s)}finally{qt(!1)}}}else k=s;return g.memoizedState=g.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},g.queue=i,i=i.dispatch=nk.bind(null,Pe,i),[g.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Nf(i);var s=i.queue,h=C_.bind(null,Pe,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:Df,useDeferredValue:function(i,s){var h=rn();return Mf(h,i,s)},useTransition:function(){var i=Nf(!1);return i=y_.bind(null,Pe,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var g=Pe,k=rn();if(Qe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),_t===null)throw Error(r(349));(Ke&127)!==0||W0(g,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,u_(K0.bind(null,g,A,i),[i]),g.flags|=2048,Fs(9,{destroy:void 0},X0.bind(null,g,A,h,s),null),h},useId:function(){var i=rn(),s=_t.identifierPrefix;if(Qe){var h=si,g=ri;h=(g&~(1<<32-st(g)-1)).toString(32)+h,s="_"+s+"R_"+h,h=Zl++,0<h&&(s+="H"+h.toString(32)),s+="_"}else h=XE++,s="_"+s+"r_"+h.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Lf,useFormState:s_,useActionState:s_,useOptimistic:function(i){var s=rn();s.memoizedState=s.baseState=i;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=h,s=Of.bind(null,Pe,!0,h),h.dispatch=s,[i,s]},useMemoCache:Ef,useCacheRefresh:function(){return rn().memoizedState=tk.bind(null,Pe)},useEffectEvent:function(i){var s=rn(),h={impl:i};return s.memoizedState=h,function(){if((ot&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Bf={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:ec,useRef:c_,useState:function(){return ec(Ti)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=ec(Ti)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:a_,useActionState:a_,useOptimistic:function(i,s){var h=jt();return J0(h,pt,i,s)},useMemoCache:Ef,useCacheRefresh:w_};Bf.useEffectEvent=h_;var N_={readContext:Xt,use:Jl,useCallback:m_,useContext:Xt,useEffect:Rf,useImperativeHandle:g_,useInsertionEffect:f_,useLayoutEffect:d_,useMemo:__,useReducer:Af,useRef:c_,useState:function(){return Af(Ti)},useDebugValue:Df,useDeferredValue:function(i,s){var h=jt();return pt===null?Mf(h,i,s):v_(h,pt.memoizedState,i,s)},useTransition:function(){var i=Af(Ti)[0],s=jt().memoizedState;return[typeof i=="boolean"?i:Ja(i),s]},useSyncExternalStore:Y0,useId:x_,useHostTransitionStatus:Lf,useFormState:l_,useActionState:l_,useOptimistic:function(i,s){var h=jt();return pt!==null?J0(h,pt,i,s):(h.baseState=i,[i,h.queue.dispatch])},useMemoCache:Ef,useCacheRefresh:w_};N_.useEffectEvent=h_;function If(i,s,h,g){s=i.memoizedState,h=h(g,s),h=h==null?s:d({},s,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var zf={enqueueSetState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueReplaceState:function(i,s,h){i=i._reactInternals;var g=En(),k=sr(g);k.tag=1,k.payload=s,h!=null&&(k.callback=h),s=ar(i,k,g),s!==null&&(dn(s,i,g),Xa(s,i,g))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var h=En(),g=sr(h);g.tag=2,s!=null&&(g.callback=s),s=ar(i,g,h),s!==null&&(dn(s,i,h),Xa(s,i,h))}};function T_(i,s,h,g,k,A,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,A,I):s.prototype&&s.prototype.isPureReactComponent?!Pa(h,g)||!Pa(k,A):!0}function R_(i,s,h,g){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(h,g),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(h,g),s.state!==i&&zf.enqueueReplaceState(s,s.state,null)}function qr(i,s){var h=s;if("ref"in s){h={};for(var g in s)g!=="ref"&&(h[g]=s[g])}if(i=i.defaultProps){h===s&&(h=d({},h));for(var k in i)h[k]===void 0&&(h[k]=i[k])}return h}function D_(i){Ol(i)}function M_(i){console.error(i)}function j_(i){Ol(i)}function rc(i,s){try{var h=i.onUncaughtError;h(s.value,{componentStack:s.stack})}catch(g){setTimeout(function(){throw g})}}function L_(i,s,h){try{var g=i.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(k){setTimeout(function(){throw k})}}function Hf(i,s,h){return h=sr(h),h.tag=3,h.payload={element:null},h.callback=function(){rc(i,s)},h}function O_(i){return i=sr(i),i.tag=3,i}function B_(i,s,h,g){var k=h.type.getDerivedStateFromError;if(typeof k=="function"){var A=g.value;i.payload=function(){return k(A)},i.callback=function(){L_(s,h,g)}}var I=h.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){L_(s,h,g),typeof k!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var W=g.stack;this.componentDidCatch(g.value,{componentStack:W!==null?W:""})})}function ik(i,s,h,g,k){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(s=h.alternate,s!==null&&Ms(s,h,k,!0),h=Sn.current,h!==null){switch(h.tag){case 31:case 13:return Pn===null?mc():h.alternate===null&&Rt===0&&(Rt=3),h.flags&=-257,h.flags|=65536,h.lanes=k,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?h.updateQueue=new Set([g]):s.add(g),ud(i,g,k)),!1;case 22:return h.flags|=65536,g===ql?h.flags|=16384:(s=h.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=s):(h=s.retryQueue,h===null?s.retryQueue=new Set([g]):h.add(g)),ud(i,g,k)),!1}throw Error(r(435,h.tag))}return ud(i,g,k),mc(),!1}if(Qe)return s=Sn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=k,g!==rf&&(i=Error(r(422),{cause:g}),Ga(In(i,h)))):(g!==rf&&(s=Error(r(423),{cause:g}),Ga(In(s,h))),i=i.current.alternate,i.flags|=65536,k&=-k,i.lanes|=k,g=In(g,h),k=Hf(i.stateNode,g,k),gf(i,k),Rt!==4&&(Rt=2)),!1;var A=Error(r(520),{cause:g});if(A=In(A,h),co===null?co=[A]:co.push(A),Rt!==4&&(Rt=2),s===null)return!0;g=In(g,h),h=s;do{switch(h.tag){case 3:return h.flags|=65536,i=k&-k,h.lanes|=i,i=Hf(h.stateNode,g,i),gf(h,i),!1;case 1:if(s=h.type,A=h.stateNode,(h.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(fr===null||!fr.has(A))))return h.flags|=65536,k&=-k,h.lanes|=k,k=O_(k),B_(k,i,h,g),gf(h,k),!1}h=h.return}while(h!==null);return!1}var Ff=Error(r(461)),It=!1;function Kt(i,s,h,g){s.child=i===null?F0(s,null,h,g):$r(s,i.child,h,g)}function I_(i,s,h,g,k){h=h.render;var A=s.ref;if("ref"in g){var I={};for(var W in g)W!=="ref"&&(I[W]=g[W])}else I=g;return Hr(s),g=Sf(i,s,h,I,A,k),W=xf(),i!==null&&!It?(wf(i,s,k),Ri(i,s,k)):(Qe&&W&&tf(s),s.flags|=1,Kt(i,s,g,k),s.child)}function z_(i,s,h,g,k){if(i===null){var A=h.type;return typeof A=="function"&&!Qh(A)&&A.defaultProps===void 0&&h.compare===null?(s.tag=15,s.type=A,H_(i,s,A,g,k)):(i=Hl(h.type,null,g,s,s.mode,k),i.ref=s.ref,i.return=s,s.child=i)}if(A=i.child,!Wf(i,k)){var I=A.memoizedProps;if(h=h.compare,h=h!==null?h:Pa,h(I,g)&&i.ref===s.ref)return Ri(i,s,k)}return s.flags|=1,i=Ci(A,g),i.ref=s.ref,i.return=s,s.child=i}function H_(i,s,h,g,k){if(i!==null){var A=i.memoizedProps;if(Pa(A,g)&&i.ref===s.ref)if(It=!1,s.pendingProps=g=A,Wf(i,k))(i.flags&131072)!==0&&(It=!0);else return s.lanes=i.lanes,Ri(i,s,k)}return Pf(i,s,h,g,k)}function F_(i,s,h,g){var k=g.children,A=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((s.flags&128)!==0){if(A=A!==null?A.baseLanes|h:h,i!==null){for(g=s.child=i.child,k=0;g!==null;)k=k|g.lanes|g.childLanes,g=g.sibling;g=k&~A}else g=0,s.child=null;return P_(i,s,A,h,g)}if((h&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&$l(s,A!==null?A.cachePool:null),A!==null?$0(s,A):_f(),G0(s);else return g=s.lanes=536870912,P_(i,s,A!==null?A.baseLanes|h:h,h,g)}else A!==null?($l(s,A.cachePool),$0(s,A),lr(),s.memoizedState=null):(i!==null&&$l(s,null),_f(),lr());return Kt(i,s,k,h),s.child}function no(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function P_(i,s,h,g,k){var A=hf();return A=A===null?null:{parent:Ot._currentValue,pool:A},s.memoizedState={baseLanes:h,cachePool:A},i!==null&&$l(s,null),_f(),G0(s),i!==null&&Ms(i,s,g,!0),s.childLanes=k,null}function sc(i,s){return s=oc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function U_(i,s,h){return $r(s,i.child,null,h),i=sc(s,s.pendingProps),i.flags|=2,xn(s),s.memoizedState=null,i}function rk(i,s,h){var g=s.pendingProps,k=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Qe){if(g.mode==="hidden")return i=sc(s,g),s.lanes=536870912,no(null,i);if(yf(s),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return s.lanes=536870912,null}return sc(s,g)}var A=i.memoizedState;if(A!==null){var I=A.dehydrated;if(yf(s),k)if(s.flags&256)s.flags&=-257,s=U_(i,s,h);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(It||Ms(i,s,h,!1),k=(h&i.childLanes)!==0,It||k){if(g=_t,g!==null&&(I=gs(g,h),I!==0&&I!==A.retryLane))throw A.retryLane=I,Or(i,I),dn(g,i,I),Ff;mc(),s=U_(i,s,h)}else i=A.treeContext,St=Un(I.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=sc(s,g),s.flags|=4096;return s}return i=Ci(i.child,{mode:g.mode,children:g.children}),i.ref=s.ref,s.child=i,i.return=s,i}function ac(i,s){var h=s.ref;if(h===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(i===null||i.ref!==h)&&(s.flags|=4194816)}}function Pf(i,s,h,g,k){return Hr(s),h=Sf(i,s,h,g,void 0,k),g=xf(),i!==null&&!It?(wf(i,s,k),Ri(i,s,k)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,k),s.child)}function $_(i,s,h,g,k,A){return Hr(s),s.updateQueue=null,h=V0(s,g,h,k),q0(i),g=xf(),i!==null&&!It?(wf(i,s,A),Ri(i,s,A)):(Qe&&g&&tf(s),s.flags|=1,Kt(i,s,h,A),s.child)}function G_(i,s,h,g,k){if(Hr(s),s.stateNode===null){var A=Ns,I=h.contextType;typeof I=="object"&&I!==null&&(A=Xt(I)),A=new h(g,A),s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=zf,s.stateNode=A,A._reactInternals=s,A=s.stateNode,A.props=g,A.state=s.memoizedState,A.refs={},df(s),I=h.contextType,A.context=typeof I=="object"&&I!==null?Xt(I):Ns,A.state=s.memoizedState,I=h.getDerivedStateFromProps,typeof I=="function"&&(If(s,h,I,g),A.state=s.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(I=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),I!==A.state&&zf.enqueueReplaceState(A,A.state,null),Za(s,g,A,k),Ka(),A.state=s.memoizedState),typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!0}else if(i===null){A=s.stateNode;var W=s.memoizedProps,J=qr(h,W);A.props=J;var ce=A.context,me=h.contextType;I=Ns,typeof me=="object"&&me!==null&&(I=Xt(me));var ve=h.getDerivedStateFromProps;me=typeof ve=="function"||typeof A.getSnapshotBeforeUpdate=="function",W=s.pendingProps!==W,me||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(W||ce!==I)&&R_(s,A,g,I),rr=!1;var ue=s.memoizedState;A.state=ue,Za(s,g,A,k),Ka(),ce=s.memoizedState,W||ue!==ce||rr?(typeof ve=="function"&&(If(s,h,ve,g),ce=s.memoizedState),(J=rr||T_(s,h,J,g,ue,ce,I))?(me||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(s.flags|=4194308)):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=g,s.memoizedState=ce),A.props=g,A.state=ce,A.context=I,g=J):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),g=!1)}else{A=s.stateNode,pf(i,s),I=s.memoizedProps,me=qr(h,I),A.props=me,ve=s.pendingProps,ue=A.context,ce=h.contextType,J=Ns,typeof ce=="object"&&ce!==null&&(J=Xt(ce)),W=h.getDerivedStateFromProps,(ce=typeof W=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==ve||ue!==J)&&R_(s,A,g,J),rr=!1,ue=s.memoizedState,A.state=ue,Za(s,g,A,k),Ka();var pe=s.memoizedState;I!==ve||ue!==pe||rr||i!==null&&i.dependencies!==null&&Pl(i.dependencies)?(typeof W=="function"&&(If(s,h,W,g),pe=s.memoizedState),(me=rr||T_(s,h,me,g,ue,pe,J)||i!==null&&i.dependencies!==null&&Pl(i.dependencies))?(ce||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,pe,J),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,pe,J)),typeof A.componentDidUpdate=="function"&&(s.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),s.memoizedProps=g,s.memoizedState=pe),A.props=g,A.state=pe,A.context=J,g=me):(typeof A.componentDidUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ue===i.memoizedState||(s.flags|=1024),g=!1)}return A=g,ac(i,s),g=(s.flags&128)!==0,A||g?(A=s.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:A.render(),s.flags|=1,i!==null&&g?(s.child=$r(s,i.child,null,k),s.child=$r(s,null,h,k)):Kt(i,s,h,k),s.memoizedState=A.state,i=s.child):i=Ri(i,s,k),i}function q_(i,s,h,g){return Ir(),s.flags|=256,Kt(i,s,h,g),s.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $f(i){return{baseLanes:i,cachePool:L0()}}function Gf(i,s,h){return i=i!==null?i.childLanes&~h:0,s&&(i|=Cn),i}function V_(i,s,h){var g=s.pendingProps,k=!1,A=(s.flags&128)!==0,I;if((I=A)||(I=i!==null&&i.memoizedState===null?!1:(Mt.current&2)!==0),I&&(k=!0,s.flags&=-129),I=(s.flags&32)!==0,s.flags&=-33,i===null){if(Qe){if(k?or(s):lr(),(i=St)?(i=ey(i,Fn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},h=E0(i),h.return=s,s.child=h,Wt=s,St=null)):i=null,i===null)throw nr(s);return kd(i)?s.lanes=32:s.lanes=536870912,null}var W=g.children;return g=g.fallback,k?(lr(),k=s.mode,W=oc({mode:"hidden",children:W},k),g=Br(g,k,h,null),W.return=s,g.return=s,W.sibling=g,s.child=W,g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(null,g)):(or(s),qf(s,W))}var J=i.memoizedState;if(J!==null&&(W=J.dehydrated,W!==null)){if(A)s.flags&256?(or(s),s.flags&=-257,s=Vf(i,s,h)):s.memoizedState!==null?(lr(),s.child=i.child,s.flags|=128,s=null):(lr(),W=g.fallback,k=s.mode,g=oc({mode:"visible",children:g.children},k),W=Br(W,k,h,null),W.flags|=2,g.return=s,W.return=s,g.sibling=W,s.child=g,$r(s,i.child,null,h),g=s.child,g.memoizedState=$f(h),g.childLanes=Gf(i,I,h),s.memoizedState=Uf,s=no(null,g));else if(or(s),kd(W)){if(I=W.nextSibling&&W.nextSibling.dataset,I)var ce=I.dgst;I=ce,g=Error(r(419)),g.stack="",g.digest=I,Ga({value:g,source:null,stack:null}),s=Vf(i,s,h)}else if(It||Ms(i,s,h,!1),I=(h&i.childLanes)!==0,It||I){if(I=_t,I!==null&&(g=gs(I,h),g!==0&&g!==J.retryLane))throw J.retryLane=g,Or(i,g),dn(I,i,g),Ff;Ed(W)||mc(),s=Vf(i,s,h)}else Ed(W)?(s.flags|=192,s.child=i.child,s=null):(i=J.treeContext,St=Un(W.nextSibling),Wt=s,Qe=!0,tr=null,Fn=!1,i!==null&&N0(s,i),s=qf(s,g.children),s.flags|=4096);return s}return k?(lr(),W=g.fallback,k=s.mode,J=i.child,ce=J.sibling,g=Ci(J,{mode:"hidden",children:g.children}),g.subtreeFlags=J.subtreeFlags&65011712,ce!==null?W=Ci(ce,W):(W=Br(W,k,h,null),W.flags|=2),W.return=s,g.return=s,g.sibling=W,s.child=g,no(null,g),g=s.child,W=i.child.memoizedState,W===null?W=$f(h):(k=W.cachePool,k!==null?(J=Ot._currentValue,k=k.parent!==J?{parent:J,pool:J}:k):k=L0(),W={baseLanes:W.baseLanes|h,cachePool:k}),g.memoizedState=W,g.childLanes=Gf(i,I,h),s.memoizedState=Uf,no(i.child,g)):(or(s),h=i.child,i=h.sibling,h=Ci(h,{mode:"visible",children:g.children}),h.return=s,h.sibling=null,i!==null&&(I=s.deletions,I===null?(s.deletions=[i],s.flags|=16):I.push(i)),s.child=h,s.memoizedState=null,h)}function qf(i,s){return s=oc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function oc(i,s){return i=bn(22,i,null,s),i.lanes=0,i}function Vf(i,s,h){return $r(s,i.child,null,h),i=qf(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Y_(i,s,h){i.lanes|=s;var g=i.alternate;g!==null&&(g.lanes|=s),of(i.return,s,h)}function Yf(i,s,h,g,k,A){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:k,treeForkCount:A}:(I.isBackwards=s,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=h,I.tailMode=k,I.treeForkCount=A)}function W_(i,s,h){var g=s.pendingProps,k=g.revealOrder,A=g.tail;g=g.children;var I=Mt.current,W=(I&2)!==0;if(W?(I=I&1|2,s.flags|=128):I&=1,F(Mt,I),Kt(i,s,g,h),g=Qe?$a:0,!W&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Y_(i,h,s);else if(i.tag===19)Y_(i,h,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(k){case"forwards":for(h=s.child,k=null;h!==null;)i=h.alternate,i!==null&&Xl(i)===null&&(k=h),h=h.sibling;h=k,h===null?(k=s.child,s.child=null):(k=h.sibling,h.sibling=null),Yf(s,!1,k,h,A,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,k=s.child,s.child=null;k!==null;){if(i=k.alternate,i!==null&&Xl(i)===null){s.child=k;break}i=k.sibling,k.sibling=h,h=k,k=i}Yf(s,!0,h,null,A,g);break;case"together":Yf(s,!1,null,null,void 0,g);break;default:s.memoizedState=null}return s.child}function Ri(i,s,h){if(i!==null&&(s.dependencies=i.dependencies),hr|=s.lanes,(h&s.childLanes)===0)if(i!==null){if(Ms(i,s,h,!1),(h&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,h=Ci(i,i.pendingProps),s.child=h,h.return=s;i.sibling!==null;)i=i.sibling,h=h.sibling=Ci(i,i.pendingProps),h.return=s;h.sibling=null}return s.child}function Wf(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Pl(i)))}function sk(i,s,h){switch(s.tag){case 3:P(s,s.stateNode.containerInfo),ir(s,Ot,i.memoizedState.cache),Ir();break;case 27:case 5:ne(s);break;case 4:P(s,s.stateNode.containerInfo);break;case 10:ir(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,yf(s),null;break;case 13:var g=s.memoizedState;if(g!==null)return g.dehydrated!==null?(or(s),s.flags|=128,null):(h&s.child.childLanes)!==0?V_(i,s,h):(or(s),i=Ri(i,s,h),i!==null?i.sibling:null);or(s);break;case 19:var k=(i.flags&128)!==0;if(g=(h&s.childLanes)!==0,g||(Ms(i,s,h,!1),g=(h&s.childLanes)!==0),k){if(g)return W_(i,s,h);s.flags|=128}if(k=s.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),F(Mt,Mt.current),g)break;return null;case 22:return s.lanes=0,F_(i,s,h,s.pendingProps);case 24:ir(s,Ot,i.memoizedState.cache)}return Ri(i,s,h)}function X_(i,s,h){if(i!==null)if(i.memoizedProps!==s.pendingProps)It=!0;else{if(!Wf(i,h)&&(s.flags&128)===0)return It=!1,sk(i,s,h);It=(i.flags&131072)!==0}else It=!1,Qe&&(s.flags&1048576)!==0&&A0(s,$a,s.index);switch(s.lanes=0,s.tag){case 16:e:{var g=s.pendingProps;if(i=Pr(s.elementType),s.type=i,typeof i=="function")Qh(i)?(g=qr(i,g),s.tag=1,s=G_(null,s,i,g,h)):(s.tag=0,s=Pf(null,s,i,g,h));else{if(i!=null){var k=i.$$typeof;if(k===E){s.tag=11,s=I_(null,s,i,g,h);break e}else if(k===D){s.tag=14,s=z_(null,s,i,g,h);break e}}throw s=H(i)||i,Error(r(306,s,""))}}return s;case 0:return Pf(i,s,s.type,s.pendingProps,h);case 1:return g=s.type,k=qr(g,s.pendingProps),G_(i,s,g,k,h);case 3:e:{if(P(s,s.stateNode.containerInfo),i===null)throw Error(r(387));g=s.pendingProps;var A=s.memoizedState;k=A.element,pf(i,s),Za(s,g,null,h);var I=s.memoizedState;if(g=I.cache,ir(s,Ot,g),g!==A.cache&&lf(s,[Ot],h,!0),Ka(),g=I.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:I.cache},s.updateQueue.baseState=A,s.memoizedState=A,s.flags&256){s=q_(i,s,g,h);break e}else if(g!==k){k=In(Error(r(424)),s),Ga(k),s=q_(i,s,g,h);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(St=Un(i.firstChild),Wt=s,Qe=!0,tr=null,Fn=!0,h=F0(s,null,g,h),s.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(Ir(),g===k){s=Ri(i,s,h);break e}Kt(i,s,g,h)}s=s.child}return s;case 26:return ac(i,s),i===null?(h=ay(s.type,null,s.pendingProps,null))?s.memoizedState=h:Qe||(h=s.type,i=s.pendingProps,g=wc(ae.current).createElement(h),g[$t]=s,g[Qt]=i,Zt(g,h,i),Lt(g),s.stateNode=g):s.memoizedState=ay(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ne(s),i===null&&Qe&&(g=s.stateNode=iy(s.type,s.pendingProps,ae.current),Wt=s,Fn=!0,k=St,mr(s.type)?(Ad=k,St=Un(g.firstChild)):St=k),Kt(i,s,s.pendingProps.children,h),ac(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Qe&&((k=g=St)&&(g=Ok(g,s.type,s.pendingProps,Fn),g!==null?(s.stateNode=g,Wt=s,St=Un(g.firstChild),Fn=!1,k=!0):k=!1),k||nr(s)),ne(s),k=s.type,A=s.pendingProps,I=i!==null?i.memoizedProps:null,g=A.children,xd(k,A)?g=null:I!==null&&xd(k,I)&&(s.flags|=32),s.memoizedState!==null&&(k=Sf(i,s,KE,null,null,h),vo._currentValue=k),ac(i,s),Kt(i,s,g,h),s.child;case 6:return i===null&&Qe&&((i=h=St)&&(h=Bk(h,s.pendingProps,Fn),h!==null?(s.stateNode=h,Wt=s,St=null,i=!0):i=!1),i||nr(s)),null;case 13:return V_(i,s,h);case 4:return P(s,s.stateNode.containerInfo),g=s.pendingProps,i===null?s.child=$r(s,null,g,h):Kt(i,s,g,h),s.child;case 11:return I_(i,s,s.type,s.pendingProps,h);case 7:return Kt(i,s,s.pendingProps,h),s.child;case 8:return Kt(i,s,s.pendingProps.children,h),s.child;case 12:return Kt(i,s,s.pendingProps.children,h),s.child;case 10:return g=s.pendingProps,ir(s,s.type,g.value),Kt(i,s,g.children,h),s.child;case 9:return k=s.type._context,g=s.pendingProps.children,Hr(s),k=Xt(k),g=g(k),s.flags|=1,Kt(i,s,g,h),s.child;case 14:return z_(i,s,s.type,s.pendingProps,h);case 15:return H_(i,s,s.type,s.pendingProps,h);case 19:return W_(i,s,h);case 31:return rk(i,s,h);case 22:return F_(i,s,h,s.pendingProps);case 24:return Hr(s),g=Xt(Ot),i===null?(k=hf(),k===null&&(k=_t,A=cf(),k.pooledCache=A,A.refCount++,A!==null&&(k.pooledCacheLanes|=h),k=A),s.memoizedState={parent:g,cache:k},df(s),ir(s,Ot,k)):((i.lanes&h)!==0&&(pf(i,s),Za(s,null,null,h),Ka()),k=i.memoizedState,A=s.memoizedState,k.parent!==g?(k={parent:g,cache:g},s.memoizedState=k,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=k),ir(s,Ot,g)):(g=A.cache,ir(s,Ot,g),g!==k.cache&&lf(s,[Ot],h,!0))),Kt(i,s,s.pendingProps.children,h),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Di(i){i.flags|=4}function Xf(i,s,h,g,k){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(k&335544128)===k)if(i.stateNode.complete)i.flags|=8192;else if(xv())i.flags|=8192;else throw Ur=ql,ff}else i.flags&=-16777217}function K_(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!hy(s))if(xv())i.flags|=8192;else throw Ur=ql,ff}function lc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?we():536870912,i.lanes|=s,Gs|=s)}function io(i,s){if(!Qe)switch(i.tailMode){case"hidden":s=i.tail;for(var h=null;s!==null;)s.alternate!==null&&(h=s),s=s.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,h=0,g=0;if(s)for(var k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags&65011712,g|=k.flags&65011712,k.return=i,k=k.sibling;else for(k=i.child;k!==null;)h|=k.lanes|k.childLanes,g|=k.subtreeFlags,g|=k.flags,k.return=i,k=k.sibling;return i.subtreeFlags|=g,i.childLanes=h,s}function ak(i,s,h){var g=s.pendingProps;switch(nf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(s),null;case 1:return xt(s),null;case 3:return h=s.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),s.memoizedState.cache!==g&&(s.flags|=2048),Ai(Ot),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(i===null||i.child===null)&&(Ds(s)?Di(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sf())),xt(s),null;case 26:var k=s.type,A=s.memoizedState;return i===null?(Di(s),A!==null?(xt(s),K_(s,A)):(xt(s),Xf(s,k,null,g,h))):A?A!==i.memoizedState?(Di(s),xt(s),K_(s,A)):(xt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==g&&Di(s),xt(s),Xf(s,k,i,g,h)),null;case 27:if(ge(s),h=ae.current,k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}i=Q.current,Ds(s)?T0(s):(i=iy(k,g,h),s.stateNode=i,Di(s))}return xt(s),null;case 5:if(ge(s),k=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(!g){if(s.stateNode===null)throw Error(r(166));return xt(s),null}if(A=Q.current,Ds(s))T0(s);else{var I=wc(ae.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;default:switch(k){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",k);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",k);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?A.multiple=!0:g.size&&(A.size=g.size);break;default:A=typeof g.is=="string"?I.createElement(k,{is:g.is}):I.createElement(k)}}A[$t]=s,A[Qt]=g;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Zt(A,k,g),k){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Di(s)}}return xt(s),Xf(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==g&&Di(s);else{if(typeof g!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Ds(s)){if(i=s.stateNode,h=s.memoizedProps,g=null,k=Wt,k!==null)switch(k.tag){case 27:case 5:g=k.memoizedProps}i[$t]=s,i=!!(i.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||Vv(i.nodeValue,h)),i||nr(s,!0)}else i=wc(i).createTextNode(g),i[$t]=s,s.stateNode=i}return xt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(g=Ds(s),h!==null){if(i===null){if(!g)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),i=!1}else h=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return xt(s),null;case 13:if(g=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Ds(s),g!==null&&g.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[$t]=s}else Ir(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xt(s),k=!1}else k=sf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=g!==null,i=i!==null&&i.memoizedState!==null,h&&(g=s.child,k=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(k=g.alternate.memoizedState.cachePool.pool),A=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(A=g.memoizedState.cachePool.pool),A!==k&&(g.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),lc(s,s.updateQueue),xt(s),null);case 4:return ee(),i===null&&_d(s.stateNode.containerInfo),xt(s),null;case 10:return Ai(s.type),xt(s),null;case 19:if($(Mt),g=s.memoizedState,g===null)return xt(s),null;if(k=(s.flags&128)!==0,A=g.rendering,A===null)if(k)io(g,!1);else{if(Rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Xl(i),A!==null){for(s.flags|=128,io(g,!1),i=A.updateQueue,s.updateQueue=i,lc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)C0(h,i),h=h.sibling;return F(Mt,Mt.current&1|2),Qe&&Ei(s,g.treeForkCount),s.child}i=i.sibling}g.tail!==null&&Fe()>dc&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304)}else{if(!k)if(i=Xl(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,lc(s,i),io(g,!0),g.tail===null&&g.tailMode==="hidden"&&!A.alternate&&!Qe)return xt(s),null}else 2*Fe()-g.renderingStartTime>dc&&h!==536870912&&(s.flags|=128,k=!0,io(g,!1),s.lanes=4194304);g.isBackwards?(A.sibling=s.child,s.child=A):(i=g.last,i!==null?i.sibling=A:s.child=A,g.last=A)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=Fe(),i.sibling=null,h=Mt.current,F(Mt,k?h&1|2:h&1),Qe&&Ei(s,g.treeForkCount),i):(xt(s),null);case 22:case 23:return xn(s),vf(),g=s.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(s.flags|=8192):g&&(s.flags|=8192),g?(h&536870912)!==0&&(s.flags&128)===0&&(xt(s),s.subtreeFlags&6&&(s.flags|=8192)):xt(s),h=s.updateQueue,h!==null&&lc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==h&&(s.flags|=2048),i!==null&&$(Fr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ai(Ot),xt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function ok(i,s){switch(nf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ai(Ot),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ir()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return $(Mt),null;case 4:return ee(),null;case 10:return Ai(s.type),null;case 22:case 23:return xn(s),vf(),i!==null&&$(Fr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ai(Ot),null;case 25:return null;default:return null}}function Z_(i,s){switch(nf(s),s.tag){case 3:Ai(Ot),ee();break;case 26:case 27:case 5:ge(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:$(Mt);break;case 10:Ai(s.type);break;case 22:case 23:xn(s),vf(),i!==null&&$(Fr);break;case 24:Ai(Ot)}}function ro(i,s){try{var h=s.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var k=g.next;h=k;do{if((h.tag&i)===i){g=void 0;var A=h.create,I=h.inst;g=A(),I.destroy=g}h=h.next}while(h!==k)}}catch(W){dt(s,s.return,W)}}function cr(i,s,h){try{var g=s.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&i)===i){var I=g.inst,W=I.destroy;if(W!==void 0){I.destroy=void 0,k=s;var J=h,ce=W;try{ce()}catch(me){dt(k,J,me)}}}g=g.next}while(g!==A)}}catch(me){dt(s,s.return,me)}}function Q_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{U0(s,h)}catch(g){dt(i,i.return,g)}}}function J_(i,s,h){h.props=qr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(g){dt(i,s,g)}}function so(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof h=="function"?i.refCleanup=h(g):h.current=g}}catch(k){dt(i,s,k)}}function ai(i,s){var h=i.ref,g=i.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(k){dt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){dt(i,s,k)}else h.current=null}function ev(i){var s=i.type,h=i.memoizedProps,g=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(k){dt(i,i.return,k)}}function Kf(i,s,h){try{var g=i.stateNode;Tk(g,i.type,h,s),g[Qt]=s}catch(k){dt(i,i.return,k)}}function tv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function Zf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||tv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qf(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=xi));else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(Qf(i,s,h),i=i.sibling;i!==null;)Qf(i,s,h),i=i.sibling}function cc(i,s,h){var g=i.tag;if(g===5||g===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(g!==4&&(g===27&&mr(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(cc(i,s,h),i=i.sibling;i!==null;)cc(i,s,h),i=i.sibling}function nv(i){var s=i.stateNode,h=i.memoizedProps;try{for(var g=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Zt(s,g,h),s[$t]=i,s[Qt]=h}catch(A){dt(i,i.return,A)}}var Mi=!1,zt=!1,Jf=!1,iv=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function lk(i,s){if(i=i.containerInfo,bd=Rc,i=g0(i),qh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var k=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,W=-1,J=-1,ce=0,me=0,ve=i,ue=null;t:for(;;){for(var pe;ve!==h||k!==0&&ve.nodeType!==3||(W=I+k),ve!==A||g!==0&&ve.nodeType!==3||(J=I+g),ve.nodeType===3&&(I+=ve.nodeValue.length),(pe=ve.firstChild)!==null;)ue=ve,ve=pe;for(;;){if(ve===i)break t;if(ue===h&&++ce===k&&(W=I),ue===A&&++me===g&&(J=I),(pe=ve.nextSibling)!==null)break;ve=ue,ue=ve.parentNode}ve=pe}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Sd={focusedElem:i,selectionRange:h},Rc=!1,Vt=s;Vt!==null;)if(s=Vt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Vt=i;else for(;Vt!==null;){switch(s=Vt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h<i.length;h++)k=i[h],k.ref.impl=k.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&A!==null){i=void 0,h=s,k=A.memoizedProps,A=A.memoizedState,g=h.stateNode;try{var Te=qr(h.type,k);i=g.getSnapshotBeforeUpdate(Te,A),g.__reactInternalSnapshotBeforeUpdate=i}catch(Be){dt(h,h.return,Be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,h=i.nodeType,h===9)Cd(i);else if(h===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Cd(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Vt=i;break}Vt=s.return}}function rv(i,s,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Li(i,h),g&4&&ro(5,h);break;case 1:if(Li(i,h),g&4)if(i=h.stateNode,s===null)try{i.componentDidMount()}catch(I){dt(h,h.return,I)}else{var k=qr(h.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(k,s,i.__reactInternalSnapshotBeforeUpdate)}catch(I){dt(h,h.return,I)}}g&64&&Q_(h),g&512&&so(h,h.return);break;case 3:if(Li(i,h),g&64&&(i=h.updateQueue,i!==null)){if(s=null,h.child!==null)switch(h.child.tag){case 27:case 5:s=h.child.stateNode;break;case 1:s=h.child.stateNode}try{U0(i,s)}catch(I){dt(h,h.return,I)}}break;case 27:s===null&&g&4&&nv(h);case 26:case 5:Li(i,h),s===null&&g&4&&ev(h),g&512&&so(h,h.return);break;case 12:Li(i,h);break;case 31:Li(i,h),g&4&&ov(i,h);break;case 13:Li(i,h),g&4&&lv(i,h),g&64&&(i=h.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(h=_k.bind(null,h),Ik(i,h))));break;case 22:if(g=h.memoizedState!==null||Mi,!g){s=s!==null&&s.memoizedState!==null||zt,k=Mi;var A=zt;Mi=g,(zt=s)&&!A?Oi(i,h,(h.subtreeFlags&8772)!==0):Li(i,h),Mi=k,zt=A}break;case 30:break;default:Li(i,h)}}function sv(i){var s=i.alternate;s!==null&&(i.alternate=null,sv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Na(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Et=null,cn=!1;function ji(i,s,h){for(h=h.child;h!==null;)av(i,s,h),h=h.sibling}function av(i,s,h){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Nt,h)}catch{}switch(h.tag){case 26:zt||ai(h,s),ji(i,s,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:zt||ai(h,s);var g=Et,k=cn;mr(h.type)&&(Et=h.stateNode,cn=!1),ji(i,s,h),go(h.stateNode),Et=g,cn=k;break;case 5:zt||ai(h,s);case 6:if(g=Et,k=cn,Et=null,ji(i,s,h),Et=g,cn=k,Et!==null)if(cn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(h.stateNode)}catch(A){dt(h,s,A)}else try{Et.removeChild(h.stateNode)}catch(A){dt(h,s,A)}break;case 18:Et!==null&&(cn?(i=Et,Qv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,h.stateNode),Qs(i)):Qv(Et,h.stateNode));break;case 4:g=Et,k=cn,Et=h.stateNode.containerInfo,cn=!0,ji(i,s,h),Et=g,cn=k;break;case 0:case 11:case 14:case 15:cr(2,h,s),zt||cr(4,h,s),ji(i,s,h);break;case 1:zt||(ai(h,s),g=h.stateNode,typeof g.componentWillUnmount=="function"&&J_(h,s,g)),ji(i,s,h);break;case 21:ji(i,s,h);break;case 22:zt=(g=zt)||h.memoizedState!==null,ji(i,s,h),zt=g;break;default:ji(i,s,h)}}function ov(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Qs(i)}catch(h){dt(s,s.return,h)}}}function lv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Qs(i)}catch(h){dt(s,s.return,h)}}function ck(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new iv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new iv),s;default:throw Error(r(435,i.tag))}}function uc(i,s){var h=ck(i);s.forEach(function(g){if(!h.has(g)){h.add(g);var k=vk.bind(null,i,g);g.then(k,k)}})}function un(i,s){var h=s.deletions;if(h!==null)for(var g=0;g<h.length;g++){var k=h[g],A=i,I=s,W=I;e:for(;W!==null;){switch(W.tag){case 27:if(mr(W.type)){Et=W.stateNode,cn=!1;break e}break;case 5:Et=W.stateNode,cn=!1;break e;case 3:case 4:Et=W.stateNode.containerInfo,cn=!0;break e}W=W.return}if(Et===null)throw Error(r(160));av(A,I,k),Et=null,cn=!1,A=k.alternate,A!==null&&(A.return=null),k.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)cv(s,i),s=s.sibling}var Yn=null;function cv(i,s){var h=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:un(s,i),hn(i),g&4&&(cr(3,i,i.return),ro(3,i),cr(5,i,i.return));break;case 1:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&64&&Mi&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(h=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var k=Yn;if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),g&4){var A=h!==null?h.memoizedState:null;if(g=i.memoizedState,h===null)if(g===null)if(i.stateNode===null){e:{g=i.type,h=i.memoizedProps,k=k.ownerDocument||k;t:switch(g){case"title":A=k.getElementsByTagName("title")[0],(!A||A[Rr]||A[$t]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=k.createElement(g),k.head.insertBefore(A,k.querySelector("head > title"))),Zt(A,g,h),A[$t]=i,Lt(A),g=A;break e;case"link":var I=cy("link","href",k).get(g+(h.href||""));if(I){for(var W=0;W<I.length;W++)if(A=I[W],A.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&A.getAttribute("rel")===(h.rel==null?null:h.rel)&&A.getAttribute("title")===(h.title==null?null:h.title)&&A.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;case"meta":if(I=cy("meta","content",k).get(g+(h.content||""))){for(W=0;W<I.length;W++)if(A=I[W],A.getAttribute("content")===(h.content==null?null:""+h.content)&&A.getAttribute("name")===(h.name==null?null:h.name)&&A.getAttribute("property")===(h.property==null?null:h.property)&&A.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&A.getAttribute("charset")===(h.charSet==null?null:h.charSet)){I.splice(W,1);break t}}A=k.createElement(g),Zt(A,g,h),k.head.appendChild(A);break;default:throw Error(r(468,g))}A[$t]=i,Lt(A),g=A}i.stateNode=g}else uy(k,i.type,i.stateNode);else i.stateNode=ly(k,g,i.memoizedProps);else A!==g?(A===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):A.count--,g===null?uy(k,i.type,i.stateNode):ly(k,g,i.memoizedProps)):g===null&&i.stateNode!==null&&Kf(i,i.memoizedProps,h.memoizedProps)}break;case 27:un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),h!==null&&g&4&&Kf(i,i.memoizedProps,h.memoizedProps);break;case 5:if(un(s,i),hn(i),g&512&&(zt||h===null||ai(h,h.return)),i.flags&32){k=i.stateNode;try{Ss(k,"")}catch(Te){dt(i,i.return,Te)}}g&4&&i.stateNode!=null&&(k=i.memoizedProps,Kf(i,k,h!==null?h.memoizedProps:k)),g&1024&&(Jf=!0);break;case 6:if(un(s,i),hn(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,h=i.stateNode;try{h.nodeValue=g}catch(Te){dt(i,i.return,Te)}}break;case 3:if(kc=null,k=Yn,Yn=Cc(s.containerInfo),un(s,i),Yn=k,hn(i),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Qs(s.containerInfo)}catch(Te){dt(i,i.return,Te)}Jf&&(Jf=!1,uv(i));break;case 4:g=Yn,Yn=Cc(i.stateNode.containerInfo),un(s,i),hn(i),Yn=g;break;case 12:un(s,i),hn(i);break;case 31:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 13:un(s,i),hn(i),i.child.flags&8192&&i.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(fc=Fe()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 22:k=i.memoizedState!==null;var J=h!==null&&h.memoizedState!==null,ce=Mi,me=zt;if(Mi=ce||k,zt=me||J,un(s,i),zt=me,Mi=ce,hn(i),g&8192)e:for(s=i.stateNode,s._visibility=k?s._visibility&-2:s._visibility|1,k&&(h===null||J||Mi||zt||Vr(i)),h=null,s=i;;){if(s.tag===5||s.tag===26){if(h===null){J=h=s;try{if(A=J.stateNode,k)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{W=J.stateNode;var ve=J.memoizedProps.style,ue=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;W.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===6){if(h===null){J=s;try{J.stateNode.nodeValue=k?"":J.memoizedProps}catch(Te){dt(J,J.return,Te)}}}else if(s.tag===18){if(h===null){J=s;try{var pe=J.stateNode;k?Jv(pe,!0):Jv(J.stateNode,!1)}catch(Te){dt(J,J.return,Te)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;h===s&&(h=null),s=s.return}h===s&&(h=null),s.sibling.return=s.return,s=s.sibling}g&4&&(g=i.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,uc(i,h))));break;case 19:un(s,i),hn(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,uc(i,g)));break;case 30:break;case 21:break;default:un(s,i),hn(i)}}function hn(i){var s=i.flags;if(s&2){try{for(var h,g=i.return;g!==null;){if(tv(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var k=h.stateNode,A=Zf(i);cc(i,A,k);break;case 5:var I=h.stateNode;h.flags&32&&(Ss(I,""),h.flags&=-33);var W=Zf(i);cc(i,W,I);break;case 3:case 4:var J=h.stateNode.containerInfo,ce=Zf(i);Qf(i,ce,J);break;default:throw Error(r(161))}}catch(me){dt(i,i.return,me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function uv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;uv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Li(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)rv(i,s.alternate,s),s=s.sibling}function Vr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:cr(4,s,s.return),Vr(s);break;case 1:ai(s,s.return);var h=s.stateNode;typeof h.componentWillUnmount=="function"&&J_(s,s.return,h),Vr(s);break;case 27:go(s.stateNode);case 26:case 5:ai(s,s.return),Vr(s);break;case 22:s.memoizedState===null&&Vr(s);break;case 30:Vr(s);break;default:Vr(s)}i=i.sibling}}function Oi(i,s,h){for(h=h&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var g=s.alternate,k=i,A=s,I=A.flags;switch(A.tag){case 0:case 11:case 15:Oi(k,A,h),ro(4,A);break;case 1:if(Oi(k,A,h),g=A,k=g.stateNode,typeof k.componentDidMount=="function")try{k.componentDidMount()}catch(ce){dt(g,g.return,ce)}if(g=A,k=g.updateQueue,k!==null){var W=g.stateNode;try{var J=k.shared.hiddenCallbacks;if(J!==null)for(k.shared.hiddenCallbacks=null,k=0;k<J.length;k++)P0(J[k],W)}catch(ce){dt(g,g.return,ce)}}h&&I&64&&Q_(A),so(A,A.return);break;case 27:nv(A);case 26:case 5:Oi(k,A,h),h&&g===null&&I&4&&ev(A),so(A,A.return);break;case 12:Oi(k,A,h);break;case 31:Oi(k,A,h),h&&I&4&&ov(k,A);break;case 13:Oi(k,A,h),h&&I&4&&lv(k,A);break;case 22:A.memoizedState===null&&Oi(k,A,h),so(A,A.return);break;case 30:break;default:Oi(k,A,h)}s=s.sibling}}function ed(i,s){var h=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==h&&(i!=null&&i.refCount++,h!=null&&qa(h))}function td(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i))}function Wn(i,s,h,g){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hv(i,s,h,g),s=s.sibling}function hv(i,s,h,g){var k=s.flags;switch(s.tag){case 0:case 11:case 15:Wn(i,s,h,g),k&2048&&ro(9,s);break;case 1:Wn(i,s,h,g);break;case 3:Wn(i,s,h,g),k&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&qa(i)));break;case 12:if(k&2048){Wn(i,s,h,g),i=s.stateNode;try{var A=s.memoizedProps,I=A.id,W=A.onPostCommit;typeof W=="function"&&W(I,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(J){dt(s,s.return,J)}}else Wn(i,s,h,g);break;case 31:Wn(i,s,h,g);break;case 13:Wn(i,s,h,g);break;case 23:break;case 22:A=s.stateNode,I=s.alternate,s.memoizedState!==null?A._visibility&2?Wn(i,s,h,g):ao(i,s):A._visibility&2?Wn(i,s,h,g):(A._visibility|=2,Ps(i,s,h,g,(s.subtreeFlags&10256)!==0||!1)),k&2048&&ed(I,s);break;case 24:Wn(i,s,h,g),k&2048&&td(s.alternate,s);break;default:Wn(i,s,h,g)}}function Ps(i,s,h,g,k){for(k=k&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var A=i,I=s,W=h,J=g,ce=I.flags;switch(I.tag){case 0:case 11:case 15:Ps(A,I,W,J,k),ro(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?Ps(A,I,W,J,k):ao(A,I):(me._visibility|=2,Ps(A,I,W,J,k)),k&&ce&2048&&ed(I.alternate,I);break;case 24:Ps(A,I,W,J,k),k&&ce&2048&&td(I.alternate,I);break;default:Ps(A,I,W,J,k)}s=s.sibling}}function ao(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var h=i,g=s,k=g.flags;switch(g.tag){case 22:ao(h,g),k&2048&&ed(g.alternate,g);break;case 24:ao(h,g),k&2048&&td(g.alternate,g);break;default:ao(h,g)}s=s.sibling}}var oo=8192;function Us(i,s,h){if(i.subtreeFlags&oo)for(i=i.child;i!==null;)fv(i,s,h),i=i.sibling}function fv(i,s,h){switch(i.tag){case 26:Us(i,s,h),i.flags&oo&&i.memoizedState!==null&&Xk(h,Yn,i.memoizedState,i.memoizedProps);break;case 5:Us(i,s,h);break;case 3:case 4:var g=Yn;Yn=Cc(i.stateNode.containerInfo),Us(i,s,h),Yn=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=oo,oo=16777216,Us(i,s,h),oo=g):Us(i,s,h));break;default:Us(i,s,h)}}function dv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function lo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)pv(i),i=i.sibling}function pv(i){switch(i.tag){case 0:case 11:case 15:lo(i),i.flags&2048&&cr(9,i,i.return);break;case 3:lo(i);break;case 12:lo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,hc(i)):lo(i);break;default:lo(i)}}function hc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var h=0;h<s.length;h++){var g=s[h];Vt=g,gv(g,i)}dv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:cr(8,s,s.return),hc(s);break;case 22:h=s.stateNode,h._visibility&2&&(h._visibility&=-3,hc(s));break;default:hc(s)}i=i.sibling}}function gv(i,s){for(;Vt!==null;){var h=Vt;switch(h.tag){case 0:case 11:case 15:cr(8,h,s);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:qa(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Vt=g;else e:for(h=i;Vt!==null;){g=Vt;var k=g.sibling,A=g.return;if(sv(g),g===h){Vt=null;break e}if(k!==null){k.return=A,Vt=k;break e}Vt=A}}}var uk={getCacheForType:function(i){var s=Xt(Ot),h=s.data.get(i);return h===void 0&&(h=i(),s.data.set(i,h)),h},cacheSignal:function(){return Xt(Ot).controller.signal}},hk=typeof WeakMap=="function"?WeakMap:Map,ot=0,_t=null,Ye=null,Ke=0,ft=0,wn=null,ur=!1,$s=!1,nd=!1,Bi=0,Rt=0,hr=0,Yr=0,id=0,Cn=0,Gs=0,co=null,fn=null,rd=!1,fc=0,mv=0,dc=1/0,pc=null,fr=null,Gt=0,dr=null,qs=null,Ii=0,sd=0,ad=null,_v=null,uo=0,od=null;function En(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:q.T!==null?dd():yl()}function vv(){if(Cn===0)if((Ke&536870912)===0||Qe){var i=mi;mi<<=1,(mi&3932160)===0&&(mi=262144),Cn=i}else Cn=536870912;return i=Sn.current,i!==null&&(i.flags|=32),Cn}function dn(i,s,h){(i===_t&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),pr(i,Ke,Cn,!1)),qe(i,h),((ot&2)===0||i!==_t)&&(i===_t&&((ot&2)===0&&(Yr|=h),Rt===4&&pr(i,Ke,Cn,!1)),oi(i))}function yv(i,s,h){if((ot&6)!==0)throw Error(r(327));var g=!h&&(s&127)===0&&(s&i.expiredLanes)===0||ni(i,s),k=g?pk(i,s):cd(i,s,!0),A=g;do{if(k===0){$s&&!g&&pr(i,s,0,!1);break}else{if(h=i.current.alternate,A&&!fk(h)){k=cd(i,s,!1),A=!1;continue}if(k===2){if(A=s,i.errorRecoveryDisabledLanes&A)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){s=I;e:{var W=i;k=co;var J=W.current.memoizedState.isDehydrated;if(J&&(Vs(W,I).flags|=256),I=cd(W,I,!1),I!==2){if(nd&&!J){W.errorRecoveryDisabledLanes|=A,Yr|=A,k=4;break e}A=fn,fn=k,A!==null&&(fn===null?fn=A:fn.push.apply(fn,A))}k=I}if(A=!1,k!==2)continue}}if(k===1){Vs(i,0),pr(i,s,0,!0);break}e:{switch(g=i,A=k,A){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:pr(g,s,Cn,!ur);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(k=fc+300-Fe(),10<k)){if(pr(g,s,Cn,!ur),vi(g,0,!0)!==0)break e;Ii=s,g.timeoutHandle=Kv(bv.bind(null,g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,"Throttled",-0,0),k);break e}bv(g,h,fn,pc,rd,s,Cn,Yr,Gs,ur,A,null,-0,0)}}break}while(!0);oi(i)}function bv(i,s,h,g,k,A,I,W,J,ce,me,ve,ue,pe){if(i.timeoutHandle=-1,ve=s.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xi},fv(s,A,ve);var Te=(A&62914560)===A?fc-Fe():(A&4194048)===A?mv-Fe():0;if(Te=Kk(ve,Te),Te!==null){Ii=A,i.cancelPendingCommit=Te(Nv.bind(null,i,s,A,h,g,k,I,W,J,me,ve,null,ue,pe)),pr(i,A,I,!ce);return}}Nv(i,s,A,h,g,k,I,W,J)}function fk(i){for(var s=i;;){var h=s.tag;if((h===0||h===11||h===15)&&s.flags&16384&&(h=s.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var k=h[g],A=k.getSnapshot;k=k.value;try{if(!yn(A(),k))return!1}catch{return!1}}if(h=s.child,s.subtreeFlags&16384&&h!==null)h.return=s,s=h;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function pr(i,s,h,g){s&=~id,s&=~Yr,i.suspendedLanes|=s,i.pingedLanes&=~s,g&&(i.warmLanes|=s),g=i.expirationTimes;for(var k=s;0<k;){var A=31-st(k),I=1<<A;g[A]=-1,k&=~I}h!==0&&yi(i,h,s)}function gc(){return(ot&6)===0?(ho(0),!1):!0}function ld(){if(Ye!==null){if(ft===0)var i=Ye.return;else i=Ye,ki=zr=null,Cf(i),Bs=null,Ya=0,i=Ye;for(;i!==null;)Z_(i.alternate,i),i=i.return;Ye=null}}function Vs(i,s){var h=i.timeoutHandle;h!==-1&&(i.timeoutHandle=-1,Mk(h)),h=i.cancelPendingCommit,h!==null&&(i.cancelPendingCommit=null,h()),Ii=0,ld(),_t=i,Ye=h=Ci(i.current,null),Ke=s,ft=0,wn=null,ur=!1,$s=ni(i,s),nd=!1,Gs=Cn=id=Yr=hr=Rt=0,fn=co=null,rd=!1,(s&8)!==0&&(s|=s&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=s;0<g;){var k=31-st(g),A=1<<k;s|=i[k],g&=~A}return Bi=s,Bl(),h}function Sv(i,s){Pe=null,q.H=to,s===Os||s===Gl?(s=I0(),ft=3):s===ff?(s=I0(),ft=4):ft=s===Ff?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,wn=s,Ye===null&&(Rt=1,rc(i,In(s,i.current)))}function xv(){var i=Sn.current;return i===null?!0:(Ke&4194048)===Ke?Pn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?i===Pn:!1}function wv(){var i=q.H;return q.H=to,i===null?to:i}function Cv(){var i=q.A;return q.A=uk,i}function mc(){Rt=4,ur||(Ke&4194048)!==Ke&&Sn.current!==null||($s=!0),(hr&134217727)===0&&(Yr&134217727)===0||_t===null||pr(_t,Ke,Cn,!1)}function cd(i,s,h){var g=ot;ot|=2;var k=wv(),A=Cv();(_t!==i||Ke!==s)&&(pc=null,Vs(i,s)),s=!1;var I=Rt;e:do try{if(ft!==0&&Ye!==null){var W=Ye,J=wn;switch(ft){case 8:ld(),I=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(s=!0);var ce=ft;if(ft=0,wn=null,Ys(i,W,J,ce),h&&$s){I=0;break e}break;default:ce=ft,ft=0,wn=null,Ys(i,W,J,ce)}}dk(),I=Rt;break}catch(me){Sv(i,me)}while(!0);return s&&i.shellSuspendCounter++,ki=zr=null,ot=g,q.H=k,q.A=A,Ye===null&&(_t=null,Ke=0,Bl()),I}function dk(){for(;Ye!==null;)Ev(Ye)}function pk(i,s){var h=ot;ot|=2;var g=wv(),k=Cv();_t!==i||Ke!==s?(pc=null,dc=Fe()+500,Vs(i,s)):$s=ni(i,s);e:do try{if(ft!==0&&Ye!==null){s=Ye;var A=wn;t:switch(ft){case 1:ft=0,wn=null,Ys(i,s,A,1);break;case 2:case 9:if(O0(A)){ft=0,wn=null,kv(s);break}s=function(){ft!==2&&ft!==9||_t!==i||(ft=7),oi(i)},A.then(s,s);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:O0(A)?(ft=0,wn=null,kv(s)):(ft=0,wn=null,Ys(i,s,A,7));break;case 5:var I=null;switch(Ye.tag){case 26:I=Ye.memoizedState;case 5:case 27:var W=Ye;if(I?hy(I):W.stateNode.complete){ft=0,wn=null;var J=W.sibling;if(J!==null)Ye=J;else{var ce=W.return;ce!==null?(Ye=ce,_c(ce)):Ye=null}break t}}ft=0,wn=null,Ys(i,s,A,5);break;case 6:ft=0,wn=null,Ys(i,s,A,6);break;case 8:ld(),Rt=6;break e;default:throw Error(r(462))}}gk();break}catch(me){Sv(i,me)}while(!0);return ki=zr=null,q.H=g,q.A=k,ot=h,Ye!==null?0:(_t=null,Ke=0,Bl(),Rt)}function gk(){for(;Ye!==null&&!Pt();)Ev(Ye)}function Ev(i){var s=X_(i.alternate,i,Bi);i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function kv(i){var s=i,h=s.alternate;switch(s.tag){case 15:case 0:s=$_(h,s,s.pendingProps,s.type,void 0,Ke);break;case 11:s=$_(h,s,s.pendingProps,s.type.render,s.ref,Ke);break;case 5:Cf(s);default:Z_(h,s),s=Ye=C0(s,Bi),s=X_(h,s,Bi)}i.memoizedProps=i.pendingProps,s===null?_c(i):Ye=s}function Ys(i,s,h,g){ki=zr=null,Cf(s),Bs=null,Ya=0;var k=s.return;try{if(ik(i,k,s,h,Ke)){Rt=1,rc(i,In(h,i.current)),Ye=null;return}}catch(A){if(k!==null)throw Ye=k,A;Rt=1,rc(i,In(h,i.current)),Ye=null;return}s.flags&32768?(Qe||g===1?i=!0:$s||(Ke&536870912)!==0?i=!1:(ur=i=!0,(g===2||g===9||g===3||g===6)&&(g=Sn.current,g!==null&&g.tag===13&&(g.flags|=16384))),Av(s,i)):_c(s)}function _c(i){var s=i;do{if((s.flags&32768)!==0){Av(s,ur);return}i=s.return;var h=ak(s.alternate,s,Bi);if(h!==null){Ye=h;return}if(s=s.sibling,s!==null){Ye=s;return}Ye=s=i}while(s!==null);Rt===0&&(Rt=5)}function Av(i,s){do{var h=ok(i.alternate,i);if(h!==null){h.flags&=32767,Ye=h;return}if(h=i.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!s&&(i=i.sibling,i!==null)){Ye=i;return}Ye=i=h}while(i!==null);Rt=6,Ye=null}function Nv(i,s,h,g,k,A,I,W,J){i.cancelPendingCommit=null;do vc();while(Gt!==0);if((ot&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(A=s.lanes|s.childLanes,A|=Kh,at(i,h,A,I,W,J),i===_t&&(Ye=_t=null,Ke=0),qs=s,dr=i,Ii=h,sd=A,ad=k,_v=g,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,yk(Se,function(){return jv(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||g){g=q.T,q.T=null,k=X.p,X.p=2,I=ot,ot|=4;try{lk(i,s,h)}finally{ot=I,X.p=k,q.T=g}}Gt=1,Tv(),Rv(),Dv()}}function Tv(){if(Gt===1){Gt=0;var i=dr,s=qs,h=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||h){h=q.T,q.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{cv(s,i);var A=Sd,I=g0(i.containerInfo),W=A.focusedElem,J=A.selectionRange;if(I!==W&&W&&W.ownerDocument&&p0(W.ownerDocument.documentElement,W)){if(J!==null&&qh(W)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in W)W.selectionStart=ce,W.selectionEnd=Math.min(me,W.value.length);else{var ve=W.ownerDocument||document,ue=ve&&ve.defaultView||window;if(ue.getSelection){var pe=ue.getSelection(),Te=W.textContent.length,Be=Math.min(J.start,Te),mt=J.end===void 0?Be:Math.min(J.end,Te);!pe.extend&&Be>mt&&(I=mt,mt=Be,Be=I);var se=d0(W,Be),te=d0(W,mt);if(se&&te&&(pe.rangeCount!==1||pe.anchorNode!==se.node||pe.anchorOffset!==se.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var le=ve.createRange();le.setStart(se.node,se.offset),pe.removeAllRanges(),Be>mt?(pe.addRange(le),pe.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),pe.addRange(le))}}}}for(ve=[],pe=W;pe=pe.parentNode;)pe.nodeType===1&&ve.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<ve.length;W++){var _e=ve[W];_e.element.scrollLeft=_e.left,_e.element.scrollTop=_e.top}}Rc=!!bd,Sd=bd=null}finally{ot=k,X.p=g,q.T=h}}i.current=s,Gt=2}}function Rv(){if(Gt===2){Gt=0;var i=dr,s=qs,h=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||h){h=q.T,q.T=null;var g=X.p;X.p=2;var k=ot;ot|=4;try{rv(i,s.alternate,s)}finally{ot=k,X.p=g,q.T=h}}Gt=3}}function Dv(){if(Gt===4||Gt===3){Gt=0,ht();var i=dr,s=qs,h=Ii,g=_v;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gt=5:(Gt=0,qs=dr=null,Mv(i,i.pendingLanes));var k=i.pendingLanes;if(k===0&&(fr=null),Aa(h),s=s.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Nt,s,void 0,(s.current.flags&128)===128)}catch{}if(g!==null){s=q.T,k=X.p,X.p=2,q.T=null;try{for(var A=i.onRecoverableError,I=0;I<g.length;I++){var W=g[I];A(W.value,{componentStack:W.stack})}}finally{q.T=s,X.p=k}}(Ii&3)!==0&&vc(),oi(i),k=i.pendingLanes,(h&261930)!==0&&(k&42)!==0?i===od?uo++:(uo=0,od=i):uo=0,ho(0)}}function Mv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,qa(s)))}function vc(){return Tv(),Rv(),Dv(),jv()}function jv(){if(Gt!==5)return!1;var i=dr,s=sd;sd=0;var h=Aa(Ii),g=q.T,k=X.p;try{X.p=32>h?32:h,q.T=null,h=ad,ad=null;var A=dr,I=Ii;if(Gt=0,qs=dr=null,Ii=0,(ot&6)!==0)throw Error(r(331));var W=ot;if(ot|=4,pv(A.current),hv(A,A.current,I,h),ot=W,ho(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Nt,A)}catch{}return!0}finally{X.p=k,q.T=g,Mv(i,s)}}function Lv(i,s,h){s=In(h,s),s=Hf(i.stateNode,s,2),i=ar(i,s,2),i!==null&&(qe(i,2),oi(i))}function dt(i,s,h){if(i.tag===3)Lv(i,i,h);else for(;s!==null;){if(s.tag===3){Lv(s,i,h);break}else if(s.tag===1){var g=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(fr===null||!fr.has(g))){i=In(h,i),h=O_(2),g=ar(s,h,2),g!==null&&(B_(h,g,s,i),qe(g,2),oi(g));break}}s=s.return}}function ud(i,s,h){var g=i.pingCache;if(g===null){g=i.pingCache=new hk;var k=new Set;g.set(s,k)}else k=g.get(s),k===void 0&&(k=new Set,g.set(s,k));k.has(h)||(nd=!0,k.add(h),i=mk.bind(null,i,s,h),s.then(i,i))}function mk(i,s,h){var g=i.pingCache;g!==null&&g.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,_t===i&&(Ke&h)===h&&(Rt===4||Rt===3&&(Ke&62914560)===Ke&&300>Fe()-fc?(ot&2)===0&&Vs(i,0):id|=h,Gs===Ke&&(Gs=0)),oi(i)}function Ov(i,s){s===0&&(s=we()),i=Or(i,s),i!==null&&(qe(i,s),oi(i))}function _k(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),Ov(i,h)}function vk(i,s){var h=0;switch(i.tag){case 31:case 13:var g=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(s),Ov(i,h)}function yk(i,s){return Ge(i,s)}var yc=null,Ws=null,hd=!1,bc=!1,fd=!1,gr=0;function oi(i){i!==Ws&&i.next===null&&(Ws===null?yc=Ws=i:Ws=Ws.next=i),bc=!0,hd||(hd=!0,Sk())}function ho(i,s){if(!fd&&bc){fd=!0;do for(var h=!1,g=yc;g!==null;){if(i!==0){var k=g.pendingLanes;if(k===0)var A=0;else{var I=g.suspendedLanes,W=g.pingedLanes;A=(1<<31-st(42|i)+1)-1,A&=k&~(I&~W),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Hv(g,A))}else A=Ke,A=vi(g,g===_t?A:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(A&3)===0||ni(g,A)||(h=!0,Hv(g,A));g=g.next}while(h);fd=!1}}function bk(){Bv()}function Bv(){bc=hd=!1;var i=0;gr!==0&&Dk()&&(i=gr);for(var s=Fe(),h=null,g=yc;g!==null;){var k=g.next,A=Iv(g,s);A===0?(g.next=null,h===null?yc=k:h.next=k,k===null&&(Ws=h)):(h=g,(i!==0||(A&3)!==0)&&(bc=!0)),g=k}Gt!==0&&Gt!==5||ho(i),gr!==0&&(gr=0)}function Iv(i,s){for(var h=i.suspendedLanes,g=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0<A;){var I=31-st(A),W=1<<I,J=k[I];J===-1?((W&h)===0||(W&g)!==0)&&(k[I]=oe(W,s)):J<=s&&(i.expiredLanes|=W),A&=~W}if(s=_t,h=Ke,h=vi(i,i===s?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,h===0||i===s&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&ct(g),i.callbackNode=null,i.callbackPriority=0;if((h&3)===0||ni(i,h)){if(s=h&-h,s===i.callbackPriority)return s;switch(g!==null&&ct(g),Aa(h)){case 2:case 8:h=de;break;case 32:h=Se;break;case 268435456:h=De;break;default:h=Se}return g=zv.bind(null,i),h=Ge(h,g),i.callbackPriority=s,i.callbackNode=h,s}return g!==null&&g!==null&&ct(g),i.callbackPriority=2,i.callbackNode=null,2}function zv(i,s){if(Gt!==0&&Gt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var h=i.callbackNode;if(vc()&&i.callbackNode!==h)return null;var g=Ke;return g=vi(i,i===_t?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(yv(i,g,s),Iv(i,Fe()),i.callbackNode!=null&&i.callbackNode===h?zv.bind(null,i):null)}function Hv(i,s){if(vc())return null;yv(i,s,!0)}function Sk(){jk(function(){(ot&6)!==0?Ge(ie,bk):Bv()})}function dd(){if(gr===0){var i=js;i===0&&(i=gi,gi<<=1,(gi&261888)===0&&(gi=256)),gr=i}return gr}function Fv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Nl(""+i)}function Pv(i,s){var h=s.ownerDocument.createElement("input");return h.name=s.name,h.value=s.value,i.id&&h.setAttribute("form",i.id),s.parentNode.insertBefore(h,s),i=new FormData(i),h.parentNode.removeChild(h),i}function xk(i,s,h,g,k){if(s==="submit"&&h&&h.stateNode===k){var A=Fv((k[Qt]||null).action),I=g.submitter;I&&(s=(s=I[Qt]||null)?Fv(s.formAction):I.getAttribute("formAction"),s!==null&&(A=s,I=null));var W=new Ml("action","action",null,g,k);i.push({event:W,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(gr!==0){var J=I?Pv(k,I):new FormData(k);jf(h,{pending:!0,data:J,method:k.method,action:A},null,J)}}else typeof A=="function"&&(W.preventDefault(),J=I?Pv(k,I):new FormData(k),jf(h,{pending:!0,data:J,method:k.method,action:A},A,J))},currentTarget:k}]})}}for(var pd=0;pd<Xh.length;pd++){var gd=Xh[pd],wk=gd.toLowerCase(),Ck=gd[0].toUpperCase()+gd.slice(1);Vn(wk,"on"+Ck)}Vn(v0,"onAnimationEnd"),Vn(y0,"onAnimationIteration"),Vn(b0,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(FE,"onTransitionRun"),Vn(PE,"onTransitionStart"),Vn(UE,"onTransitionCancel"),Vn(S0,"onTransitionEnd"),Zi("onMouseEnter",["mouseout","mouseover"]),Zi("onMouseLeave",["mouseout","mouseover"]),Zi("onPointerEnter",["pointerout","pointerover"]),Zi("onPointerLeave",["pointerout","pointerover"]),Si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Si("onBeforeInput",["compositionend","keypress","textInput","paste"]),Si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ek=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function Uv(i,s){s=(s&4)!==0;for(var h=0;h<i.length;h++){var g=i[h],k=g.event;g=g.listeners;e:{var A=void 0;if(s)for(var I=g.length-1;0<=I;I--){var W=g[I],J=W.instance,ce=W.currentTarget;if(W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}else for(I=0;I<g.length;I++){if(W=g[I],J=W.instance,ce=W.currentTarget,W=W.listener,J!==A&&k.isPropagationStopped())break e;A=W,k.currentTarget=ce;try{A(k)}catch(me){Ol(me)}k.currentTarget=null,A=J}}}}function We(i,s){var h=s[ms];h===void 0&&(h=s[ms]=new Set);var g=i+"__bubble";h.has(g)||($v(s,i,2,!1),h.add(g))}function md(i,s,h){var g=0;s&&(g|=4),$v(h,i,g,s)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function _d(i){if(!i[Sc]){i[Sc]=!0,wl.forEach(function(h){h!=="selectionchange"&&(Ek.has(h)||md(h,!1,i),md(h,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Sc]||(s[Sc]=!0,md("selectionchange",!1,s))}}function $v(i,s,h,g){switch(vy(s)){case 2:var k=Jk;break;case 8:k=eA;break;default:k=Md}h=k.bind(null,s,h,i),k=void 0,!Bh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(k=!0),g?k!==void 0?i.addEventListener(s,h,{capture:!0,passive:k}):i.addEventListener(s,h,!0):k!==void 0?i.addEventListener(s,h,{passive:k}):i.addEventListener(s,h,!1)}function vd(i,s,h,g,k){var A=g;if((s&1)===0&&(s&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var W=g.stateNode.containerInfo;if(W===k)break;if(I===4)for(I=g.return;I!==null;){var J=I.tag;if((J===3||J===4)&&I.stateNode.containerInfo===k)return;I=I.return}for(;W!==null;){if(I=Yi(W),I===null)return;if(J=I.tag,J===5||J===6||J===26||J===27){g=A=I;continue e}W=W.parentNode}}g=g.return}Wm(function(){var ce=A,me=Lh(h),ve=[];e:{var ue=x0.get(i);if(ue!==void 0){var pe=Ml,Te=i;switch(i){case"keypress":if(Rl(h)===0)break e;case"keydown":case"keyup":pe=vE;break;case"focusin":Te="focus",pe=Fh;break;case"focusout":Te="blur",pe=Fh;break;case"beforeblur":case"afterblur":pe=Fh;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=aE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=SE;break;case v0:case y0:case b0:pe=cE;break;case S0:pe=wE;break;case"scroll":case"scrollend":pe=rE;break;case"wheel":pe=EE;break;case"copy":case"cut":case"paste":pe=hE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Jm;break;case"toggle":case"beforetoggle":pe=AE}var Be=(s&4)!==0,mt=!Be&&(i==="scroll"||i==="scrollend"),se=Be?ue!==null?ue+"Capture":null:ue;Be=[];for(var te=ce,le;te!==null;){var _e=te;if(le=_e.stateNode,_e=_e.tag,_e!==5&&_e!==26&&_e!==27||le===null||se===null||(_e=La(te,se),_e!=null&&Be.push(po(te,_e,le))),mt)break;te=te.return}0<Be.length&&(ue=new pe(ue,Te,null,h,me),ve.push({event:ue,listeners:Be}))}}if((s&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",pe=i==="mouseout"||i==="pointerout",ue&&h!==jh&&(Te=h.relatedTarget||h.fromElement)&&(Yi(Te)||Te[bi]))break e;if((pe||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,pe?(Te=h.relatedTarget||h.toElement,pe=ce,Te=Te?Yi(Te):null,Te!==null&&(mt=l(Te),Be=Te.tag,Te!==mt||Be!==5&&Be!==27&&Be!==6)&&(Te=null)):(pe=null,Te=ce),pe!==Te)){if(Be=Zm,_e="onMouseLeave",se="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(Be=Jm,_e="onPointerLeave",se="onPointerEnter",te="pointer"),mt=pe==null?ue:Xi(pe),le=Te==null?ue:Xi(Te),ue=new Be(_e,te+"leave",pe,h,me),ue.target=mt,ue.relatedTarget=le,_e=null,Yi(me)===ce&&(Be=new Be(se,te+"enter",Te,h,me),Be.target=le,Be.relatedTarget=mt,_e=Be),mt=_e,pe&&Te)t:{for(Be=kk,se=pe,te=Te,le=0,_e=se;_e;_e=Be(_e))le++;_e=0;for(var Le=te;Le;Le=Be(Le))_e++;for(;0<le-_e;)se=Be(se),le--;for(;0<_e-le;)te=Be(te),_e--;for(;le--;){if(se===te||te!==null&&se===te.alternate){Be=se;break t}se=Be(se),te=Be(te)}Be=null}else Be=null;pe!==null&&Gv(ve,ue,pe,Be,!1),Te!==null&&mt!==null&&Gv(ve,mt,Te,Be,!0)}}e:{if(ue=ce?Xi(ce):window,pe=ue.nodeName&&ue.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ue.type==="file")var nt=o0;else if(s0(ue))if(l0)nt=IE;else{nt=OE;var Re=LE}else pe=ue.nodeName,!pe||pe.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Mh(ce.elementType)&&(nt=o0):nt=BE;if(nt&&(nt=nt(i,ce))){a0(ve,nt,h,me);break e}Re&&Re(i,ue,ce),i==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Ma(ue,"number",ue.value)}switch(Re=ce?Xi(ce):window,i){case"focusin":(s0(Re)||Re.contentEditable==="true")&&(Es=Re,Vh=ce,Ua=null);break;case"focusout":Ua=Vh=Es=null;break;case"mousedown":Yh=!0;break;case"contextmenu":case"mouseup":case"dragend":Yh=!1,m0(ve,h,me);break;case"selectionchange":if(HE)break;case"keydown":case"keyup":m0(ve,h,me)}var Ue;if(Uh)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Cs?i0(i,h)&&(Ze="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(Ze="onCompositionStart");Ze&&(e0&&h.locale!=="ko"&&(Cs||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Cs&&(Ue=Xm()):(Ji=me,Ih="value"in Ji?Ji.value:Ji.textContent,Cs=!0)),Re=xc(ce,Ze),0<Re.length&&(Ze=new Qm(Ze,i,null,h,me),ve.push({event:Ze,listeners:Re}),Ue?Ze.data=Ue:(Ue=r0(h),Ue!==null&&(Ze.data=Ue)))),(Ue=TE?RE(i,h):DE(i,h))&&(Ze=xc(ce,"onBeforeInput"),0<Ze.length&&(Re=new Qm("onBeforeInput","beforeinput",null,h,me),ve.push({event:Re,listeners:Ze}),Re.data=Ue)),xk(ve,i,ce,h,me)}Uv(ve,s)})}function po(i,s,h){return{instance:i,listener:s,currentTarget:h}}function xc(i,s){for(var h=s+"Capture",g=[];i!==null;){var k=i,A=k.stateNode;if(k=k.tag,k!==5&&k!==26&&k!==27||A===null||(k=La(i,h),k!=null&&g.unshift(po(i,k,A)),k=La(i,s),k!=null&&g.push(po(i,k,A))),i.tag===3)return g;i=i.return}return[]}function kk(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gv(i,s,h,g,k){for(var A=s._reactName,I=[];h!==null&&h!==g;){var W=h,J=W.alternate,ce=W.stateNode;if(W=W.tag,J!==null&&J===g)break;W!==5&&W!==26&&W!==27||ce===null||(J=ce,k?(ce=La(h,A),ce!=null&&I.unshift(po(h,ce,J))):k||(ce=La(h,A),ce!=null&&I.push(po(h,ce,J)))),h=h.return}I.length!==0&&i.push({event:s,listeners:I})}var Ak=/\r\n?/g,Nk=/\u0000|\uFFFD/g;function qv(i){return(typeof i=="string"?i:""+i).replace(Ak,` -`).replace(Nk,"")}function Vv(i,s){return s=qv(s),qv(i)===s}function gt(i,s,h,g,k,A){switch(h){case"children":typeof g=="string"?s==="body"||s==="textarea"&&g===""||Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&s!=="body"&&Ss(i,""+g);break;case"className":vs(i,"class",g);break;case"tabIndex":vs(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,h,g);break;case"style":Vm(i,g,A);break;case"data":if(s!=="object"){vs(i,"data",g);break}case"src":case"href":if(g===""&&(s!=="a"||h!=="href")){i.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(h==="formAction"?(s!=="input"&>(i,s,"name",k.name,k,null),gt(i,s,"formEncType",k.formEncType,k,null),gt(i,s,"formMethod",k.formMethod,k,null),gt(i,s,"formTarget",k.formTarget,k,null)):(gt(i,s,"encType",k.encType,k,null),gt(i,s,"method",k.method,k,null),gt(i,s,"target",k.target,k,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(h);break}g=Nl(""+g),i.setAttribute(h,g);break;case"onClick":g!=null&&(i.onclick=xi);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}h=Nl(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""+g):i.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,""):i.removeAttribute(h);break;case"capture":case"download":g===!0?i.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(h,g):i.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(h,g):i.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(h):i.setAttribute(h,g);break;case"popover":We("beforetoggle",i),We("toggle",i),_s(i,"popover",g);break;case"xlinkActuate":qn(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":qn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":qn(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":qn(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":qn(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":qn(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":qn(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":qn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":qn(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":_s(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=nE.get(h)||h,_s(i,h,g))}}function yd(i,s,h,g,k,A){switch(h){case"style":Vm(i,g,A);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(k.children!=null)throw Error(r(60));i.innerHTML=h}}break;case"children":typeof g=="string"?Ss(i,g):(typeof g=="number"||typeof g=="bigint")&&Ss(i,""+g);break;case"onScroll":g!=null&&We("scroll",i);break;case"onScrollEnd":g!=null&&We("scrollend",i);break;case"onClick":g!=null&&(i.onclick=xi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cl.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(k=h.endsWith("Capture"),s=h.slice(2,k?h.length-7:void 0),A=i[Qt]||null,A=A!=null?A[h]:null,typeof A=="function"&&i.removeEventListener(s,A,k),typeof g=="function")){typeof A!="function"&&A!==null&&(h in i?i[h]=null:i.hasAttribute(h)&&i.removeAttribute(h)),i.addEventListener(s,g,k);break e}h in i?i[h]=g:g===!0?i.setAttribute(h,""):_s(i,h,g)}}}function Zt(i,s,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",i),We("load",i);var g=!1,k=!1,A;for(A in h)if(h.hasOwnProperty(A)){var I=h[A];if(I!=null)switch(A){case"src":g=!0;break;case"srcSet":k=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,A,I,h,null)}}k&>(i,s,"srcSet",h.srcSet,h,null),g&>(i,s,"src",h.src,h,null);return;case"input":We("invalid",i);var W=A=I=k=null,J=null,ce=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":k=me;break;case"type":I=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":A=me;break;case"defaultValue":W=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:gt(i,s,g,me,h,null)}}bs(i,A,W,J,ce,I,k,!1);return;case"select":We("invalid",i),g=I=A=null;for(k in h)if(h.hasOwnProperty(k)&&(W=h[k],W!=null))switch(k){case"value":A=W;break;case"defaultValue":I=W;break;case"multiple":g=W;default:gt(i,s,k,W,h,null)}s=A,h=I,i.multiple=!!g,s!=null?Qi(i,!!g,s,!1):h!=null&&Qi(i,!!g,h,!0);return;case"textarea":We("invalid",i),A=k=g=null;for(I in h)if(h.hasOwnProperty(I)&&(W=h[I],W!=null))switch(I){case"value":g=W;break;case"defaultValue":k=W;break;case"children":A=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:gt(i,s,I,W,h,null)}Gm(i,g,k,A);return;case"option":for(J in h)if(h.hasOwnProperty(J)&&(g=h[J],g!=null))switch(J){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:gt(i,s,J,g,h,null)}return;case"dialog":We("beforetoggle",i),We("toggle",i),We("cancel",i),We("close",i);break;case"iframe":case"object":We("load",i);break;case"video":case"audio":for(g=0;g<fo.length;g++)We(fo[g],i);break;case"image":We("error",i),We("load",i);break;case"details":We("toggle",i);break;case"embed":case"source":case"link":We("error",i),We("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in h)if(h.hasOwnProperty(ce)&&(g=h[ce],g!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:gt(i,s,ce,g,h,null)}return;default:if(Mh(s)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&yd(i,s,me,g,h,void 0));return}}for(W in h)h.hasOwnProperty(W)&&(g=h[W],g!=null&>(i,s,W,g,h,null))}function Tk(i,s,h,g){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var k=null,A=null,I=null,W=null,J=null,ce=null,me=null;for(pe in h){var ve=h[pe];if(h.hasOwnProperty(pe)&&ve!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":J=ve;default:g.hasOwnProperty(pe)||gt(i,s,pe,null,g,ve)}}for(var ue in g){var pe=g[ue];if(ve=h[ue],g.hasOwnProperty(ue)&&(pe!=null||ve!=null))switch(ue){case"type":A=pe;break;case"name":k=pe;break;case"checked":ce=pe;break;case"defaultChecked":me=pe;break;case"value":I=pe;break;case"defaultValue":W=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,s));break;default:pe!==ve&>(i,s,ue,pe,g,ve)}}Da(i,I,W,J,ce,me,A,k);return;case"select":pe=I=W=ue=null;for(A in h)if(J=h[A],h.hasOwnProperty(A)&&J!=null)switch(A){case"value":break;case"multiple":pe=J;default:g.hasOwnProperty(A)||gt(i,s,A,null,g,J)}for(k in g)if(A=g[k],J=h[k],g.hasOwnProperty(k)&&(A!=null||J!=null))switch(k){case"value":ue=A;break;case"defaultValue":W=A;break;case"multiple":I=A;default:A!==J&>(i,s,k,A,g,J)}s=W,h=I,g=pe,ue!=null?Qi(i,!!h,ue,!1):!!g!=!!h&&(s!=null?Qi(i,!!h,s,!0):Qi(i,!!h,h?[]:"",!1));return;case"textarea":pe=ue=null;for(W in h)if(k=h[W],h.hasOwnProperty(W)&&k!=null&&!g.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:gt(i,s,W,null,g,k)}for(I in g)if(k=g[I],A=h[I],g.hasOwnProperty(I)&&(k!=null||A!=null))switch(I){case"value":ue=k;break;case"defaultValue":pe=k;break;case"children":break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:k!==A&>(i,s,I,k,g,A)}ja(i,ue,pe);return;case"option":for(var Te in h)if(ue=h[Te],h.hasOwnProperty(Te)&&ue!=null&&!g.hasOwnProperty(Te))switch(Te){case"selected":i.selected=!1;break;default:gt(i,s,Te,null,g,ue)}for(J in g)if(ue=g[J],pe=h[J],g.hasOwnProperty(J)&&ue!==pe&&(ue!=null||pe!=null))switch(J){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:gt(i,s,J,ue,g,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in h)ue=h[Be],h.hasOwnProperty(Be)&&ue!=null&&!g.hasOwnProperty(Be)&>(i,s,Be,null,g,ue);for(ce in g)if(ue=g[ce],pe=h[ce],g.hasOwnProperty(ce)&&ue!==pe&&(ue!=null||pe!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:gt(i,s,ce,ue,g,pe)}return;default:if(Mh(s)){for(var mt in h)ue=h[mt],h.hasOwnProperty(mt)&&ue!==void 0&&!g.hasOwnProperty(mt)&&yd(i,s,mt,void 0,g,ue);for(me in g)ue=g[me],pe=h[me],!g.hasOwnProperty(me)||ue===pe||ue===void 0&&pe===void 0||yd(i,s,me,ue,g,pe);return}}for(var se in h)ue=h[se],h.hasOwnProperty(se)&&ue!=null&&!g.hasOwnProperty(se)&>(i,s,se,null,g,ue);for(ve in g)ue=g[ve],pe=h[ve],!g.hasOwnProperty(ve)||ue===pe||ue==null&&pe==null||gt(i,s,ve,ue,g,pe)}function Yv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rk(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var k=h[g],A=k.transferSize,I=k.initiatorType,W=k.duration;if(A&&W&&Yv(I)){for(I=0,W=k.responseEnd,g+=1;g<h.length;g++){var J=h[g],ce=J.startTime;if(ce>W)break;var me=J.transferSize,ve=J.initiatorType;me&&Yv(ve)&&(J=J.responseEnd,I+=me*(J<W?1:(W-ce)/(J-ce)))}if(--g,s+=8*(A+I)/(k.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var bd=null,Sd=null;function wc(i){return i.nodeType===9?i:i.ownerDocument}function Wv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function xd(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wd=null;function Dk(){var i=window.event;return i&&i.type==="popstate"?i===wd?!1:(wd=i,!0):(wd=null,!1)}var Kv=typeof setTimeout=="function"?setTimeout:void 0,Mk=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,jk=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(i){return Zv.resolve(null).then(i).catch(Lk)}:Kv;function Lk(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Qv(i,s){var h=s,g=0;do{var k=h.nextSibling;if(i.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"||h==="/&"){if(g===0){i.removeChild(k),Qs(s);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")go(i.ownerDocument.documentElement);else if(h==="head"){h=i.ownerDocument.head,go(h);for(var A=h.firstChild;A;){var I=A.nextSibling,W=A.nodeName;A[Rr]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&A.rel.toLowerCase()==="stylesheet"||h.removeChild(A),A=I}}else h==="body"&&go(i.ownerDocument.body);h=k}while(h);Qs(s)}function Jv(i,s){var h=i;i=0;do{var g=h.nextSibling;if(h.nodeType===1?s?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(s?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(i===0)break;i--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||i++;h=g}while(h)}function Cd(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var h=s;switch(s=s.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Cd(h),Na(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}i.removeChild(h)}}function Ok(i,s,h,g){for(;i.nodeType===1;){var k=h;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Rr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(A=i.getAttribute("rel"),A==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(A!==k.rel||i.getAttribute("href")!==(k.href==null||k.href===""?null:k.href)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin)||i.getAttribute("title")!==(k.title==null?null:k.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(A=i.getAttribute("src"),(A!==(k.src==null?null:k.src)||i.getAttribute("type")!==(k.type==null?null:k.type)||i.getAttribute("crossorigin")!==(k.crossOrigin==null?null:k.crossOrigin))&&A&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var A=k.name==null?null:""+k.name;if(k.type==="hidden"&&i.getAttribute("name")===A)return i}else return i;if(i=Un(i.nextSibling),i===null)break}return null}function Bk(i,s,h){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!h||(i=Un(i.nextSibling),i===null))return null;return i}function ey(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Un(i.nextSibling),i===null))return null;return i}function Ed(i){return i.data==="$?"||i.data==="$~"}function kd(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Ik(i,s){var h=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||h.readyState!=="loading")s();else{var g=function(){s(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Un(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Ad=null;function ty(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"||h==="/&"){if(s===0)return Un(i.nextSibling);s--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||s++}i=i.nextSibling}return null}function ny(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(s===0)return i;s--}else h!=="/$"&&h!=="/&"||s++}i=i.previousSibling}return null}function iy(i,s,h){switch(s=wc(h),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function go(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Na(i)}var $n=new Map,ry=new Set;function Cc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var zi=X.d;X.d={f:zk,r:Hk,D:Fk,C:Pk,L:Uk,m:$k,X:qk,S:Gk,M:Vk};function zk(){var i=zi.f(),s=gc();return i||s}function Hk(i){var s=Wi(i);s!==null&&s.tag===5&&s.type==="form"?S_(s):zi.r(i)}var Xs=typeof document>"u"?null:document;function sy(i,s,h){var g=Xs;if(g&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),ry.has(k)||(ry.add(k),i={rel:i,crossOrigin:h,href:s},g.querySelector(k)===null&&(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function Fk(i){zi.D(i),sy("dns-prefetch",i,null)}function Pk(i,s){zi.C(i,s),sy("preconnect",i,s)}function Uk(i,s,h){zi.L(i,s,h);var g=Xs;if(g&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=Ks(i);break;case"script":A=Zs(i)}$n.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),$n.set(A,i),g.querySelector(k)!==null||s==="style"&&g.querySelector(mo(A))||s==="script"&&g.querySelector(_o(A))||(s=g.createElement("link"),Zt(s,"link",i),Lt(s),g.head.appendChild(s)))}}function $k(i,s){zi.m(i,s);var h=Xs;if(h&&i){var g=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(g)+'"][href="'+on(i)+'"]',A=k;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Zs(i)}if(!$n.has(A)&&(i=d({rel:"modulepreload",href:i},s),$n.set(A,i),h.querySelector(k)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(_o(A)))return}g=h.createElement("link"),Zt(g,"link",i),Lt(g),h.head.appendChild(g)}}}function Gk(i,s,h){zi.S(i,s,h);var g=Xs;if(g&&i){var k=Ki(g).hoistableStyles,A=Ks(i);s=s||"default";var I=k.get(A);if(!I){var W={loading:0,preload:null};if(I=g.querySelector(mo(A)))W.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=$n.get(A))&&Nd(i,h);var J=I=g.createElement("link");Lt(J),Zt(J,"link",i),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){W.loading|=1}),J.addEventListener("error",function(){W.loading|=2}),W.loading|=4,Ec(I,s,g)}I={type:"stylesheet",instance:I,count:1,state:W},k.set(A,I)}}}function qk(i,s){zi.X(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function Vk(i,s){zi.M(i,s);var h=Xs;if(h&&i){var g=Ki(h).hoistableScripts,k=Zs(i),A=g.get(k);A||(A=h.querySelector(_o(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=$n.get(k))&&Td(i,s),A=h.createElement("script"),Lt(A),Zt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},g.set(k,A))}}function ay(i,s,h,g){var k=(k=ae.current)?Cc(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=Ks(h.href),h=Ki(k).hoistableStyles,g=h.get(s),g||(g={type:"style",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=Ks(h.href);var A=Ki(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(mo(i)))&&!A._p&&(I.instance=A,I.state.loading=5),$n.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},$n.set(i,h),A||Yk(k,i,h,I.state))),s&&g===null)throw Error(r(528,""));return I}if(s&&g!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Zs(h),h=Ki(k).hoistableScripts,g=h.get(s),g||(g={type:"script",instance:null,count:0,state:null},h.set(s,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+on(i)+'"'}function mo(i){return'link[rel="stylesheet"]['+i+"]"}function oy(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function Yk(i,s,h,g){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?g.loading=1:(s=i.createElement("link"),g.preload=s,s.addEventListener("load",function(){return g.loading|=1}),s.addEventListener("error",function(){return g.loading|=2}),Zt(s,"link",h),Lt(s),i.head.appendChild(s))}function Zs(i){return'[src="'+on(i)+'"]'}function _o(i){return"script[async]"+i}function ly(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var g=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(g)return s.instance=g,Lt(g),g;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Lt(g),Zt(g,"style",k),Ec(g,h.precedence,i),s.instance=g;case"stylesheet":k=Ks(h.href);var A=i.querySelector(mo(k));if(A)return s.state.loading|=4,s.instance=A,Lt(A),A;g=oy(h),(k=$n.get(k))&&Nd(g,k),A=(i.ownerDocument||i).createElement("link"),Lt(A);var I=A;return I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),s.state.loading|=4,Ec(A,h.precedence,i),s.instance=A;case"script":return A=Zs(h.src),(k=i.querySelector(_o(A)))?(s.instance=k,Lt(k),k):(g=h,(k=$n.get(A))&&(g=d({},h),Td(g,k)),i=i.ownerDocument||i,k=i.createElement("script"),Lt(k),Zt(k,"link",g),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(g=s.instance,s.state.loading|=4,Ec(g,h.precedence,i));return s.instance}function Ec(i,s,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=g.length?g[g.length-1]:null,A=k,I=0;I<g.length;I++){var W=g[I];if(W.dataset.precedence===s)A=W;else if(A!==k)break}A?A.parentNode.insertBefore(i,A.nextSibling):(s=h.nodeType===9?h.head:h,s.insertBefore(i,s.firstChild))}function Nd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Td(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var kc=null;function cy(i,s,h){if(kc===null){var g=new Map,k=kc=new Map;k.set(h,g)}else k=kc,g=k.get(h),g||(g=new Map,k.set(h,g));if(g.has(i))return g;for(g.set(i,null),h=h.getElementsByTagName(i),k=0;k<h.length;k++){var A=h[k];if(!(A[Rr]||A[$t]||i==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(s)||"";I=i+I;var W=g.get(I);W?W.push(A):g.set(I,[A])}}return g}function uy(i,s,h){i=i.ownerDocument||i,i.head.insertBefore(h,s==="title"?i.querySelector("head > title"):null)}function Wk(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function hy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Xk(i,s,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=Ks(g.href),A=s.querySelector(mo(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ac.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Lt(A);return}A=s.ownerDocument||s,g=oy(g),(k=$n.get(k))&&Nd(g,k),A=A.createElement("link"),Lt(A);var I=A;I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Zt(A,"link",g),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Ac.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Rd=0;function Kk(i,s){return i.stylesheets&&i.count===0&&Tc(i,i.stylesheets),0<i.count||0<i.imgCount?function(h){var g=setTimeout(function(){if(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend){var A=i.unsuspend;i.unsuspend=null,A()}},6e4+s);0<i.imgBytes&&Rd===0&&(Rd=62500*Rk());var k=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Tc(i,i.stylesheets),i.unsuspend)){var A=i.unsuspend;i.unsuspend=null,A()}},(i.imgBytes>Rd?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(k)}}:null}function Ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Tc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Nc=null;function Tc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Nc=new Map,s.forEach(Zk,i),Nc=null,Ac.call(i))}function Zk(i,s){if(!(s.state.loading&4)){var h=Nc.get(i);if(h)var g=h.get(null);else{h=new Map,Nc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<k.length;A++){var I=k[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(h.set(I.dataset.precedence,I),g=I)}g&&h.set(null,g)}k=s.instance,I=k.getAttribute("data-precedence"),A=h.get(I)||g,A===g&&h.set(null,k),h.set(I,k),this.count++,g=Ac.bind(this),k.addEventListener("load",g),k.addEventListener("error",g),A?A.parentNode.insertBefore(k,A.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(k,i.firstChild)),s.state.loading|=4}}var vo={$$typeof:y,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Qk(i,s,h,g,k,A,I,W,J){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.hiddenUpdates=Ne(null),this.identifierPrefix=g,this.onUncaughtError=k,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function fy(i,s,h,g,k,A,I,W,J,ce,me,ve){return i=new Qk(i,s,h,I,J,ce,me,ve,W),s=1,A===!0&&(s|=24),A=bn(3,null,null,s),i.current=A,A.stateNode=i,s=cf(),s.refCount++,i.pooledCache=s,s.refCount++,A.memoizedState={element:g,isDehydrated:h,cache:s},df(A),i}function dy(i){return i?(i=Ns,i):Ns}function py(i,s,h,g,k,A){k=dy(k),g.context===null?g.context=k:g.pendingContext=k,g=sr(s),g.payload={element:h},A=A===void 0?null:A,A!==null&&(g.callback=A),h=ar(i,g,s),h!==null&&(dn(h,i,s),Xa(h,i,s))}function gy(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<s?h:s}}function Dd(i,s){gy(i,s),(i=i.alternate)&&gy(i,s)}function my(i){if(i.tag===13||i.tag===31){var s=Or(i,67108864);s!==null&&dn(s,i,67108864),Dd(i,67108864)}}function _y(i){if(i.tag===13||i.tag===31){var s=En();s=ka(s);var h=Or(i,s);h!==null&&dn(h,i,s),Dd(i,s)}}var Rc=!0;function Jk(i,s,h,g){var k=q.T;q.T=null;var A=X.p;try{X.p=2,Md(i,s,h,g)}finally{X.p=A,q.T=k}}function eA(i,s,h,g){var k=q.T;q.T=null;var A=X.p;try{X.p=8,Md(i,s,h,g)}finally{X.p=A,q.T=k}}function Md(i,s,h,g){if(Rc){var k=jd(g);if(k===null)vd(i,s,g,Dc,h),yy(i,g);else if(nA(k,i,s,h,g))g.stopPropagation();else if(yy(i,g),s&4&&-1<tA.indexOf(i)){for(;k!==null;){var A=Wi(k);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=On(A.pendingLanes);if(I!==0){var W=A;for(W.pendingLanes|=2,W.entangledLanes|=2;I;){var J=1<<31-st(I);W.entanglements[1]|=J,I&=~J}oi(A),(ot&6)===0&&(dc=Fe()+500,ho(0))}}break;case 31:case 13:W=Or(A,2),W!==null&&dn(W,A,2),gc(),Dd(A,2)}if(A=jd(g),A===null&&vd(i,s,g,Dc,h),A===k)break;k=A}k!==null&&g.stopPropagation()}else vd(i,s,g,null,h)}}function jd(i){return i=Lh(i),Ld(i)}var Dc=null;function Ld(i){if(Dc=null,i=Yi(i),i!==null){var s=l(i);if(s===null)i=null;else{var h=s.tag;if(h===13){if(i=u(s),i!==null)return i;i=null}else if(h===31){if(i=o(s),i!==null)return i;i=null}else if(h===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dc=i,null}function vy(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case ie:return 2;case de:return 8;case Se:case Ae:return 32;case De:return 268435456;default:return 32}default:return 32}}var Od=!1,_r=null,vr=null,yr=null,yo=new Map,bo=new Map,br=[],tA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yy(i,s){switch(i){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":yo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(s.pointerId)}}function So(i,s,h,g,k,A){return i===null||i.nativeEvent!==A?(i={blockedOn:s,domEventName:h,eventSystemFlags:g,nativeEvent:A,targetContainers:[k]},s!==null&&(s=Wi(s),s!==null&&my(s)),i):(i.eventSystemFlags|=g,s=i.targetContainers,k!==null&&s.indexOf(k)===-1&&s.push(k),i)}function nA(i,s,h,g,k){switch(s){case"focusin":return _r=So(_r,i,s,h,g,k),!0;case"dragenter":return vr=So(vr,i,s,h,g,k),!0;case"mouseover":return yr=So(yr,i,s,h,g,k),!0;case"pointerover":var A=k.pointerId;return yo.set(A,So(yo.get(A)||null,i,s,h,g,k)),!0;case"gotpointercapture":return A=k.pointerId,bo.set(A,So(bo.get(A)||null,i,s,h,g,k)),!0}return!1}function by(i){var s=Yi(i.target);if(s!==null){var h=l(s);if(h!==null){if(s=h.tag,s===13){if(s=u(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===31){if(s=o(h),s!==null){i.blockedOn=s,bl(i.priority,function(){_y(h)});return}}else if(s===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var h=jd(i.nativeEvent);if(h===null){h=i.nativeEvent;var g=new h.constructor(h.type,h);jh=g,h.target.dispatchEvent(g),jh=null}else return s=Wi(h),s!==null&&my(s),i.blockedOn=h,!1;s.shift()}return!0}function Sy(i,s,h){Mc(i)&&h.delete(s)}function iA(){Od=!1,_r!==null&&Mc(_r)&&(_r=null),vr!==null&&Mc(vr)&&(vr=null),yr!==null&&Mc(yr)&&(yr=null),yo.forEach(Sy),bo.forEach(Sy)}function jc(i,s){i.blockedOn===s&&(i.blockedOn=null,Od||(Od=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,iA)))}var Lc=null;function xy(i){Lc!==i&&(Lc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lc===i&&(Lc=null);for(var s=0;s<i.length;s+=3){var h=i[s],g=i[s+1],k=i[s+2];if(typeof g!="function"){if(Ld(g||h)===null)continue;break}var A=Wi(h);A!==null&&(i.splice(s,3),s-=3,jf(A,{pending:!0,data:k,method:h.method,action:g},g,k))}}))}function Qs(i){function s(J){return jc(J,i)}_r!==null&&jc(_r,i),vr!==null&&jc(vr,i),yr!==null&&jc(yr,i),yo.forEach(s),bo.forEach(s);for(var h=0;h<br.length;h++){var g=br[h];g.blockedOn===i&&(g.blockedOn=null)}for(;0<br.length&&(h=br[0],h.blockedOn===null);)by(h),h.blockedOn===null&&br.shift();if(h=(i.ownerDocument||i).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var k=h[g],A=h[g+1],I=k[Qt]||null;if(typeof A=="function")I||xy(h);else if(I){var W=null;if(A&&A.hasAttribute("formAction")){if(k=A,I=A[Qt]||null)W=I.formAction;else if(Ld(k)!==null)continue}else W=I.action;typeof W=="function"?h[g+1]=W:(h.splice(g,3),g-=3),xy(h)}}}function wy(){function i(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return k=I})},focusReset:"manual",scroll:"manual"})}function s(){k!==null&&(k(),k=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,k=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),k!==null&&(k(),k=null)}}}function Bd(i){this._internalRoot=i}Oc.prototype.render=Bd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var h=s.current,g=En();py(h,g,i,s,null,null)},Oc.prototype.unmount=Bd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;py(i.current,2,null,i,null,null),gc(),s[bi]=null}};function Oc(i){this._internalRoot=i}Oc.prototype.unstable_scheduleHydration=function(i){if(i){var s=yl();i={blockedOn:null,target:i,priority:s};for(var h=0;h<br.length&&s!==0&&s<br[h].priority;h++);br.splice(h,0,i),h===0&&by(i)}};var Cy=t.version;if(Cy!=="19.2.7")throw Error(r(527,Cy,"19.2.7"));X.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var rA={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{Nt=Bc.inject(rA),Ct=Bc}catch{}}return wo.createRoot=function(i,s){if(!a(i))throw Error(r(299));var h=!1,g="",k=D_,A=M_,I=j_;return s!=null&&(s.unstable_strictMode===!0&&(h=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(k=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(I=s.onRecoverableError)),s=fy(i,1,!1,null,null,h,g,null,k,A,I,wy),i[bi]=s.current,_d(i),new Bd(s)},wo.hydrateRoot=function(i,s,h){if(!a(i))throw Error(r(299));var g=!1,k="",A=D_,I=M_,W=j_,J=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onUncaughtError!==void 0&&(A=h.onUncaughtError),h.onCaughtError!==void 0&&(I=h.onCaughtError),h.onRecoverableError!==void 0&&(W=h.onRecoverableError),h.formState!==void 0&&(J=h.formState)),s=fy(i,1,!0,s,h??null,g,k,J,A,I,W,wy),s.context=dy(null),h=s.current,g=En(),g=ka(g),k=sr(g),k.callback=null,ar(h,k,g),h=g,s.current.lanes=h,qe(s,h),oi(s),i[bi]=s.current,_d(i),new Oc(s)},wo.version="19.2.7",wo}var Ly;function pA(){if(Ly)return Hd.exports;Ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hd.exports=dA(),Hd.exports}var gA=pA();/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _A=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oy=e=>{const t=_A(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var $d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},yA=V.createContext({}),bA=()=>V.useContext(yA),SA=V.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:_="currentColor",className:v=""}=bA()??{},w=r??d?Number(n??p)*24/Number(t??f):n??p;return V.createElement("svg",{ref:c,...$d,width:t??f??$d.width,height:t??f??$d.height,stroke:e??_,strokeWidth:w,className:HS("lucide",v,a),...!l&&!vA(o)&&{"aria-hidden":"true"},...o},[...u.map(([C,b])=>V.createElement(C,b)),...Array.isArray(l)?l:[l]])});/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $e=(e,t)=>{const n=V.forwardRef(({className:r,...a},l)=>V.createElement(SA,{ref:l,iconNode:t,className:HS(`lucide-${mA(Oy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Oy(e),n};/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jo=$e("arrow-left",xA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ic=$e("arrow-right",wA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],EA=$e("blocks",CA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kA=[["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"}]],AA=$e("boxes",kA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const NA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_n=$e("check",NA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cs=$e("chevron-down",TA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uu=$e("chevron-right",RA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],MA=$e("circle-stop",DA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jA=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],LA=$e("cloud",jA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OA=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],BA=$e("code",OA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yg=$e("copy",IA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],FS=$e("corner-down-left",zA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HA=[["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"}]],FA=$e("cpu",HA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const PA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],UA=$e("ellipsis",PA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $A=[["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"}]],PS=$e("external-link",$A);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],US=$e("file-code",GA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],VA=$e("file-text",qA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],WA=$e("file",YA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XA=[["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"}]],KA=$e("flask-conical",XA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZA=[["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"}]],$S=$e("folder-open",ZA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QA=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],GS=$e("folder-tree",QA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JA=[["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"}]],eN=$e("folder",JA);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],$u=$e("git-branch",tN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],iN=$e("hard-drive",nN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sN=$e("info",rN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],oN=$e("laptop",aN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lN=[["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"}]],cN=$e("lock",lN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],hN=$e("maximize-2",uN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],dN=$e("minimize-2",fN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],qS=$e("panel-left",pN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bg=$e("plus",gN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mN=[["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"}]],Su=$e("refresh-cw",mN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _N=[["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"}]],Sg=$e("rotate-cw",_N);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],VS=$e("scroll-text",vN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ap=$e("server",yN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bN=[["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"}]],SN=$e("sliders-horizontal",bN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xN=[["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"}]],wN=$e("square-terminal",xN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],YS=$e("terminal",CN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EN=[["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"}]],Gu=$e("trash-2",EN);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fo=$e("x",kN);async function us(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const ut=e=>fetch(e).then(t=>us(t)),Dt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>us(n)),WS=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>us(n)),AN=()=>ut("/api/projects").then(e=>e.projects),NN=e=>Dt("/api/projects",e).then(t=>t.project),TN=e=>ut(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),RN=e=>ut(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),DN=e=>Dt(`/api/projects/${e}/open`).then(t=>t.project),MN=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),jN=e=>ut(`/api/projects/${e}/experiments`).then(t=>t.experiments),LN=e=>ut(`/api/projects/${e}/runs`).then(t=>t.runs),ON=()=>ut("/api/instances").then(e=>e.instances),XS=e=>Dt(`/api/runs/${e}/cancel`),BN=(e,t)=>ut(`/api/runs/${e}/log?offset=${t}`),IN=e=>ut(`/api/experiments/${e}/commits`).then(t=>t.commits),zN=(e,t)=>ut(`/api/experiments/${e}/commits/${t}/diff`),By=e=>ut(`/api/projects/${e}/working-tree`),KS=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),HN=(e,t,n={})=>ut(`/api/projects/${e}/file?${KS(n,new URLSearchParams({path:t}))}`),FN=(e,t={})=>{const n=KS(t).toString();return ut(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},xg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,PN=()=>ut("/api/settings/hf"),UN=e=>Dt("/api/settings/hf",{token:e}),$N=()=>ut("/api/settings/k8s"),GN=e=>Dt("/api/settings/k8s",e),qN=()=>ut("/api/settings/modal"),VN=()=>Dt("/api/settings/modal/provision"),YN=()=>ut("/api/settings/env").then(e=>e.vars),ZS=(e,t)=>Dt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),WN=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>us(t)).then(t=>t.vars),QS=()=>ut("/api/settings/data-dir"),XN=e=>Dt("/api/settings/data-dir/validate",{path:e}),KN=e=>Dt("/api/settings/data-dir",{path:e}),ZN=e=>Dt("/api/settings/data-dir/move",{path:e}),QN=()=>ut("/api/settings/ssh").then(e=>e.hosts),JN=e=>Dt("/api/settings/ssh/preflight",{host:e}),eT=()=>ut("/api/settings/slurm"),tT=e=>Dt("/api/settings/slurm",e),nT=e=>Dt("/api/settings/slurm/preflight",{host:e}),iT=()=>ut("/api/settings/compute"),JS=e=>Dt("/api/settings/compute/default",e),rT=()=>ut("/api/settings/local"),sT=()=>ut("/api/settings/openresearch"),Iy=e=>ut(`/api/projects/${e}/files`),aT=(e,t)=>ut(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),oT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>us(n)),Np=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,ex=()=>ut("/api/settings/git"),lT=e=>Dt("/api/settings/git",e),cT=e=>Dt("/api/settings/git/token",{token:e}),uT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>us(e)),hT=()=>ut("/api/settings/telemetry"),fT=e=>Dt("/api/settings/telemetry",{enabled:e}),dT=e=>Dt("/api/settings/telemetry/consent",{enabled:e}),wg=(e=!1)=>ut(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),pT=()=>ut("/api/skills").then(e=>e.skills);function xu(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const zy=e=>ut(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),gT=(e,t,n={})=>Dt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),mT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>us(t)),_T=(e,t)=>WS(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),vT=(e,t)=>WS(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Hy=e=>ut(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),yT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,bT=(e,t,n={},r)=>Dt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),ST=e=>Dt(`/api/chat/sessions/${e}/interrupt`),xT=(e,t)=>Dt(`/api/chat/sessions/${e}/respond`,t);function Sa(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Fy(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ns(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return r===0?`${e} B`:`${n.toFixed(1)} ${t[r]}`}function Tp(e){return e.length>10?`${e.slice(0,10)}…`:e}function tx(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function nx(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const cu=new Map;function wT(e,t){let n=cu.get(e);return n||(n=new Set,cu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&cu.delete(e)}}function CT(e){var t;(t=cu.get(e.runId))==null||t.forEach(n=>n(e))}const Rp=new Set;function ET(e){return Rp.add(e),()=>{Rp.delete(e)}}function zc(e){Rp.forEach(t=>t(e))}const Dp=new Set;function kT(e){return Dp.add(e),()=>{Dp.delete(e)}}function Gd(e){Dp.forEach(t=>t(e))}function AT(e){const t=V.useRef(e);t.current=e,V.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&CT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&zc({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&zc({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&zc({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Gd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Gd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Gd({type:"error",error:l.error})}),()=>n.close()},[])}function Py(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function NT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DT={};function Uy(e,t){return(DT.jsx?RT:TT).test(e)}const MT=/[ \t\n\f\r]/g;function jT(e){return typeof e=="object"?e.type==="text"?$y(e.value):!1:$y(e)}function $y(e){return e.replace(MT,"")===""}class ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ol.prototype.normal={};ol.prototype.property={};ol.prototype.space=void 0;function ix(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ol(n,r,t)}function Po(e){return e.toLowerCase()}class vn{constructor(t,n){this.attribute=n,this.property=t}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let LT=0;const ze=hs(),Ht=hs(),Mp=hs(),xe=hs(),vt=hs(),Jr=hs(),kn=hs();function hs(){return 2**++LT}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ht,commaOrSpaceSeparated:kn,commaSeparated:Jr,number:xe,overloadedBoolean:Mp,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),qd=Object.keys(jp);class Cg extends vn{constructor(t,n,r,a){let l=-1;if(super(t,n),Gy(this,"space",a),typeof r=="number")for(;++l<qd.length;){const u=qd[l];Gy(this,qd[l],(r&jp[u])===jp[u])}}}Cg.prototype.defined=!0;function Gy(e,t,n){n&&(e[t]=n)}function xa(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new Cg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Po(r)]=r,n[Po(l.attribute)]=r}return new ol(t,n,e.space)}const rx=xa({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:vt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:xe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:vt,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ht,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sx(e,t){return t in e?e[t]:t}function ax(e,t){return sx(e,t.toLowerCase())}const OT=xa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jr,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,closedBy:null,colorSpace:null,cols:xe,colSpan:xe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:ze,controlsList:vt,coords:xe|Jr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Mp,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:xe,hidden:Mp,high:xe,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:xe,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:xe,rowSpan:xe,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ht,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:Jr,part:vt,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:ax}),BT=xa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:vt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jr,g2:Jr,glyphName:Jr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sx}),ox=xa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lx=xa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ax}),cx=xa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},zT=/[A-Z]/g,qy=/-[a-z]/g,HT=/^data[-\w.:]+$/i;function ux(e,t){const n=Po(t);let r=t,a=vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HT.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(qy,PT);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!qy.test(l)){let u=l.replace(zT,FT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Cg}return new a(r,t)}function FT(e){return"-"+e.toLowerCase()}function PT(e){return e.charAt(1).toUpperCase()}const hx=ix([rx,OT,ox,lx,cx],"html"),qu=ix([rx,BT,ox,lx,cx],"svg");function Vy(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function UT(e){return e.join(" ").trim()}var Js={},Vd,Yy;function $T(){if(Yy)return Vd;Yy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,f="/",p="*",d="",_="comment",v="declaration";function w(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var x=1,y=1;function E(H){var Y=H.match(t);Y&&(x+=Y.length);var q=H.lastIndexOf(c);y=~q?H.length-q:y+H.length}function R(){var H={line:x,column:y};return function(Y){return Y.position=new N(H),j(),Y}}function N(H){this.start=H,this.end={line:x,column:y},this.source=S.source}N.prototype.content=b;function D(H){var Y=new Error(S.source+":"+x+":"+y+": "+H);if(Y.reason=H,Y.filename=S.source,Y.line=x,Y.column=y,Y.source=b,!S.silent)throw Y}function T(H){var Y=H.exec(b);if(Y){var q=Y[0];return E(q),b=b.slice(q.length),Y}}function j(){T(n)}function B(H){var Y;for(H=H||[];Y=z();)Y!==!1&&H.push(Y);return H}function z(){var H=R();if(!(f!=b.charAt(0)||p!=b.charAt(1))){for(var Y=2;d!=b.charAt(Y)&&(p!=b.charAt(Y)||f!=b.charAt(Y+1));)++Y;if(Y+=2,d===b.charAt(Y-1))return D("End of comment missing");var q=b.slice(2,Y-2);return y+=2,E(q),b=b.slice(Y),y+=2,H({type:_,comment:q})}}function G(){var H=R(),Y=T(r);if(Y){if(z(),!T(a))return D("property missing ':'");var q=T(l),X=H({type:v,property:C(Y[0].replace(e,d)),value:q?C(q[0].replace(e,d)):d});return T(u),X}}function U(){var H=[];B(H);for(var Y;Y=G();)Y!==!1&&(H.push(Y),B(H));return H}return j(),U()}function C(b){return b?b.replace(o,d):d}return Vd=w,Vd}var Wy;function GT(){if(Wy)return Js;Wy=1;var e=Js&&Js.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Js,"__esModule",{value:!0}),Js.default=n;const t=e($T());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return Js}var Co={},Xy;function qT(){if(Xy)return Co;Xy=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return Co.camelCase=c,Co}var Eo,Ky;function VT(){if(Ky)return Eo;Ky=1;var e=Eo&&Eo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(GT()),n=qT();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Eo=r,Eo}var YT=VT();const WT=Pu(YT),fx=dx("end"),Eg=dx("start");function dx(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function XT(e){const t=Eg(e),n=fx(e);if(t&&n)return{start:t,end:n}}function Lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zy(e.position):"start"in e||"end"in e?Zy(e):"line"in e||"column"in e?Lp(e):""}function Lp(e){return Qy(e&&e.line)+":"+Qy(e&&e.column)}function Zy(e){return Lp(e&&e.start)+"-"+Lp(e&&e.end)}function Qy(e){return e&&typeof e=="number"?e:1}class tn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Lo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const kg={}.hasOwnProperty,KT=new Map,ZT=/[A-Z]/g,QT=new Set(["table","tbody","thead","tfoot","tr"]),JT=new Set(["td","th"]),px="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e3(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=l3(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=o3(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qu:hx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=gx(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function gx(e,t,n){if(t.type==="element")return t3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return r3(e,t,n);if(t.type==="mdxjsEsm")return i3(e,t);if(t.type==="root")return s3(e,t,n);if(t.type==="text")return a3(e,t)}function t3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=_x(e,t.tagName,!1),u=c3(e,t);let o=Ng(e,t);return QT.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!jT(c):!0})),mx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function n3(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uo(e,t.position)}function i3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uo(e,t.position)}function r3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=qu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:_x(e,t.name,!0),u=u3(e,t),o=Ng(e,t);return mx(e,u,l,t),Ag(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function s3(e,t,n){const r={};return Ag(r,Ng(e,t)),e.create(t,e.Fragment,r,n)}function a3(e,t){return t.value}function mx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ag(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function o3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function l3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Eg(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function c3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&kg.call(t.properties,a)){const l=h3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&JT.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function u3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Uo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Uo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Ng(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:KT;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const f=a.get(c)||0;u=c+"-"+f,a.set(c,f+1)}}const o=gx(e,l,u);o!==void 0&&n.push(o)}return n}function h3(e,t,n){const r=ux(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?NT(n):UT(n)),r.property==="style"){let a=typeof n=="object"?n:f3(e,String(n));return e.stylePropertyNameCase==="css"&&(a=d3(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?IT[r.property]||r.property:r.attribute,n]}}function f3(e,t){try{return WT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=px+"#cannot-parse-style-attribute",a}}function _x(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const o=Uy(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=u}else r=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return kg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uo(e)}function Uo(e,t){const n=new tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=px+"#cannot-handle-mdx-estrees-without-createevaluater",n}function d3(e){const t={};let n;for(n in e)kg.call(e,n)&&(t[p3(n)]=e[n]);return t}function p3(e){let t=e.replace(ZT,g3);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function g3(e){return"-"+e.toLowerCase()}const Yd={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},m3={};function Tg(e,t){const n=m3,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vx(e,r,a)}function vx(e,t,n){if(_3(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jy(e.children,t,n)}return Array.isArray(e)?Jy(e,t,n):""}function Jy(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=vx(e[a],t,n);return r.join("")}function _3(e){return!!(e&&typeof e=="object")}const e1=document.createElement("i");function $o(e){const t="&"+e+";";e1.innerHTML=t;const n=e1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tn(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function Gn(e,t){return e.length>0?(Tn(e,e.length,0,t),e):t}const t1={}.hasOwnProperty;function yx(e){const t={};let n=-1;for(;++n<e.length;)v3(t,e[n]);return t}function v3(e,t){let n;for(n in t){const a=(t1.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){t1.call(a,u)||(a[u]=[]);const o=l[u];y3(a[u],Array.isArray(o)?o:o?[o]:[])}}}function y3(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tn(e,0,0,r)}function bx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Nr(/[A-Za-z]/),en=Nr(/[\dA-Za-z]/),b3=Nr(/[#-'*+\--9=?A-Z^-~]/);function wu(e){return e!==null&&(e<32||e===127)}const Op=Nr(/\d/),S3=Nr(/[\dA-Fa-f]/),x3=Nr(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const Vu=Nr(new RegExp("\\p{P}|\\p{S}","u")),is=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wa(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&en(e.charCodeAt(n+1))&&en(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function et(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Xe(c)?(e.enter(n),o(c)):t(c)}function o(c){return Xe(c)&&l++<a?(e.consume(c),o):(e.exit(n),t(c))}}const w3={tokenize:C3};function C3(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),et(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,u(o)}function u(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Oe(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),u)}}const E3={tokenize:k3},n1={tokenize:A3};function k3(e){const t=this,n=[];let r=0,a,l,u;return o;function o(y){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,c,f)(y)}return f(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&x();const E=t.events.length;let R=E,N;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){N=t.events[R][1].end;break}S(r);let D=E;for(;D<t.events.length;)t.events[D][1].end={...N},D++;return Tn(t.events,R+1,0,t.events.slice(E)),t.events.length=D,f(y)}return o(y)}function f(y){if(r===n.length){if(!a)return _(y);if(a.currentConstruct&&a.currentConstruct.concrete)return w(y);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(n1,p,d)(y)}function p(y){return a&&x(),S(r),_(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(y)}function _(y){return t.containerState={},e.attempt(n1,v,w)(y)}function v(y){return r++,n.push([t.currentConstruct,t.containerState]),_(y)}function w(y){if(y===null){a&&x(),S(0),e.consume(y);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),C(y)}function C(y){if(y===null){b(e.exit("chunkFlow"),!0),S(0),e.consume(y);return}return Oe(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),C)}function b(y,E){const R=t.sliceStream(y);if(E&&R.push(null),y.previous=l,l&&(l.next=y),l=y,a.defineSkip(y.start),a.write(R),t.parser.lazy[y.start.line]){let N=a.events.length;for(;N--;)if(a.events[N][1].start.offset<u&&(!a.events[N][1].end||a.events[N][1].end.offset>u))return;const D=t.events.length;let T=D,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(S(r),N=D;N<t.events.length;)t.events[N][1].end={...B},N++;Tn(t.events,T+1,0,t.events.slice(D)),t.events.length=N}}function S(y){let E=n.length;for(;E-- >y;){const R=n[E];t.containerState=R[1],R[0].exit.call(t,e)}n.length=y}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function A3(e,t,n){return et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fa(e){if(e===null||yt(e)||is(e))return 1;if(Vu(e))return 2}function Yu(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Bp={name:"attention",resolveAll:N3,tokenize:T3};function N3(e,t){let n=-1,r,a,l,u,o,c,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},_={...e[n][1].start};i1(d,-c),i1(_,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,Yu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T3(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=fa(r);let l;return u;function u(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const f=e.exit("attentionSequence"),p=fa(c),d=!p||p===2&&a||n.includes(c),_=!a||a===2&&p||n.includes(r);return f._open=!!(l===42?d:d&&(a||!_)),f._close=!!(l===42?_:_&&(p||!d)),t(c)}}function i1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R3={name:"autolink",tokenize:D3};function D3(e,t,n){let r=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return sn(v)?(e.consume(v),u):v===64?n(v):f(v)}function u(v){return v===43||v===45||v===46||en(v)?(r=1,o(v)):f(v)}function o(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||en(v))&&r++<32?(e.consume(v),o):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||wu(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),p):b3(v)?(e.consume(v),f):n(v)}function p(v){return en(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):_(v)}function _(v){if((v===45||en(v))&&r++<63){const w=v===45?_:d;return e.consume(v),w}return n(v)}}const ll={partial:!0,tokenize:M3};function M3(e,t,n){return r;function r(l){return Xe(l)?et(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Oe(l)?t(l):n(l)}}const Sx={continuation:{tokenize:L3},exit:O3,name:"blockQuote",tokenize:j3};function j3(e,t,n){const r=this;return a;function a(u){if(u===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return Xe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function L3(e,t,n){const r=this;return a;function a(u){return Xe(u)?et(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(Sx,t,n)(u)}}function O3(e){e.exit("blockQuote")}const xx={name:"characterEscape",tokenize:B3};function B3(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return x3(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const wx={name:"characterReference",tokenize:I3};function I3(e,t,n){const r=this;let a=0,l,u;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),l=31,u=en,p(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=S3,p):(e.enter("characterReferenceValue"),l=7,u=Op,p(d))}function p(d){if(d===59&&a){const _=e.exit("characterReferenceValue");return u===en&&!$o(r.sliceSerialize(_))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(d)&&a++<l?(e.consume(d),p):n(d)}}const r1={partial:!0,tokenize:H3},s1={concrete:!0,name:"codeFenced",tokenize:z3};function z3(e,t,n){const r=this,a={partial:!0,tokenize:R};let l=0,u=0,o;return c;function c(N){return f(N)}function f(N){const D=r.events[r.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===o?(u++,e.consume(N),p):u<3?n(N):(e.exit("codeFencedFenceSequence"),Xe(N)?et(e,d,"whitespace")(N):d(N))}function d(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(r1,C,E)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(N))}function _(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(N)):Xe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,v,"whitespace")(N)):N===96&&N===o?n(N):(e.consume(N),_)}function v(N){return N===null||Oe(N)?d(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(N)):N===96&&N===o?n(N):(e.consume(N),w)}function C(N){return e.attempt(a,E,b)(N)}function b(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),S}function S(N){return l>0&&Xe(N)?et(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Oe(N)?e.check(r1,C,E)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),y)}function E(N){return e.exit("codeFenced"),t(N)}function R(N,D,T){let j=0;return B;function B(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),z}function z(Y){return N.enter("codeFencedFence"),Xe(Y)?et(N,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):G(Y)}function G(Y){return Y===o?(N.enter("codeFencedFenceSequence"),U(Y)):T(Y)}function U(Y){return Y===o?(j++,N.consume(Y),U):j>=u?(N.exit("codeFencedFenceSequence"),Xe(Y)?et(N,H,"whitespace")(Y):H(Y)):T(Y)}function H(Y){return Y===null||Oe(Y)?(N.exit("codeFencedFence"),D(Y)):T(Y)}}}function H3(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Wd={name:"codeIndented",tokenize:P3},F3={partial:!0,tokenize:U3};function P3(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),et(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Oe(f)?e.attempt(F3,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Oe(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function U3(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):et(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Oe(u)?a(u):n(u)}}const $3={name:"codeText",previous:q3,resolve:G3,tokenize:V3};function G3(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function q3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function V3(e,t,n){let r=0,a,l;return u;function u(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(l=e.enter("codeTextSequence"),a=0,p(d)):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||Oe(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function p(d){return d===96?(e.consume(d),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",f(d))}}class Y3{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&ko(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ko(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ko(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ko(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ko(this.left,n.reverse())}}}function ko(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Cx(e){const t={};let n=-1,r,a,l,u,o,c,f;const p=new Y3(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,W3(p,n)),n=t[n],f=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=p.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},o=p.slice(a,n),o.unshift(r),p.splice(a,n-a+1,o))}}return Tn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function W3(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],f={};let p,d,_=-1,v=n,w=0,C=0;const b=[C];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),d&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++_<o.length;)o[_][0]==="exit"&&o[_-1][0]==="enter"&&o[_][1].type===o[_-1][1].type&&o[_][1].start.line!==o[_][1].end.line&&(C=_+1,b.push(C),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):b.pop(),_=b.length;_--;){const S=o.slice(b[_],b[_+1]),x=l.pop();c.push([x,x+S.length-1]),e.splice(x,2,S)}for(c.reverse(),_=-1;++_<c.length;)f[w+c[_][0]]=w+c[_][1],w+=c[_][1]-c[_][0]-1;return f}const X3={resolve:Z3,tokenize:Q3},K3={partial:!0,tokenize:J3};function Z3(e){return Cx(e),e}function Q3(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?l(o):Oe(o)?e.check(K3,u,l)(o):(e.consume(o),a)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function u(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function J3(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),et(e,l,"linePrefix")}function l(u){if(u===null||Oe(u))return n(u);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Ex(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(S){return S===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(S),e.exit(l),_):S===null||S===32||S===41||wu(S)?n(S):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),C(S))}function _(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(o),_(S)):S===null||S===60||Oe(S)?n(S):(e.consume(S),S===92?w:v)}function w(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function C(S){return!p&&(S===null||S===41||yt(S))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,C):S===41?(e.consume(S),p--,C):S===null||S===32||S===40||wu(S)?n(S):(e.consume(S),S===92?b:C)}function b(S){return S===40||S===41||S===92?(e.consume(S),C):C(S)}}function kx(e,t,n,r,a,l){const u=this;let o=0,c;return f;function f(v){return e.enter(r),e.enter(a),e.consume(v),e.exit(a),e.enter(l),p}function p(v){return o>999||v===null||v===91||v===93&&!c||v===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):Oe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||Oe(v)||o++>999?(e.exit("chunkString"),p(v)):(e.consume(v),c||(c=!Xe(v)),v===92?_:d)}function _(v){return v===91||v===92||v===93?(e.consume(v),o++,d):d(v)}}function Ax(e,t,n,r,a,l){let u;return o;function o(_){return _===34||_===39||_===40?(e.enter(r),e.enter(a),e.consume(_),e.exit(a),u=_===40?41:_,c):n(_)}function c(_){return _===u?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):(e.enter(l),f(_))}function f(_){return _===u?(e.exit(l),c(u)):_===null?n(_):Oe(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),et(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===u||_===null||Oe(_)?(e.exit("chunkString"),f(_)):(e.consume(_),_===92?d:p)}function d(_){return _===u||_===92?(e.consume(_),p):p(_)}}function Oo(e,t){let n;return r;function r(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Xe(a)?et(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const e5={name:"definition",tokenize:n5},t5={partial:!0,tokenize:i5};function n5(e,t,n){const r=this;let a;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return kx.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function o(v){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return yt(v)?Oo(e,f)(v):f(v)}function f(v){return Ex(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(t5,d,d)(v)}function d(v){return Xe(v)?et(e,_,"whitespace")(v):_(v)}function _(v){return v===null||Oe(v)?(e.exit("definition"),r.parser.defined.push(a),t(v)):n(v)}}function i5(e,t,n){return r;function r(o){return yt(o)?Oo(e,a)(o):n(o)}function a(o){return Ax(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Xe(o)?et(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Oe(o)?t(o):n(o)}}const r5={name:"hardBreakEscape",tokenize:s5};function s5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Oe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const a5={name:"headingAtx",resolve:o5,tokenize:l5};function o5(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function l5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||yt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(e.exit("atxHeading"),t(p)):Xe(p)?et(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||yt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const c5=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a1=["pre","script","style","textarea"],u5={concrete:!0,name:"htmlFlow",resolveTo:d5,tokenize:p5},h5={partial:!0,tokenize:m5},f5={partial:!0,tokenize:g5};function d5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function p5(e,t,n){const r=this;let a,l,u,o,c;return f;function f(F){return p(F)}function p(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),d}function d(F){return F===33?(e.consume(F),_):F===47?(e.consume(F),l=!0,C):F===63?(e.consume(F),a=3,r.interrupt?t:M):sn(F)?(e.consume(F),u=String.fromCharCode(F),b):n(F)}function _(F){return F===45?(e.consume(F),a=2,v):F===91?(e.consume(F),a=5,o=0,w):sn(F)?(e.consume(F),a=4,r.interrupt?t:M):n(F)}function v(F){return F===45?(e.consume(F),r.interrupt?t:M):n(F)}function w(F){const Q="CDATA[";return F===Q.charCodeAt(o++)?(e.consume(F),o===Q.length?r.interrupt?t:G:w):n(F)}function C(F){return sn(F)?(e.consume(F),u=String.fromCharCode(F),b):n(F)}function b(F){if(F===null||F===47||F===62||yt(F)){const Q=F===47,re=u.toLowerCase();return!Q&&!l&&a1.includes(re)?(a=1,r.interrupt?t(F):G(F)):c5.includes(u.toLowerCase())?(a=6,Q?(e.consume(F),S):r.interrupt?t(F):G(F)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):l?x(F):y(F))}return F===45||en(F)?(e.consume(F),u+=String.fromCharCode(F),b):n(F)}function S(F){return F===62?(e.consume(F),r.interrupt?t:G):n(F)}function x(F){return Xe(F)?(e.consume(F),x):B(F)}function y(F){return F===47?(e.consume(F),B):F===58||F===95||sn(F)?(e.consume(F),E):Xe(F)?(e.consume(F),y):B(F)}function E(F){return F===45||F===46||F===58||F===95||en(F)?(e.consume(F),E):R(F)}function R(F){return F===61?(e.consume(F),N):Xe(F)?(e.consume(F),R):y(F)}function N(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),c=F,D):Xe(F)?(e.consume(F),N):T(F)}function D(F){return F===c?(e.consume(F),c=null,j):F===null||Oe(F)?n(F):(e.consume(F),D)}function T(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||yt(F)?R(F):(e.consume(F),T)}function j(F){return F===47||F===62||Xe(F)?y(F):n(F)}function B(F){return F===62?(e.consume(F),z):n(F)}function z(F){return F===null||Oe(F)?G(F):Xe(F)?(e.consume(F),z):n(F)}function G(F){return F===45&&a===2?(e.consume(F),q):F===60&&a===1?(e.consume(F),X):F===62&&a===4?(e.consume(F),O):F===63&&a===3?(e.consume(F),M):F===93&&a===5?(e.consume(F),L):Oe(F)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(h5,$,U)(F)):F===null||Oe(F)?(e.exit("htmlFlowData"),U(F)):(e.consume(F),G)}function U(F){return e.check(f5,H,$)(F)}function H(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),Y}function Y(F){return F===null||Oe(F)?U(F):(e.enter("htmlFlowData"),G(F))}function q(F){return F===45?(e.consume(F),M):G(F)}function X(F){return F===47?(e.consume(F),u="",K):G(F)}function K(F){if(F===62){const Q=u.toLowerCase();return a1.includes(Q)?(e.consume(F),O):G(F)}return sn(F)&&u.length<8?(e.consume(F),u+=String.fromCharCode(F),K):G(F)}function L(F){return F===93?(e.consume(F),M):G(F)}function M(F){return F===62?(e.consume(F),O):F===45&&a===2?(e.consume(F),M):G(F)}function O(F){return F===null||Oe(F)?(e.exit("htmlFlowData"),$(F)):(e.consume(F),O)}function $(F){return e.exit("htmlFlow"),t(F)}}function g5(e,t,n){const r=this;return a;function a(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function m5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ll,t,n)}}const _5={name:"htmlText",tokenize:v5};function v5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),R):M===63?(e.consume(M),y):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,w):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),_):Oe(M)?(u=d,X(M)):(e.consume(M),d)}function _(M){return M===45?(e.consume(M),v):d(M)}function v(M){return M===62?q(M):M===45?_(M):d(M)}function w(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?C:w):n(M)}function C(M){return M===null?n(M):M===93?(e.consume(M),b):Oe(M)?(u=C,X(M)):(e.consume(M),C)}function b(M){return M===93?(e.consume(M),S):C(M)}function S(M){return M===62?q(M):M===93?(e.consume(M),S):C(M)}function x(M){return M===null||M===62?q(M):Oe(M)?(u=x,X(M)):(e.consume(M),x)}function y(M){return M===null?n(M):M===63?(e.consume(M),E):Oe(M)?(u=y,X(M)):(e.consume(M),y)}function E(M){return M===62?q(M):y(M)}function R(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||en(M)?(e.consume(M),N):D(M)}function D(M){return Oe(M)?(u=D,X(M)):Xe(M)?(e.consume(M),D):q(M)}function T(M){return M===45||en(M)?(e.consume(M),T):M===47||M===62||yt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),q):M===58||M===95||sn(M)?(e.consume(M),B):Oe(M)?(u=j,X(M)):Xe(M)?(e.consume(M),j):q(M)}function B(M){return M===45||M===46||M===58||M===95||en(M)?(e.consume(M),B):z(M)}function z(M){return M===61?(e.consume(M),G):Oe(M)?(u=z,X(M)):Xe(M)?(e.consume(M),z):j(M)}function G(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,U):Oe(M)?(u=G,X(M)):Xe(M)?(e.consume(M),G):(e.consume(M),H)}function U(M){return M===a?(e.consume(M),a=void 0,Y):M===null?n(M):Oe(M)?(u=U,X(M)):(e.consume(M),U)}function H(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||yt(M)?j(M):(e.consume(M),H)}function Y(M){return M===47||M===62||yt(M)?j(M):n(M)}function q(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Xe(M)?et(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const Rg={name:"labelEnd",resolveAll:x5,resolveTo:w5,tokenize:C5},y5={tokenize:E5},b5={tokenize:k5},S5={tokenize:A5};function x5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Tn(e,0,e.length,n),e}function w5(e,t){let n=e.length,r=0,a,l,u,o;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,t],["enter",f,t]],o=Gn(o,e.slice(l+1,l+r+3)),o=Gn(o,[["enter",p,t]]),o=Gn(o,Yu(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),o=Gn(o,[["exit",p,t],e[u-2],e[u-1],["exit",f,t]]),o=Gn(o,e.slice(u+1)),o=Gn(o,[["exit",c,t]]),Tn(e,l,e.length,o),e}function C5(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return o;function o(_){return l?l._inactive?d(_):(u=r.parser.defined.includes(Jn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),c):n(_)}function c(_){return _===40?e.attempt(y5,p,u?p:d)(_):_===91?e.attempt(b5,p,u?f:d)(_):u?p(_):d(_)}function f(_){return e.attempt(S5,p,d)(_)}function p(_){return t(_)}function d(_){return l._balanced=!0,n(_)}}function E5(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),a}function a(d){return yt(d)?Oo(e,l)(d):l(d)}function l(d){return d===41?p(d):Ex(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function u(d){return yt(d)?Oo(e,c)(d):p(d)}function o(d){return n(d)}function c(d){return d===34||d===39||d===40?Ax(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function f(d){return yt(d)?Oo(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function k5(e,t,n){const r=this;return a;function a(o){return kx.call(r,e,l,u,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function u(o){return n(o)}}function A5(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const N5={name:"labelStartImage",resolveAll:Rg.resolveAll,tokenize:T5};function T5(e,t,n){const r=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),u):n(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const R5={name:"labelStartLink",resolveAll:Rg.resolveAll,tokenize:D5};function D5(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Xd={name:"lineEnding",tokenize:M5};function M5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,t,"linePrefix")}}const uu={name:"thematicBreak",tokenize:j5};function j5(e,t,n){let r=0,a;return l;function l(f){return e.enter("thematicBreak"),u(f)}function u(f){return a=f,o(f)}function o(f){return f===a?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||Oe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Xe(f)?et(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:I5},exit:H5,name:"list",tokenize:B5},L5={partial:!0,tokenize:F5},O5={partial:!0,tokenize:z5};function B5(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Op(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(uu,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return Op(v)&&++u<10?(e.consume(v),c):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(ll,r.interrupt?n:p,e.attempt(L5,_,d))}function p(v){return r.containerState.initialBlankLine=!0,l++,_(v)}function d(v){return Xe(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),_):n(v)}function _(v){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function I5(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ll,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(O5,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function z5(e,t,n){const r=this;return et(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function H5(e){e.exit(this.containerState.type)}function F5(e,t,n){const r=this;return et(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Xe(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const o1={name:"setextUnderline",resolveTo:P5,tokenize:U5};function P5(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function U5(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Xe(f)?et(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Oe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const $5={tokenize:G5};function G5(e){const t=this,n=e.attempt(ll,r,e.attempt(this.parser.constructs.flowInitial,a,et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(X3,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const q5={resolveAll:Tx()},V5=Nx("string"),Y5=Nx("text");function Nx(e){return{resolveAll:Tx(e==="text"?W5:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let _=-1;if(d)for(;++_<d.length;){const v=d[_];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Tx(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function W5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,o=0,c;for(;l--;){const f=a[l];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(f===-2)c=!0,o++;else if(f!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const f={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const X5={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:Sx},K5={91:e5},Z5={[-2]:Wd,[-1]:Wd,32:Wd},Q5={35:a5,42:uu,45:[o1,uu],60:u5,61:o1,95:uu,96:s1,126:s1},J5={38:wx,92:xx},e4={[-5]:Xd,[-4]:Xd,[-3]:Xd,33:N5,38:wx,42:Bp,60:[R3,_5],91:R5,92:[r5,xx],93:Rg,95:Bp,96:$3},t4={null:[Bp,q5]},n4={null:[42,95]},i4={null:[]},r4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n4,contentInitial:K5,disable:i4,document:X5,flow:Q5,flowInitial:Z5,insideSpan:t4,string:J5,text:e4},Symbol.toStringTag,{value:"Module"}));function s4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],o=[];const c={attempt:D(R),check:D(N),consume:x,enter:y,exit:E,interrupt:D(N,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:v,write:d};let p=t.tokenize.call(f,c);return t.resolveAll&&l.push(t),f;function d(z){return u=Gn(u,z),b(),u[u.length-1]!==null?[]:(T(t,0),f.events=Yu(l,f.events,f),f.events)}function _(z,G){return o4(v(z),G)}function v(z){return a4(u,z)}function w(){const{_bufferIndex:z,_index:G,line:U,column:H,offset:Y}=r;return{_bufferIndex:z,_index:G,line:U,column:H,offset:Y}}function C(z){a[z.line]=z.column,B()}function b(){let z;for(;r._index<u.length;){const G=u[r._index];if(typeof G=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<G.length;)S(G.charCodeAt(r._bufferIndex));else S(G)}}function S(z){p=p(z)}function x(z){Oe(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,B()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=z}function y(z,G){const U=G||{};return U.type=z,U.start=w(),f.events.push(["enter",U,f]),o.push(U),U}function E(z){const G=o.pop();return G.end=w(),f.events.push(["exit",G,f]),G}function R(z,G){T(z,G.from)}function N(z,G){G.restore()}function D(z,G){return U;function U(H,Y,q){let X,K,L,M;return Array.isArray(H)?$(H):"tokenize"in H?$([H]):O(H);function O(ae){return Z;function Z(P){const ee=P!==null&&ae[P],ne=P!==null&&ae.null,ge=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return $(ge)(P)}}function $(ae){return X=ae,K=0,ae.length===0?q:F(ae[K])}function F(ae){return Z;function Z(P){return M=j(),L=ae,ae.partial||(f.currentConstruct=ae),ae.name&&f.parser.constructs.disable.null.includes(ae.name)?re():ae.tokenize.call(G?Object.assign(Object.create(f),G):f,c,Q,re)(P)}}function Q(ae){return z(L,M),Y}function re(ae){return M.restore(),++K<X.length?F(X[K]):q}}}function T(z,G){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Tn(f.events,G,f.events.length-G,z.resolve(f.events.slice(G),f)),z.resolveTo&&(f.events=z.resolveTo(f.events,f))}function j(){const z=w(),G=f.previous,U=f.currentConstruct,H=f.events.length,Y=Array.from(o);return{from:H,restore:q};function q(){r=z,f.previous=G,f.currentConstruct=U,f.events.length=H,o=Y,B()}}function B(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function a4(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function o4(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=` -`;break}case-3:{u=`\r -`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function l4(e){const r={constructs:yx([r4,...(e||{}).extensions||[]]),content:a(w3),defined:[],document:a(E3),flow:a($5),lazy:{},string:a(V5),text:a(Y5)};return r;function a(l){return u;function u(o){return s4(r,l,o)}}}function c4(e){for(;!Cx(e););return e}const l1=/[\0\t\n\r]/g;function u4(){let e=1,t="",n=!0,r;return a;function a(l,u,o){const c=[];let f,p,d,_,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),d=0,t="",n&&(l.charCodeAt(0)===65279&&d++,n=void 0);d<l.length;){if(l1.lastIndex=d,f=l1.exec(l),_=f&&f.index!==void 0?f.index:l.length,v=l.charCodeAt(_),!f){t=l.slice(d);break}if(v===10&&d===_&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<_&&(c.push(l.slice(d,_)),e+=_-d),v){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=_+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const h4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f4(e){return e.replace(h4,d4)}function d4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return bx(n.slice(l?2:1),l?16:10)}return $o(n)||e}const Rx={}.hasOwnProperty;function p4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),g4(n)(c4(l4(n).document().write(u4()(e,t,!0))))}function g4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(bt),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(ke),blockQuote:l(ne),characterEscape:j,characterReference:j,codeFenced:l(ge),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(ge,u),codeText:l(he,u),codeTextData:j,data:j,codeFlowValue:j,definition:l(ye),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(be),hardBreakEscape:l(Ee),hardBreakTrailing:l(Ee),htmlFlow:l(Ce,u),htmlFlowData:j,htmlText:l(Ce,u),htmlTextData:j,image:l(rt),label:u,link:l(bt),listItem:l(ct),listItemValue:_,listOrdered:l(Ge,d),listUnordered:l(Ge),paragraph:l(Pt),reference:F,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(ke),strong:l(ht),thematicBreak:l(fe)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:ee,autolinkProtocol:P,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ae,characterReference:Z,codeFenced:c(b),codeFencedFence:C,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:B,codeIndented:c(S),codeText:c(Y),codeTextData:B,data:B,definition:c(),definitionDestinationString:E,definitionLabelString:x,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(G),hardBreakTrailing:c(G),htmlFlow:c(U),htmlFlowData:B,htmlText:c(H),htmlTextData:B,image:c(X),label:L,labelText:K,lineEnding:z,link:c(q),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:M,resourceTitleString:O,resource:$,setextHeading:c(T),setextHeadingLineSequence:D,setextHeadingText:N,strong:c(),thematicBreak:c()}};Dx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ie){let de={type:"root",children:[]};const Se={stack:[de],tokenStack:[],config:t,enter:o,exit:f,buffer:u,resume:p,data:n},Ae=[];let De=-1;for(;++De<ie.length;)if(ie[De][1].type==="listOrdered"||ie[De][1].type==="listUnordered")if(ie[De][0]==="enter")Ae.push(De);else{const Ve=Ae.pop();De=a(ie,Ve,De)}for(De=-1;++De<ie.length;){const Ve=t[ie[De][0]];Rx.call(Ve,ie[De][1].type)&&Ve[ie[De][1].type].call(Object.assign({sliceSerialize:ie[De][2].sliceSerialize},Se),ie[De][1])}if(Se.tokenStack.length>0){const Ve=Se.tokenStack[Se.tokenStack.length-1];(Ve[1]||c1).call(Se,void 0,Ve[0])}for(de.position={start:xr(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:xr(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De<t.transforms.length;)de=t.transforms[De](de)||de;return de}function a(ie,de,Se){let Ae=de-1,De=-1,Ve=!1,Ie,Nt,Ct,qt;for(;++Ae<=Se;){const st=ie[Ae];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?De++:De--,qt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Ie&&!qt&&!De&&!Ct&&(Ct=Ae),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!De&&st[0]==="enter"&&st[1].type==="listItemPrefix"||De===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(Ie){let Ln=Ae;for(Nt=void 0;Ln--;){const Ut=ie[Ln];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Nt&&(ie[Nt][1].type="lineEndingBlank",Ve=!0),Ut[1].type="lineEnding",Nt=Ln}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}Ct&&(!Nt||Ct<Nt)&&(Ie._spread=!0),Ie.end=Object.assign({},Nt?ie[Nt][1].start:st[1].end),ie.splice(Nt||Ae,0,["exit",Ie,st[2]]),Ae++,Se++}if(st[1].type==="listItemPrefix"){const Ln={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Ie=Ln,ie.splice(Ae,0,["enter",Ln,st[2]]),Ae++,Se++,Ct=void 0,qt=!0}}}return ie[de][1]._spread=Ve,Se}function l(ie,de){return Se;function Se(Ae){o.call(this,ie(Ae),Ae),de&&de.call(this,Ae)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(ie,de,Se){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([de,Se||void 0]),ie.position={start:xr(de.start),end:void 0}}function c(ie){return de;function de(Se){ie&&ie.call(this,Se),f.call(this,Se)}}function f(ie,de){const Se=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==ie.type&&(de?de.call(this,ie,Ae[0]):(Ae[1]||c1).call(this,ie,Ae[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Lo({start:ie.start,end:ie.end})+"): it’s not open");Se.position.end=xr(ie.end)}function p(){return Tg(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function _(ie){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.lang=ie}function w(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.meta=ie}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie.replace(/(\r?\n|\r)$/g,"")}function x(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase()}function y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function E(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function R(ie){const de=this.stack[this.stack.length-1];if(!de.depth){const Se=this.sliceSerialize(ie).length;de.depth=Se}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ie){const Se=this.stack[this.stack.length-1].children;let Ae=Se[Se.length-1];(!Ae||Ae.type!=="text")&&(Ae=Fe(),Ae.position={start:xr(ie.start),end:void 0},Se.push(Ae)),this.stack.push(Ae)}function B(ie){const de=this.stack.pop();de.value+=this.sliceSerialize(ie),de.position.end=xr(ie.end)}function z(ie){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=de.children[de.children.length-1];Se.position.end=xr(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(j.call(this,ie),B.call(this,ie))}function G(){this.data.atHardBreak=!0}function U(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function H(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function Y(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.value=ie}function q(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function X(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=de,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(ie){const de=this.sliceSerialize(ie),Se=this.stack[this.stack.length-2];Se.label=f4(de),Se.identifier=Jn(de).toLowerCase()}function L(){const ie=this.stack[this.stack.length-1],de=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ae=ie.children;Se.children=Ae}else Se.alt=de}function M(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.url=ie}function O(){const ie=this.resume(),de=this.stack[this.stack.length-1];de.title=ie}function $(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Q(ie){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=Jn(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function re(ie){this.data.characterReferenceType=ie.type}function ae(ie){const de=this.sliceSerialize(ie),Se=this.data.characterReferenceType;let Ae;Se?(Ae=bx(de,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=$o(de);const De=this.stack[this.stack.length-1];De.value+=Ae}function Z(ie){const de=this.stack.pop();de.position.end=xr(ie.end)}function P(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ie)}function ee(ie){B.call(this,ie);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ie)}function ne(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function Ee(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ct(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Pt(){return{type:"paragraph",children:[]}}function ht(){return{type:"strong",children:[]}}function Fe(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function xr(e){return{line:e.line,column:e.column,offset:e.offset}}function Dx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Dx(e,r):m4(e,r)}}function m4(e,t){let n;for(n in t)if(Rx.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function c1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lo({start:t.start,end:t.end})+") is still open")}function _4(e){const t=this;t.parser=n;function n(r){return p4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function v4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function y4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` -`}]}function b4(e,t){const n=t.value?t.value+` -`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function S4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=wa(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function C4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Mx(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function k4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mx(e,t);const a={src:wa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function A4(e,t){const n={src:wa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function N4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function T4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mx(e,t);const a={href:wa(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function R4(e,t){const n={href:wa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function D4(e,t,n){const r=e.all(t),a=n?M4(n):jx(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const p=r[o];(a||o!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:` -`}),p.type==="element"&&p.tagName==="p"&&!a?u.push(...p.children):u.push(p)}const c=r[r.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&u.push({type:"text",value:` -`});const f={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,f),e.applyData(t,f)}function M4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=jx(n[r])}return t}function jx(e){const t=e.spread;return t??e.children.length>1}function j4(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function L4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function B4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I4(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Eg(t.children[1]),c=fx(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function z4(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c<o;){const d=t.children[c],_={},v=u?u[c]:void 0;v&&(_.align=v);let w={type:"element",tagName:l,properties:_,children:[]};d&&(w.children=e.all(d),e.patch(d,w),w=e.applyData(d,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function H4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const u1=9,h1=32;function F4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(f1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(f1(t.slice(a),a>0,!1)),l.join("")}function f1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===u1||l===h1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===u1||l===h1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function P4(e,t){const n={type:"text",value:F4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function U4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $4={blockquote:v4,break:y4,code:b4,delete:S4,emphasis:x4,footnoteReference:w4,heading:C4,html:E4,imageReference:k4,image:A4,inlineCode:N4,linkReference:T4,link:R4,listItem:D4,list:j4,paragraph:L4,root:O4,strong:B4,table:I4,tableCell:H4,tableRow:z4,text:P4,thematicBreak:U4,toml:Hc,yaml:Hc,definition:Hc,footnoteDefinition:Hc};function Hc(){}const Lx=-1,Wu=0,Bo=1,Cu=2,Dg=3,Mg=4,jg=5,Lg=6,Ox=7,Bx=8,G4=typeof self=="object"?self:globalThis,d1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new G4[e](t)},q4=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case Wu:case Lx:return n(u,a);case Bo:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Cu:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case Dg:return n(new Date(u),a);case Mg:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case jg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case Lg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Ox:{const{name:o,message:c}=u;return n(d1(o,c),a)}case Bx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(d1(l,u),a)};return r},p1=e=>q4(new Map,e)(0),Xr="",{toString:V4}={},{keys:Y4}=Object,Ao=e=>{const t=typeof e;if(t!=="object"||!e)return[Wu,t];const n=V4.call(e).slice(8,-1);switch(n){case"Array":return[Bo,Xr];case"Object":return[Cu,Xr];case"Date":return[Dg,Xr];case"RegExp":return[Mg,Xr];case"Map":return[jg,Xr];case"Set":return[Lg,Xr];case"DataView":return[Bo,n]}return n.includes("Array")?[Bo,n]:n.includes("Error")?[Ox,n]:[Cu,n]},Fc=([e,t])=>e===Wu&&(t==="function"||t==="symbol"),W4=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=Ao(u);switch(o){case Wu:{let p=u;switch(c){case"bigint":o=Bx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Lx],u)}return a([o,p],u)}case Bo:{if(c){let _=u;return c==="DataView"?_=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(_=new Uint8Array(u)),a([c,[..._]],u)}const p=[],d=a([o,p],u);for(const _ of u)p.push(l(_));return d}case Cu:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const _ of Y4(u))(e||!Fc(Ao(u[_])))&&p.push([l(_),l(u[_])]);return d}case Dg:return a([o,isNaN(u.getTime())?Xr:u.toISOString()],u);case Mg:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case jg:{const p=[],d=a([o,p],u);for(const[_,v]of u)(e||!(Fc(Ao(_))||Fc(Ao(v))))&&p.push([l(_),l(v)]);return d}case Lg:{const p=[],d=a([o,p],u);for(const _ of u)(e||!Fc(Ao(_)))&&p.push(l(_));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},g1=(e,{json:t,lossy:n}={})=>{const r=[];return W4(!(t||n),!!t,new Map,r)(e),r},Eu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?p1(g1(e,t)):structuredClone(e):(e,t)=>p1(g1(e,t));function X4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function K4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Z4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||X4,r=e.options.footnoteBackLabel||K4,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const p=e.all(f),d=String(f.identifier).toUpperCase(),_=wa(d.toLowerCase());let v=0;const w=[],C=e.footnoteCounts.get(d);for(;C!==void 0&&++v<=C;){w.length>0&&w.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,v);typeof x=="string"&&(x={type:"text",value:x}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=p[p.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...w)}else p.push(...w);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(p,!0)};e.patch(f,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Eu(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const Xu=(function(e){if(e==null)return tR;if(typeof e=="function")return Ku(e);if(typeof e=="object")return Array.isArray(e)?Q4(e):J4(e);if(typeof e=="string")return eR(e);throw new Error("Expected function, string, or object as test")});function Q4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Ku(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function J4(e){const t=e;return Ku(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function eR(e){return Ku(t);function t(n){return n&&n.type===e}}function Ku(e){return t;function t(n,r,a){return!!(nR(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function tR(){return!0}function nR(e){return e!==null&&typeof e=="object"&&"type"in e}const Ix=[],iR=!0,Ip=!1,rR="skip";function zx(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=Xu(a),u=r?-1:1;o(e,void 0,[])();function o(c,f,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=Ix,w,C,b;if((!t||l(c,f,p[p.length-1]||void 0))&&(v=sR(n(c,p)),v[0]===Ip))return v;if("children"in c&&c.children){const S=c;if(S.children&&v[0]!==rR)for(C=(r?S.children.length:-1)+u,b=p.concat(S);C>-1&&C<S.children.length;){const x=S.children[C];if(w=o(x,C,b)(),w[0]===Ip)return w;C=typeof w[1]=="number"?w[1]:C+u}}return v}}}function sR(e){return Array.isArray(e)?e:typeof e=="number"?[iR,e]:e==null?Ix:[e]}function Og(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),zx(e,l,o,a);function o(c,f){const p=f[f.length-1],d=p?p.children.indexOf(c):void 0;return u(c,d,p)}}const zp={}.hasOwnProperty,aR={};function oR(e,t){const n=t||aR,r=new Map,a=new Map,l=new Map,u={...$4,...n.handlers},o={all:f,applyData:cR,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:c,options:n,patch:lR,wrap:hR};return Og(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:a,_=String(p.identifier).toUpperCase();d.has(_)||d.set(_,p)}}),o;function c(p,d){const _=p.type,v=o.handlers[_];if(zp.call(o.handlers,_)&&v)return v(o,p,d);if(o.options.passThrough&&o.options.passThrough.includes(_)){if("children"in p){const{children:C,...b}=p,S=Eu(b);return S.children=o.all(p),S}return Eu(p)}return(o.options.unknownHandler||uR)(o,p,d)}function f(p){const d=[];if("children"in p){const _=p.children;let v=-1;for(;++v<_.length;){const w=o.one(_[v],p);if(w){if(v&&_[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=m1(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=m1(C.value))}Array.isArray(w)?d.push(...w):d.push(w)}}}return d}}function lR(e,t){e.position&&(t.position=XT(e))}function cR(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,Eu(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function uR(e,t){const n=t.data||{},r="value"in t&&!(zp.call(n,"hProperties")||zp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hR(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:` -`});++r<e.length;)r&&n.push({type:"text",value:` -`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:` -`}),n}function m1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _1(e,t){const n=oR(e,t),r=n.one(e,void 0),a=Z4(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` -`},a),l}function fR(e,t){return e&&"run"in e?async function(n,r){const a=_1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return _1(n,{file:r,...e||t})}}function v1(e){if(e)throw e}var Kd,y1;function dR(){if(y1)return Kd;y1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var _;for(_ in f);return typeof _>"u"||e.call(f,_)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Kd=function c(){var f,p,d,_,v,w,C=arguments[0],b=1,S=arguments.length,x=!1;for(typeof C=="boolean"&&(x=C,C=arguments[1]||{},b=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});b<S;++b)if(f=arguments[b],f!=null)for(p in f)d=o(C,p),_=o(f,p),C!==_&&(x&&_&&(l(_)||(v=a(_)))?(v?(v=!1,w=d&&a(d)?d:[]):w=d&&l(d)?d:{},u(C,{name:p,newValue:c(x,w,_)})):typeof _<"u"&&u(C,{name:p,newValue:_}));return C},Kd}var pR=dR();const Zd=Pu(pR);function Hp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function gR(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...a);function o(c,...f){const p=e[++l];let d=-1;if(c){u(c);return}for(;++d<a.length;)(f[d]===null||f[d]===void 0)&&(f[d]=a[d]);a=f,p?mR(p,o)(...f):u(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function mR(e,t){let n;return r;function r(...u){const o=e.length>u.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const li={basename:_R,dirname:vR,extname:yR,join:bR,sep:"/"};function _R(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function vR(e){if(cl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function yR(e){cl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function bR(...e){let t=-1,n;for(;++t<e.length;)cl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":SR(n)}function SR(e){cl(e);const t=e.codePointAt(0)===47;let n=xR(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function xR(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function cl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wR={cwd:CR};function CR(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ER(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kR(e)}function kR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Qd=["history","path","basename","stem","extname","dirname"];class Hx{constructor(t){let n;t?Fp(t)?n={path:t}:typeof t=="string"||AR(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":wR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qd.length;){const l=Qd[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Qd.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(t){ep(t,"basename"),Jd(t,"basename"),this.path=li.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(t){b1(this.basename,"dirname"),this.path=li.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(t){if(Jd(t,"extname"),b1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=li.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Fp(t)&&(t=ER(t)),ep(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(t){ep(t,"stem"),Jd(t,"stem"),this.path=li.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new tn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Jd(e,t){if(e&&e.includes(li.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+li.sep+"`")}function ep(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function b1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function AR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NR=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),TR={}.hasOwnProperty;class Bg extends NR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=gR()}copy(){const t=new Bg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Zd(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ip("data",this.frozen),this.namespace[t]=n,this):TR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ip("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pc(t),r=this.parser||this.Parser;return tp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),tp("process",this.parser||this.Parser),np("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const o=Pc(t),c=r.parse(o);r.run(c,o,function(p,d,_){if(p||!d||!_)return f(p);const v=d,w=r.stringify(v,_);MR(w)?_.value=w:_.result=w,f(p,_)});function f(p,d){p||!d?u(p):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),tp("processSync",this.parser||this.Parser),np("processSync",this.compiler||this.Compiler),this.process(t,a),x1("processSync","process",n),r;function a(l,u){n=!0,v1(l),r=u}}run(t,n,r){S1(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,o){const c=Pc(n);a.run(t,c,f);function f(p,d,_){const v=d||t;p?o(p):u?u(v):r(void 0,v,_)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),x1("runSync","run",r),a;function l(u,o){v1(u),a=o,r=!0}}stringify(t,n){this.freeze();const r=Pc(n),a=this.compiler||this.Compiler;return np("stringify",a),S1(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(ip("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...d]=f;c(p,d)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(f.plugins),f.settings&&(a.settings=Zd(!0,a.settings,f.settings))}function o(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const d=f[p];l(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,p){let d=-1,_=-1;for(;++d<r.length;)if(r[d][0]===f){_=d;break}if(_===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const C=r[_][1];Hp(C)&&Hp(v)&&(v=Zd(!0,C,v)),r[_]=[f,v,...w]}}}}const RR=new Bg().freeze();function tp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function np(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ip(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function S1(e){if(!Hp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pc(e){return DR(e)?e:new Hx(e)}function DR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MR(e){return typeof e=="string"||jR(e)}function jR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],C1={allowDangerousHtml:!0},OR=/^(https?|ircs?|mailto|xmpp)$/i,BR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fx(e){const t=IR(e),n=zR(e);return HR(t.runSync(t.parse(n),n),e)}function IR(e){const t=e.rehypePlugins||w1,n=e.remarkPlugins||w1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C1}:C1;return RR().use(_4).use(n).use(fR,r).use(t)}function zR(e){const t=e.children||"",n=new Hx;return typeof t=="string"&&(n.value=t),n}function HR(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||FR;for(const p of BR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+LR+p.id,void 0);return Og(e,f),e3(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,d,_){if(p.type==="raw"&&_&&typeof d=="number")return u?_.children.splice(d,1):_.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let v;for(v in Yd)if(Object.hasOwn(Yd,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],C=Yd[v];(C===null||C.includes(p.tagName))&&(p.properties[v]=c(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(p,d,_)),v&&_&&typeof d=="number")return o&&p.children?_.children.splice(d,1,...p.children):_.children.splice(d,1),d}}}function FR(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||OR.test(e.slice(0,t))?e:""}function E1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function PR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function UR(e,t,n){const a=Xu((n||{}).ignore||[]),l=$R(t);let u=-1;for(;++u<l.length;)zx(e,"text",o);function o(f,p){let d=-1,_;for(;++d<p.length;){const v=p[d],w=_?_.children:void 0;if(a(v,w?w.indexOf(v):void 0,_))return;_=v}if(_)return c(f,p)}function c(f,p){const d=p[p.length-1],_=l[u][0],v=l[u][1];let w=0;const b=d.children.indexOf(f);let S=!1,x=[];_.lastIndex=0;let y=_.exec(f.value);for(;y;){const E=y.index,R={index:y.index,input:y.input,stack:[...p,f]};let N=v(...y,R);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?_.lastIndex=E+1:(w!==E&&x.push({type:"text",value:f.value.slice(w,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),w=E+y[0].length,S=!0),!_.global)break;y=_.exec(f.value)}return S?(w<f.value.length&&x.push({type:"text",value:f.value.slice(w)}),d.children.splice(b,1,...x)):x=[f],b+x.length}}function $R(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([GR(a[0]),qR(a[1])])}return t}function GR(e){return typeof e=="string"?new RegExp(PR(e),"g"):e}function qR(e){return typeof e=="function"?e:function(){return e}}const rp="phrasing",sp=["autolink","link","image","label"];function VR(){return{transforms:[JR],enter:{literalAutolink:WR,literalAutolinkEmail:ap,literalAutolinkHttp:ap,literalAutolinkWww:ap},exit:{literalAutolink:QR,literalAutolinkEmail:ZR,literalAutolinkHttp:XR,literalAutolinkWww:KR}}}function YR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:sp}]}}function WR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ap(e){this.config.enter.autolinkProtocol.call(this,e)}function XR(e){this.config.exit.autolinkProtocol.call(this,e)}function KR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ZR(e){this.config.exit.autolinkEmail.call(this,e)}function QR(e){this.exit(e)}function JR(e){UR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tD]],{ignore:["link","linkReference"]})}function eD(e,t,n,r,a){let l="";if(!Px(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!nD(n)))return!1;const u=iD(n+r);if(!u[0])return!1;const o={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function tD(e,t,n,r){return!Px(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function nD(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iD(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=E1(e,"(");let l=E1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Px(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||is(n)||Vu(n))&&(!t||n!==47)}Ux.peek=fD;function rD(){this.buffer()}function sD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aD(){this.buffer()}function oD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cD(e){this.exit(e)}function uD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hD(e){this.exit(e)}function fD(){return"["}function Ux(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function dD(){return{enter:{gfmFootnoteCallString:rD,gfmFootnoteCall:sD,gfmFootnoteDefinitionLabelString:aD,gfmFootnoteDefinition:oD},exit:{gfmFootnoteCallString:lD,gfmFootnoteCall:cD,gfmFootnoteDefinitionLabelString:uD,gfmFootnoteDefinition:hD}}}function pD(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ux},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` -`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?$x:gD))),f(),c}}function gD(e,t,n){return t===0?e:$x(e,t,n)}function $x(e,t,n){return(n?"":" ")+e}const mD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Gx.peek=SD;function _D(){return{canContainEols:["delete"],enter:{strikethrough:yD},exit:{strikethrough:bD}}}function vD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mD}],handlers:{delete:Gx}}}function yD(e){this.enter({type:"delete",children:[]},e)}function bD(e){this.exit(e)}function Gx(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function SD(){return"~"}function xD(e){return e.length}function wD(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||xD,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++p<e.length;){const C=[],b=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const x=CD(e[p][S]);if(n.alignDelimiters!==!1){const y=a(x);b[S]=y,(c[S]===void 0||y>c[S])&&(c[S]=y)}C.push(x)}u[p]=C,o[p]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)l[d]=k1(r[d]);else{const C=k1(r);for(;++d<f;)l[d]=C}d=-1;const _=[],v=[];for(;++d<f;){const C=l[d];let b="",S="";C===99?(b=":",S=":"):C===108?b=":":C===114&&(S=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-b.length-S.length);const y=b+"-".repeat(x)+S;n.alignDelimiters!==!1&&(x=b.length+x+S.length,x>c[d]&&(c[d]=x),v[d]=x),_[d]=y}u.splice(1,0,_),o.splice(1,0,v),p=-1;const w=[];for(;++p<u.length;){const C=u[p],b=o[p];d=-1;const S=[];for(;++d<f;){const x=C[d]||"";let y="",E="";if(n.alignDelimiters!==!1){const R=c[d]-(b[d]||0),N=l[d];N===114?y=" ".repeat(R):N===99?R%2?(y=" ".repeat(R/2+.5),E=" ".repeat(R/2-.5)):(y=" ".repeat(R/2),E=y):E=" ".repeat(R)}n.delimiterStart!==!1&&!d&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&S.push(" "),n.alignDelimiters!==!1&&S.push(y),S.push(x),n.alignDelimiters!==!1&&S.push(E),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&S.push("|")}w.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(` -`)}function CD(e){return e==null?"":String(e)}function k1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ED(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),kD);return a(),u}function kD(e,t,n){return">"+(n?"":" ")+e}function AD(e,t){return A1(e,t.inConstruct,!0)&&!A1(e,t.notInConstruct,!1)}function A1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function N1(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===` -`&&AD(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\ -`}function ND(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function TD(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function RD(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function DD(e,t,n,r){const a=RD(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(TD(e,n)){const d=n.enter("codeIndented"),_=n.indentLines(l,MD);return d(),_}const o=n.createTracker(r),c=a.repeat(Math.max(ND(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` -`,encode:["`"],...o.current()})),d()}return p+=o.move(` -`),l&&(p+=o.move(l+` -`)),p+=o.move(c),f(),p}function MD(e,t,n){return(n?"":" ")+e}function Ig(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jD(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function LD(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Go(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ku(e,t,n){const r=fa(e),a=fa(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qx.peek=OD;function qx(e,t,n,r){const a=LD(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function OD(e,t,n){return n.options.emphasis||"*"}function BD(e,t){let n=!1;return Og(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ip}),!!((!e.depth||e.depth<3)&&Tg(e)&&(t.options.setext||n))}function ID(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(BD(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:` -`,after:` -`});return d(),p(),_+` -`+(a===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(` -`))+1))}const u="#".repeat(a),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(u+" ");let f=n.containerPhrasing(e,{before:"# ",after:` -`,...l.current()});return/^[\t ]/.test(f)&&(f=Go(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}Vx.peek=zD;function Vx(e){return e.value||""}function zD(){return"<"}Yx.peek=HD;function Yx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function HD(){return"!"}Wx.peek=FD;function Wx(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function FD(){return"!"}Xx.peek=PD;function Xx(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],o=n.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return a+r+a}function PD(){return"`"}function Kx(e,t){const n=Tg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Zx.peek=UD;function Zx(e,t,n,r){const a=Ig(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(Kx(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function UD(e,t,n){return Kx(e,n)?"<":"["}Qx.peek=$D;function Qx(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $D(){return"["}function zg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function GD(e){const t=zg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function qD(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Jx(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function VD(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?qD(n):zg(n);const o=e.ordered?u==="."?")":".":GD(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Jx(n)===u&&p){let d=-1;for(;++d<e.children.length;){const _=e.children[d];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),n.bulletCurrent=u;const f=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),f}function YD(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function WD(e,t,n,r){const a=YD(n);let l=n.bulletCurrent||zg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,_,v){return _?(v?"":" ".repeat(u))+d:(v?l:l+" ".repeat(u-l.length))+d}}function XD(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const KD=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZD(e,t,n,r){return(e.children.some(function(u){return KD(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function QD(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ew.peek=JD;function ew(e,t,n,r){const a=QD(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=ku(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Go(f)+c.slice(1));const d=c.charCodeAt(c.length-1),_=ku(r.after.charCodeAt(0),d,a);_.inside&&(c=c.slice(0,-1)+Go(d));const v=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},o+c+v}function JD(e,t,n){return n.options.strong||"*"}function eM(e,t,n,r){return n.safe(e.value,r)}function tM(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nM(e,t,n){const r=(Jx(n)+(n.options.ruleSpaces?" ":"")).repeat(tM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const tw={blockquote:ED,break:N1,code:DD,definition:jD,emphasis:qx,hardBreak:N1,heading:ID,html:Vx,image:Yx,imageReference:Wx,inlineCode:Xx,link:Zx,linkReference:Qx,list:VD,listItem:WD,paragraph:XD,root:ZD,strong:ew,text:eM,thematicBreak:nM};function iM(){return{enter:{table:rM,tableData:T1,tableHeader:T1,tableRow:aM},exit:{codeText:oM,table:sM,tableData:op,tableHeader:op,tableRow:op}}}function rM(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function sM(e){this.exit(e),this.data.inTable=void 0}function aM(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function T1(e){this.enter({type:"tableCell",children:[]},e)}function oM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lM(e,t){return t==="|"?t:e}function cM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:u,tableCell:c,tableRow:o}};function u(v,w,C,b){return f(p(v,C,b),v.align)}function o(v,w,C,b){const S=d(v,C,b),x=f([S]);return x.slice(0,x.indexOf(` -`))}function c(v,w,C,b){const S=C.enter("tableCell"),x=C.enter("phrasing"),y=C.containerPhrasing(v,{...b,before:l,after:l});return x(),S(),y}function f(v,w){return wD(v,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function p(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("table");for(;++S<b.length;)x[S]=d(b[S],w,C);return y(),x}function d(v,w,C){const b=v.children;let S=-1;const x=[],y=w.enter("tableRow");for(;++S<b.length;)x[S]=c(b[S],v,w,C);return y(),x}function _(v,w,C){let b=tw.inlineCode(v,w,C);return C.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function uM(){return{exit:{taskListCheckValueChecked:R1,taskListCheckValueUnchecked:R1,paragraph:fM}}}function hM(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dM}}}function R1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fM(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const o=a[l];if(o.type==="paragraph"){u=o;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function dM(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(u);let c=tw.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(p){return p+u}}function pM(){return[VR(),dD(),_D(),iM(),uM()]}function gM(e){return{extensions:[YR(),pD(e),vD(),cM(e),hM()]}}const mM={tokenize:xM,partial:!0},nw={tokenize:wM,partial:!0},iw={tokenize:CM,partial:!0},rw={tokenize:EM,partial:!0},_M={tokenize:kM,partial:!0},sw={name:"wwwAutolink",tokenize:bM,previous:ow},aw={name:"protocolAutolink",tokenize:SM,previous:lw},Gi={name:"emailAutolink",tokenize:yM,previous:cw},fi={};function vM(){return{text:fi}}let Wr=48;for(;Wr<123;)fi[Wr]=Gi,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);fi[43]=Gi;fi[45]=Gi;fi[46]=Gi;fi[95]=Gi;fi[72]=[Gi,aw];fi[104]=[Gi,aw];fi[87]=[Gi,sw];fi[119]=[Gi,sw];function yM(e,t,n){const r=this;let a,l;return u;function u(d){return!Pp(d)||!cw.call(r,r.previous)||Hg(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return Pp(d)?(e.consume(d),o):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(_M,p,f)(d):d===45||d===95||en(d)?(l=!0,e.consume(d),c):p(d)}function f(d){return e.consume(d),a=!0,c}function p(d){return l&&a&&sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function bM(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!ow.call(r,r.previous)||Hg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mM,e.attempt(nw,e.attempt(iw,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function SM(e,t,n){const r=this;let a="",l=!1;return u;function u(d){return(d===72||d===104)&&lw.call(r,r.previous)&&!Hg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(sn(d)&&a.length<5)return a+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const _=a.toLowerCase();if(_==="http"||_==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),l?f:(l=!0,c)):n(d)}function f(d){return d===null||wu(d)||yt(d)||is(d)||Vu(d)?n(d):e.attempt(nw,e.attempt(iw,p),n)(d)}function p(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function xM(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function wM(e,t,n){let r,a,l;return u;function u(f){return f===46||f===95?e.check(rw,c,o)(f):f===null||yt(f)||is(f)||f!==45&&Vu(f)?c(f):(l=!0,e.consume(f),u)}function o(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),u}function c(f){return a||r||!l?n(f):t(f)}}function CM(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(rw,t,l)(u):u===null||yt(u)||is(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function EM(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),a):o===60||o===null||yt(o)||is(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||yt(o)||is(o)?t(o):r(o)}function l(o){return sn(o)?u(o):n(o)}function u(o){return o===59?(e.consume(o),r):sn(o)?(e.consume(o),u):n(o)}}function kM(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return en(l)?n(l):t(l)}}function ow(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function lw(e){return!sn(e)}function cw(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||en(e)}function Hg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const AM={tokenize:OM,partial:!0};function NM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:MM,continuation:{tokenize:jM},exit:LM}},text:{91:{name:"gfmFootnoteCall",tokenize:DM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TM,resolveTo:RM}}}}function TM(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function RM(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function DM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||yt(d))return n(d);if(d===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return yt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function MM(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(u>999||w===93&&!o||w===null||w===91||yt(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return yt(w)||(o=!0),u++,e.consume(w),w===92?d:p}function d(w){return w===91||w===92||w===93?(e.consume(w),u++,p):p(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(l)||a.push(l),et(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function jM(e,t,n){return e.check(ll,t,e.attempt(AM,t,n))}function LM(e){e.exit("gfmFootnoteDefinition")}function OM(e,t,n){const r=this;return et(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function BM(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let f=c;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[c][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[c][1].end)},d={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[c][1].start)},_=[["enter",p,o],["enter",u[f][1],o],["exit",u[f][1],o],["enter",d,o]],v=o.parser.constructs.insideSpan.null;v&&Tn(_,_.length,0,Yu(v,u.slice(f+1,c),o)),Tn(_,_.length,0,[["exit",d,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",p,o]]),Tn(u,f-1,c-f+3,_),c=f+_.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function l(u,o,c){const f=this.previous,p=this.events;let d=0;return _;function _(w){return f===126&&p[p.length-1][1].type!=="characterEscape"?c(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const C=fa(f);if(w===126)return d>1?c(w):(u.consume(w),d++,v);if(d<2&&!n)return c(w);const b=u.exit("strikethroughSequenceTemporary"),S=fa(w);return b._open=!S||S===2&&!!C,b._close=!C||C===2&&!!S,o(w)}}}class IM{constructor(){this.map=[]}add(t,n,r){zM(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function zM(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function HM(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function FM(){return{flow:{null:{name:"table",tokenize:PM,resolveAll:UM}}}}function PM(e,t,n){const r=this;let a=0,l=0,u;return o;function o(B){let z=r.events.length-1;for(;z>-1;){const H=r.events[z][1].type;if(H==="lineEnding"||H==="linePrefix")z--;else break}const G=z>-1?r.events[z][1].type:null,U=G==="tableHead"||G==="tableRow"?N:c;return U===N&&r.parser.lazy[r.now().line]?n(B):U(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Oe(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):n(B):Xe(B)?et(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||yt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?_:d)}function _(B){return B===92||B===124?(e.consume(B),d):d(B)}function v(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Xe(B)?et(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):w(B))}function w(B){return B===45||B===58?b(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),C):R(B)}function C(B){return Xe(B)?et(e,b,"whitespace")(B):b(B)}function b(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(l+=1,S(B)):B===null||Oe(B)?E(B):R(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):R(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(B))}function y(B){return Xe(B)?et(e,E,"whitespace")(B):E(B)}function E(B){return B===124?w(B):B===null||Oe(B)?!u||a!==l?R(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):R(B)}function R(B){return n(B)}function N(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||Oe(B)?(e.exit("tableRow"),t(B)):Xe(B)?et(e,D,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||yt(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function UM(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const _=new IM;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(o=!1,c!==0&&(D1(_,t,c,f,p),p=void 0,c=0),f={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",f,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],u=[0,n+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(n,0,[["enter",p,t]])),a=w.type==="tableDelimiterRow"?2:p?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],d=Uc(_,t,l,a,void 0,d)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(o=!0,c=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(c=n,l[1]!==0?(u[0]=u[1],d=Uc(_,t,l,a,n,d)):u[1]!==0&&(d=Uc(_,t,u,a,n,d)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(c!==0&&D1(_,t,c,f,p),_.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=HM(t.events,n))}return e}function Uc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},na(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=na(t.events,n[1]);if(l={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const f=na(t.events,n[2]),p=na(t.events,n[3]),d={type:o,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const _=t.events[n[2]],v=t.events[n[3]];if(_[1].end=Object.assign({},v[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},na(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function D1(e,t,n,r,a){const l=[],u=na(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function na(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $M={name:"tasklistCheck",tokenize:qM};function GM(){return{text:{91:$M}}}function qM(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return yt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Oe(c)?t(c):Xe(c)?e.check({tokenize:VM},t,n)(c):n(c)}}function VM(e,t,n){return et(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function YM(e){return yx([vM(),NM(),BM(e),FM(),GM()])}const WM={};function uw(e){const t=this,n=e||WM,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(YM(n)),l.push(pM()),u.push(gM(n))}const XM={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},KM={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Up(e){const t=e.trim().toLowerCase();return XM[t]??t}function hw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=KM[t];if(n)return Up(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Up(t.slice(r+1))}di.displayName="clike";di.aliases=[];function di(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}ul.displayName="c";ul.aliases=[];function ul(e){e.register(di),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}Zu.displayName="cpp";Zu.aliases=[];function Zu(e){e.register(ul),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Fg.displayName="arduino";Fg.aliases=["ino"];function Fg(e){e.register(Zu),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Pg.displayName="bash";Pg.aliases=["sh","shell"];function Pg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o<l.length;o++)u[l[o]]=t.languages.bash[l[o]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}Ug.displayName="csharp";Ug.aliases=["cs","dotnet"];function Ug(e){e.register(di),(function(t){function n(M,O){return M.replace(/<<(\d+)>>/g,function($,F){return"(?:"+O[+F]+")"})}function r(M,O,$){return RegExp(n(M,O),"")}function a(M,O){for(var $=0;$<O;$++)M=M.replace(/<<self>>/g,function(){return"(?:"+M+")"});return M.replace(/<<self>>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),_=a(/\((?:[^()]|<<self>>)*\)/.source,2),v=/@?\b[A-Za-z_]\w*\b/.source,w=n(/<<0>>(?:\s*<<1>>)?/.source,[v,d]),C=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,w]),b=/\[\s*(?:,\s*)*\]/.source,S=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[C,b]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,_,b]),y=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,C,b]),R={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,D=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[D]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[v,E]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[v]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,w]),lookbehind:!0,inside:R},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[C]),lookbehind:!0,inside:R},{pattern:r(/(\bwhere\s+)<<0>>/.source,[v]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[S]),lookbehind:!0,inside:R},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,v]),inside:R}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[v]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[v]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[_]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,C]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[v,d]),inside:{function:r(/^<<0>>/.source,[v]),generic:{pattern:RegExp(d),alias:"class-name",inside:R}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,w,v,E,c.source,_,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,_]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=D+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),z=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),G=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[C,z]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[G,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[G]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[z]),inside:t.languages.csharp},"class-name":{pattern:RegExp(C),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var H=/:[^}\r\n]+/.source,Y=a(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[B]),2),q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,H]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,H]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,H]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[q]),lookbehind:!0,greedy:!0,inside:L(q,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}hl.displayName="markup";hl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function hl(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ca.displayName="css";Ca.aliases=[];function Ca(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}$g.displayName="diff";$g.aliases=[];function $g(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r -?| -|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}Gg.displayName="go";Gg.aliases=[];function Gg(e){e.register(di),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}qg.displayName="ini";qg.aliases=[];function qg(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}Vg.displayName="java";Vg.aliases=[];function Vg(e){e.register(di),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}Yg.displayName="regex";Yg.aliases=[];function Yg(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":c}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(e)}Qu.displayName="javascript";Qu.aliases=["js"];function Qu(e){e.register(di),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}Wg.displayName="json";Wg.aliases=["webmanifest"];function Wg(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}Xg.displayName="kotlin";Xg.aliases=["kt","kts"];function Xg(e){e.register(di),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}Kg.displayName="less";Kg.aliases=[];function Kg(e){e.register(Ca),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}Zg.displayName="lua";Zg.aliases=[];function Zg(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}Qg.displayName="makefile";Qg.aliases=[];function Qg(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}Jg.displayName="yaml";Jg.aliases=["yml"];function Jg(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<value>>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return a}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}em.displayName="markdown";em.aliases=["md"];function em(e){e.register(hl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p<d;p++){var _=f[p];if(_.type!=="code"){c(_.content);continue}var v=_.content[1],w=_.content[3];if(v&&w&&v.type==="code-language"&&w.type==="code-block"&&typeof v.content=="string"){var C=v.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase();var b="language-"+C;w.alias?typeof w.alias=="string"?w.alias=[w.alias,b]:w.alias.push(b):w.alias=[b]}}}c(o.tokens)}),t.hooks.add("wrap",function(o){if(o.type==="code-block"){for(var c="",f=0,p=o.classes.length;f<p;f++){var d=o.classes[f],_=/language-(.+)/.exec(d);if(_){c=_[1];break}}var v=t.languages[c];if(v)o.content=t.highlight(o.content.value,v,c);else if(c&&c!=="none"&&t.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);o.attributes.id=w,t.plugins.autoloader.loadLanguages(c,function(){var C=document.getElementById(w);C&&(C.innerHTML=t.highlight(C.textContent,t.languages[c],c))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}tm.displayName="objectivec";tm.aliases=["objc"];function tm(e){e.register(ul),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}nm.displayName="perl";nm.aliases=[];function nm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Ju.displayName="markup-templating";Ju.aliases=[];function Ju(e){e.register(hl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f<c.length&&!(l>=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],_=r.tokenStack[d],v=typeof p=="string"?p:p.content,w=n(a,d),C=v.indexOf(w);if(C>-1){++l;var b=v.substring(0,C),S=new t.Token(a,t.tokenize(_,r.grammar),"language-"+a,_),x=v.substring(C+w.length),y=[];b&&y.push.apply(y,o([b])),y.push(S),x&&y.push.apply(y,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(y)):p.content=y}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}im.displayName="php";im.aliases=[];function im(e){e.register(Ju),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}rm.displayName="python";rm.aliases=["py"];function rm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}sm.displayName="r";sm.aliases=[];function sm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}am.displayName="ruby";am.aliases=["rb"];function am(e){e.register(di),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}om.displayName="rust";om.aliases=[];function om(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}lm.displayName="sass";lm.aliases=[];function lm(e){e.register(Ca),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}cm.displayName="scss";cm.aliases=[];function cm(e){e.register(Ca),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}um.displayName="sql";um.aliases=[];function um(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}hm.displayName="swift";hm.aliases=[];function hm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}fm.displayName="typescript";fm.aliases=["ts"];function fm(e){e.register(Qu),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}eh.displayName="basic";eh.aliases=[];function eh(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}dm.displayName="vbnet";dm.aliases=[];function dm(e){e.register(eh),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const M1=/[#.]/g;function ZM(e,t){const n=e||"",r={};let a=0,l,u;for(;a<n.length;){M1.lastIndex=a;const o=M1.exec(n),c=n.slice(a,o?o.index:n.length);c&&(l?l==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:u=c,a+=c.length),o&&(l=o[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function fw(e,t,n){const r=n?tj(n):void 0;function a(l,u,...o){let c;if(l==null){c={type:"root",children:[]};const f=u;o.unshift(f)}else{c=ZM(l,t);const f=c.tagName.toLowerCase(),p=r?r.get(f):void 0;if(c.tagName=p||f,QM(u))o.unshift(u);else for(const[d,_]of Object.entries(u))JM(e,c.properties,d,_)}for(const f of o)$p(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return a}function QM(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const l=a;for(const u of l)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function JM(e,t,n,r){const a=ux(e,n);let l;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;l=r}else typeof r=="boolean"?l=r:typeof r=="string"?a.spaceSeparated?l=Vy(r):a.commaSeparated?l=Py(r):a.commaOrSpaceSeparated?l=Vy(Py(r).join(" ")):l=j1(a,a.property,r):Array.isArray(r)?l=[...r]:l=a.property==="style"?ej(r):String(r);if(Array.isArray(l)){const u=[];for(const o of l)u.push(j1(a,a.property,o));l=u}a.property==="className"&&Array.isArray(t.className)&&(l=t.className.concat(l)),t[a.property]=l}}function $p(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)$p(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$p(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function j1(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Po(n)===Po(t)))return!0}return n}function ej(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function tj(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const nj=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],ij=fw(hx,"div");fw(qu,"g",nj);const rj=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],L1={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function dw(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function sj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function aj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function O1(e){return aj(e)||dw(e)}const oj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function lj(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,_=w(),v;for(l--;++l<=e.length;)if(v===10&&(d=(f?f[u]:0)||1),v=e.charCodeAt(l),v===38){const S=e.charCodeAt(l+1);if(S===9||S===10||S===12||S===32||S===38||S===60||Number.isNaN(S)||r&&S===r){o+=String.fromCharCode(v),d++;continue}const x=l+1;let y=x,E=x,R;if(S===35){E=++y;const U=e.charCodeAt(E);U===88||U===120?(R="hexadecimal",E=++y):R="decimal"}else R="named";let N="",D="",T="";const j=R==="named"?O1:R==="decimal"?dw:sj;for(E--;++E<=e.length;){const U=e.charCodeAt(E);if(!j(U))break;T+=String.fromCharCode(U),R==="named"&&rj.includes(T)&&(N=T,D=$o(T))}let B=e.charCodeAt(E)===59;if(B){E++;const U=R==="named"?$o(T):!1;U&&(N=T,D=U)}let z=1+E-x,G="";if(!(!B&&n.nonTerminated===!1))if(!T)R!=="named"&&C(4,z);else if(R==="named"){if(B&&!D)C(5,1);else if(N!==T&&(E=y+N.length,z=1+E-y,B=!1),!B){const U=N?1:3;if(n.attribute){const H=e.charCodeAt(E);H===61?(C(U,z),D=""):O1(H)?D="":C(U,z)}else C(U,z)}G=D}else{B||C(2,z);let U=Number.parseInt(T,R==="hexadecimal"?16:10);if(cj(U))C(7,z),G="�";else if(U in L1)C(6,z),G=L1[U];else{let H="";uj(U)&&C(6,z),U>65535&&(U-=65536,H+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),G=H+String.fromCharCode(U)}}if(G){b(),_=w(),l=E-1,d+=E-x+1,a.push(G);const U=w();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,G,{start:_,end:U},e.slice(x-1,E)),_=U}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else v===10&&(p++,u++,d=0),Number.isNaN(v)?b():(o+=String.fromCharCode(v),d++);return a.join("");function w(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function C(S,x){let y;n.warning&&(y=w(),y.column+=x,y.offset+=x,n.warning.call(n.warningContext||void 0,oj[S],y,S))}function b(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:_,end:w()}),o="")}}function cj(e){return e>=55296&&e<=57343||e>1114111}function uj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var hj=0,$c={},Yt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++hj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Yt.util.type(t)){case"Object":if(a=Yt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Yt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:$c,plaintext:$c,text:$c,txt:$c,extend:function(e,t){var n=Yt.util.clone(Yt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Yt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Yt.languages.DFS(Yt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Yt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Yt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Yt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Yt.tokenize(r.code,r.grammar),Yt.hooks.run("after-tokenize",r),Io.stringify(Yt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new fj;return hu(a,a.head,e),pw(e,a,t,a.head,0),pj(a)},hooks:{all:{},add:function(e,t){var n=Yt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Yt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:Io};function Io(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function B1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function pw(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c<o.length;++c){if(l&&l.cause==u+","+c)return;var f=o[c],p=f.inside,d=!!f.lookbehind,_=!!f.greedy,v=f.alias;if(_&&!f.pattern.global){var w=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,w+"g")}for(var C=f.pattern||f,b=r.next,S=a;b!==t.tail&&!(l&&S>=l.reach);S+=b.value.length,b=b.next){var x=b.value;if(t.length>e.length)return;if(!(x instanceof Io)){var y=1,E;if(_){if(E=B1(C,S,e,d),!E||E.index>=e.length)break;var T=E.index,R=E.index+E[0].length,N=S;for(N+=b.value.length;T>=N;)b=b.next,N+=b.value.length;if(N-=b.value.length,S=N,b.value instanceof Io)continue;for(var D=b;D!==t.tail&&(N<R||typeof D.value=="string");D=D.next)y++,N+=D.value.length;y--,x=e.slice(S,N),E.index-=S}else if(E=B1(C,0,x,d),!E)continue;var T=E.index,j=E[0],B=x.slice(0,T),z=x.slice(T+j.length),G=S+x.length;l&&G>l.reach&&(l.reach=G);var U=b.prev;B&&(U=hu(t,U,B),S+=B.length),dj(t,U,y);var H=new Io(u,p?Yt.tokenize(j,p):j,v,j);if(b=hu(t,U,H),z&&hu(t,b,z),y>1){var Y={cause:u+","+c,reach:G};pw(e,t,n,b.prev,S,Y),l&&Y.reach>l.reach&&(l.reach=Y.reach)}}}}}}function fj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function hu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function dj(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}function pj(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const gw=Yt;function mw(){}mw.prototype=gw;const je=new mw;je.highlight=gj;je.register=mj;je.alias=_j;je.registered=vj;je.listLanguages=yj;je.util.encode=bj;je.Token.stringify=Gp;function gj(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(je.languages,r))n=je.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:gw.highlight.call(je,e,n,r)}}function mj(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(je.languages,e.displayName)||e(je)}function _j(e,t){const n=je.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let a;for(a in r)if(Object.hasOwn(r,a)){const l=r[a],u=typeof l=="string"?[l]:l;let o=-1;for(;++o<u.length;)n[u[o]]=n[a]}}function vj(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(je.languages,e)}function yj(){const e=je.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Gp(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let a=-1;for(;++a<e.length;)e[a]!==null&&e[a]!==void 0&&e[a]!==""&&r.push(Gp(e[a],t));return r}const n={attributes:{},classes:["token",e.type],content:Gp(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),je.hooks.run("wrap",n),ij(n.tag+"."+n.classes.join("."),Sj(n.attributes),n.content)}function bj(e){return e}function Sj(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=lj(e[t]));return e}je.register(di);je.register(ul);je.register(Zu);je.register(Fg);je.register(Pg);je.register(Ug);je.register(hl);je.register(Ca);je.register($g);je.register(Gg);je.register(qg);je.register(Vg);je.register(Yg);je.register(Qu);je.register(Wg);je.register(Xg);je.register(Kg);je.register(Zg);je.register(Qg);je.register(Jg);je.register(em);je.register(tm);je.register(nm);je.register(Ju);je.register(im);je.register(rm);je.register(sm);je.register(am);je.register(om);je.register(lm);je.register(cm);je.register(um);je.register(hm);je.register(fm);je.register(eh);je.register(dm);function _w(e,t){var n;return e.type==="text"?e.value??"":e.type!=="element"?null:m.jsx("span",{className:(((n=e.properties)==null?void 0:n.className)??[]).join(" "),children:(e.children??[]).map(_w)},t)}function vw(e,t,n=3e5){if(!t||!je.registered(t)||e.length>n)return e;try{return je.highlight(e,t).children.map(_w)}catch{return e}}const xj=1e5;function wj({code:e,lang:t}){const[n,r]=V.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return m.jsxs("div",{className:"md-code",children:[m.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})}),m.jsx("pre",{children:m.jsx("code",{children:vw(e,t,xj)})})]})}function Cj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function Ej(e){const t=/<file\b([^>]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Cj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(r<e.length&&n.push({type:"text",value:e.slice(r)}),n):null}function yw(e){const t=e.children;if(t)for(let n=0;n<t.length;n+=1){const r=t[n];if(r){if(r.type==="html"&&typeof r.value=="string"){const a=Ej(r.value);if(a){t.splice(n,1,...a),n+=a.length-1;continue}}yw(r)}}}function kj(){return e=>yw(e)}function I1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return m.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[m.jsx(US,{size:12}),m.jsx("span",{className:"file-chip-label",children:l})]})}function Aj(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const bw={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` -`)))return m.jsx("code",{className:a,...r,children:n});const c=l?Up(l[1]):null;return m.jsx(wj,{code:u,lang:c})},pre:({children:e})=>m.jsx(m.Fragment,{children:e})};function qo({text:e,onOpenFile:t}){const n={"file-mention":r=>m.jsx(I1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&Aj(a)&&t?m.jsx(I1,{path:decodeURI(a),onOpenFile:t}):m.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...bw};return m.jsx("div",{className:"md",children:m.jsx(Fx,{remarkPlugins:[uw,kj],components:n,children:e})})}function Nj({synthesized:e,onView:t,onApprove:n,onReject:r,onRevise:a}){const[l,u]=V.useState(!1),o=V.useRef(null),[c,f]=V.useState(!1),[p,d]=V.useState(""),_=V.useRef(null);V.useEffect(()=>{if(!l)return;const w=C=>{o.current&&!o.current.contains(C.target)&&u(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[l]),V.useEffect(()=>{var w;c&&((w=_.current)==null||w.focus())},[c]);const v=()=>{a(p.trim()||"no specific feedback — use your judgment"),d(""),f(!1)};return m.jsxs("div",{className:"plan-strip",children:[m.jsxs("div",{className:"plan-strip-info",children:[m.jsx(VS,{size:14,className:"plan-strip-icon"}),m.jsx("span",{className:"plan-strip-title",children:e?"Claude is ready to proceed":"Claude proposed a plan"}),m.jsx("button",{className:"plan-strip-open",onClick:t,children:"Open plan"})]}),c?m.jsxs(m.Fragment,{children:[m.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:p,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),d(""),f(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),v())}}),m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:()=>{d(""),f(!1)},children:"Back"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:v,children:["Revise",m.jsx(FS,{size:13})]})]})]}):m.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[m.jsx("button",{className:"btn-ghost",onClick:r,children:"Reject"}),m.jsx("button",{className:"btn-ghost",onClick:()=>f(!0),children:"Revise…"}),m.jsx("span",{className:"plan-strip-spacer"}),m.jsxs("div",{className:"plan-strip-approve",ref:o,children:[m.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>n("auto"),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>u(w=>!w),children:m.jsx(cs,{size:13})}),l&&m.jsx("div",{className:"plan-strip-menu",children:m.jsx("button",{onClick:()=>{u(!1),n("bypass")},children:"Accept and bypass all"})})]})]})]})}function Sw({onSaved:e}){const[t,n]=V.useState(""),[r,a]=V.useState(!1),[l,u]=V.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await cT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return m.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[m.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),m.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),m.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&m.jsx("div",{className:"error",children:l})]})}function Tj(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function Rj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[m.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),m.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),m.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),m.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),m.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),m.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),m.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function Dj({size:e=16}){return m.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),m.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),m.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),m.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),m.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),m.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),m.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),m.jsxs("defs",{children:[m.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),m.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#BFF9B4"}),m.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),m.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[m.jsx("stop",{stopColor:"#80EE64"}),m.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),m.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),m.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),m.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),m.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),m.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Mj({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:m.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function pm({size:e=16}){return m.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:m.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function xw({kind:e,size:t=16}){switch(e){case"modal_job":return m.jsx(Dj,{size:t});case"hf_job":return m.jsx(Rj,{size:t});case"k8s_job":return m.jsx(Mj,{size:t});case"ssh_job":return m.jsx(Ap,{size:t});case"slurm_job":return m.jsx(AA,{size:t});case"openresearch_job":return m.jsx(LA,{size:t});case"local_job":return m.jsx(oN,{size:t});default:return m.jsx(Ap,{size:t})}}function jj({backend:e}){const t=tx(e),n=nx(e);return t?m.jsxs("span",{className:"backend-badge",children:[m.jsx(xw,{kind:t}),m.jsx("span",{className:"backend-name",children:Tj(t)}),n&&m.jsx("span",{className:"backend-detail mono",children:n})]}):m.jsx("span",{className:"backend-badge muted",children:"—"})}const z1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function Lj(e){return z1[e]??z1.idle}function Vo({status:e,label:t}){const n=Lj(e);return m.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[m.jsx("span",{className:"dot"}),t??e]})}function lp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function Oj({h:e}){return e.authMethod?m.jsx(m.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):m.jsx(m.Fragment,{children:"—"})}function Bj(){const[e,t]=V.useState(null),[n,r]=V.useState("claude-code"),[a,l]=V.useState(!1),u=c=>{l(!0),wg(c).then(t).catch(()=>{}).finally(()=>l(!1))};V.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Harnesses"}),m.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),m.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>m.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,m.jsx("span",{className:`harness-dot ${lp(c).cls}`})]},c.id))}),e?o?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("span",{className:`badge ${lp(o).cls}`,children:lp(o).label}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Binary"}),m.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),m.jsx("span",{className:"k",children:"Version"}),m.jsx("span",{className:"v",children:o.version??"—"}),m.jsx("span",{className:"k",children:"Auth"}),m.jsx("span",{className:"v",children:m.jsx(Oj,{h:o})}),o.account&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),m.jsx("span",{className:"v",children:o.account})]}),o.org&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Org"}),m.jsx("span",{className:"v",children:o.org})]}),o.plan&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Plan"}),m.jsx("span",{className:"v",children:o.plan})]}),m.jsx("span",{className:"k",children:"Agent models"}),m.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>xu(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&m.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function Ij({s:e}){if(!e.configured)return m.jsx("span",{className:"badge",children:"not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"no job-create permission"}):m.jsx("span",{className:"badge err",children:"cluster unreachable"}):m.jsx("span",{className:"badge err",children:"kubectl not found"})}function zj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(""),[c,f]=V.useState(!1),[p,d]=V.useState(null),_=C=>{t(C),l(C.context??""),o(C.namespace)};V.useEffect(()=>{$N().then(_).catch(C=>r(C instanceof Error?C.message:String(C)))},[]);const v=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function w(C){if(C.preventDefault(),!c){f(!0),d(null);try{_(await GN({context:a,namespace:u.trim()}))}catch(b){d(b instanceof Error?b.message:String(b))}finally{f(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",m.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Cluster"}),m.jsx("span",{className:"v",children:m.jsx(Ij,{s:e})})]}),e.preflight.error&&m.jsx("p",{className:"settings-note",children:e.preflight.error}),m.jsxs("form",{className:"form settings-form",onSubmit:w,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Context",m.jsxs("select",{value:a,onChange:C=>l(C.target.value),children:[m.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(C=>m.jsx("option",{value:C,children:C},C))]})]}),m.jsxs("label",{children:["Namespace",m.jsx("input",{className:"mono",type:"text",value:u,onChange:C=>o(C.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&m.jsx("div",{className:"error",children:p}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:c||v,children:c?"Saving…":"Save"})})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("div",{className:"settings-card-head",children:m.jsx("h3",{children:"Run manifest"})}),m.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",m.jsx("code",{children:".orx/k8s.yaml"}),", or ",m.jsx("code",{children:"--manifest <path>"}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",m.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",m.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",m.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",m.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const Hj={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function Fj({s:e}){return e.ready?m.jsx("span",{className:"badge ok",children:"connected"}):!e.tokenConfigured&&!e.modalImportable?m.jsx("span",{className:"badge",children:"not set up"}):e.modalImportable?e.tokenConfigured?m.jsx("span",{className:"badge",children:"unknown"}):m.jsx("span",{className:"badge err",children:"no token"}):m.jsx("span",{className:"badge err",children:e.envProvisioned?"env broken":"env not built"})}function Pj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[u,o]=V.useState(null);V.useEffect(()=>{qN().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await VN())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",m.jsx("code",{children:"--backend modal --flavor <name>"})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(Fj,{s:e})}),m.jsx("span",{className:"k",children:"Environment"}),m.jsx("span",{className:"v",children:e.modalImportable?"ready":e.envProvisioned?"provisioned (modal import failing)":"not built yet"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.tokenSource?Hj[e.tokenSource]:"not configured"})]}),!e.tokenConfigured&&m.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",m.jsx("code",{children:"modal token new"}),", or add"," ",m.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",m.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&m.jsx("p",{className:"settings-note",children:e.error}),u&&m.jsx("div",{className:"error",children:u}),!e.modalImportable&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function Uj({test:e}){if(e===void 0)return m.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return m.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"});return m.jsxs(m.Fragment,{children:[t,m.jsx("span",{className:"ssh-tested-at",children:Sa(e.testedAt)})]})}function $j(){const[e,t]=V.useState(null),[n,r]=V.useState({});V.useEffect(()=>{QN().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await JN(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",m.jsx("code",{children:"--backend ssh --host <alias>"}),". Hosts come from"," ",m.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",m.jsx("code",{children:"git"})," and ",m.jsx("code",{children:"bash"}),"."]}),e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?m.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):m.jsxs("table",{className:"flavor-table ssh-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Host"}),m.jsx("th",{children:"Address"}),m.jsx("th",{children:"Identity"}),m.jsx("th",{children:"Status"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:e.map(l=>m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:l.host}),m.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),m.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),m.jsx("td",{children:m.jsx(Uj,{test:n[l.host]??l.lastTest})}),m.jsx("td",{children:m.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function Gj({test:e}){return e===null?null:e==="testing"?m.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?m.jsx("span",{className:"badge ok",children:"ready"}):m.jsx("span",{className:"badge err",children:"no git"}):m.jsx("span",{className:"badge err",children:"no slurm CLI"}):m.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"})}function qj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(""),[c,f]=V.useState(""),[p,d]=V.useState(""),[_,v]=V.useState(!1),[w,C]=V.useState(null),[b,S]=V.useState(null),x=b!==null&&b!=="testing"?b:null,y=D=>{t(D),l(D.host??""),o(D.partition??""),f(D.account??""),d(D.timeLimit??"")};V.useEffect(()=>{eT().then(y).catch(D=>r(D instanceof Error?D.message:String(D)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function R(D){if(D.preventDefault(),!_){v(!0),C(null);try{y(await tT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){C(T instanceof Error?T.message:String(T))}finally{v(!1)}}}async function N(D){S("testing");try{S(await nT(D))}catch(T){S({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",m.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",m.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[(x==null?void 0:x.error)&&m.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&m.jsxs("p",{className:"settings-note",children:["Partitions: ",m.jsx("code",{children:x.partitions.join(", ")})]}),m.jsxs("form",{className:"form settings-form",onSubmit:R,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Login node",m.jsxs("select",{value:a,onChange:D=>{l(D.target.value),S(null)},children:[m.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(D=>D.host===a)&&m.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(D=>m.jsx("option",{value:D.host,children:D.host},D.host))]})]}),m.jsxs("label",{children:["Partition",m.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:D=>o(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(D=>m.jsx("option",{value:D},D))})]})]}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Account",m.jsx("input",{className:"mono",type:"text",value:c,onChange:D=>f(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),m.jsxs("label",{children:["Time limit",m.jsx("input",{className:"mono",type:"text",value:p,onChange:D=>d(D.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),w&&m.jsx("div",{className:"error",children:w}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn primary",disabled:_||E,children:_?"Saving…":"Save"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||b==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),m.jsx(Gj,{test:b})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function Vj(){const[e,t]=V.useState(null),[n,r]=V.useState(null);return V.useEffect(()=>{rT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",m.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Hostname"}),m.jsx("span",{className:"v mono",children:e.hostname}),m.jsx("span",{className:"k",children:"System"}),m.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),m.jsx("span",{className:"k",children:"CPU"}),m.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),m.jsx("span",{className:"k",children:"RAM"}),m.jsx("span",{className:"v",children:e.memBytes!==null?ns(e.memBytes):"—"}),m.jsx("span",{className:"k",children:"GPUs"}),m.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ns(a.memMib*1024*1024)}`:""}`).join(", ")})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function Yj(){const[e,t]=V.useState(null),[n,r]=V.useState(null);return V.useEffect(()=>{sT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",m.jsx("code",{children:"--backend openresearch --flavor <shape>"})," (h100_sxm, cpu5c, …; browse with ",m.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",m.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?m.jsx("div",{className:"error",children:n}):e?e.loggedIn?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx("span",{className:"badge ok",children:"signed in"})}),m.jsx("span",{className:"k",children:"Orgs"}),m.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),m.jsx("span",{className:"k",children:"SSH key"}),m.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?m.jsx("span",{className:"badge ok",children:"registered"}):e.sshKeyRegistered===!1?m.jsx("span",{className:"badge err",children:"none registered"}):m.jsx("span",{className:"badge",children:"unknown"})})]}),e.sshKeyRegistered===!1&&m.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",m.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&m.jsx("p",{className:"settings-note",children:e.error})]}):m.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",m.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const H1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},Wj={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},Xj=["hf","modal","slurm","openresearch"],F1=["hf","modal","openresearch"],P1={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function Kj({t:e,isDefault:t}){return e.id==="local"?m.jsx("span",{className:"badge ok",children:"ready"}):!e.configured&&t?m.jsx("span",{className:"badge warn",children:"not configured"}):e.configured?m.jsx("span",{className:"badge ok",children:"configured"}):m.jsx("span",{className:"badge",children:"not set up"})}function Zj({target:e,flavor:t,onSaved:n}){var d;const[r,a]=V.useState(t??""),[l,u]=V.useState(!1),[o,c]=V.useState(null);V.useEffect(()=>a(t??""),[t]);async function f(_){if(_.preventDefault(),!l){u(!0),c(null);try{n(await JS({backend:e,flavor:r.trim()||null}))}catch(v){c(v instanceof Error?v.message:String(v))}finally{u(!1)}}}const p=r.trim()===(t??"");return m.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[m.jsxs("label",{children:["Default flavor",m.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:_=>a(_.target.value),placeholder:F1.includes(e)?`e.g. ${((d=P1[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),m.jsx("datalist",{id:`flavors-${e}`,children:(P1[e]??[]).map(_=>m.jsx("option",{value:_},_))})]}),o&&m.jsx("div",{className:"error",children:o}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),F1.includes(e)&&!t&&m.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",m.jsx("code",{children:"--flavor"}),"."]})]})]})}function Qj({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=V.useState(!1),[f,p]=V.useState(!1);r&&!o&&c(!0);async function d(_){if(!f){p(!0);try{l(await JS({backend:_}))}catch(v){u(v instanceof Error?v.message:String(v))}finally{p(!1)}}}return m.jsxs("div",{className:`compute-row${r?" open":""}`,children:[m.jsxs("div",{className:"compute-row-head",onClick:a,children:[m.jsx("span",{className:"compute-row-logo",children:m.jsx(xw,{kind:Wj[e.id],size:18})}),m.jsx("span",{className:"compute-row-name",children:H1[e.id]}),m.jsx("span",{className:"compute-row-summary",children:e.summary}),m.jsx(Kj,{t:e,isDefault:t}),t?m.jsx("span",{className:"badge compute-default-pill",children:"Default"}):m.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:_=>{_.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),m.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${H1[e.id]}`,onClick:_=>{_.stopPropagation(),a()},children:m.jsx(cs,{size:16,className:"compute-chevron"})})]}),o&&m.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&m.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",m.jsx("code",{children:"orx exp run"})," with no ",m.jsx("code",{children:"--backend"})," flag."," ",m.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&m.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&Xj.includes(e.id)&&m.jsx(Zj,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&m.jsx(Vj,{}),e.id==="hf"&&m.jsx(iL,{}),e.id==="modal"&&m.jsx(Pj,{}),e.id==="k8s"&&m.jsx(zj,{}),e.id==="ssh"&&m.jsx($j,{}),e.id==="slurm"&&m.jsx(qj,{}),e.id==="openresearch"&&m.jsx(Yj,{})]})]})}function Jj(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(null),[u,o]=V.useState(null),c=V.useRef(0);V.useEffect(()=>{const d=++c.current;iT().then(_=>{d===c.current&&(t(_),r(null))}).catch(_=>{if(d!==c.current)return;const v=_ instanceof Error?_.message:String(_);t(w=>(w===null?r(v):o(v),w))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Compute"}),m.jsxs("p",{className:"settings-sub",children:["Where ",m.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",m.jsx("code",{children:"--backend <name>"})," always wins)."]}),n?m.jsx("div",{className:"error",children:n}):p?m.jsxs(m.Fragment,{children:[u&&m.jsx("div",{className:"error",children:u}),m.jsx("div",{className:"compute-list",children:p.map(d=>m.jsx(Qj,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(_=>_===d.id?null:d.id),onSettings:f,onError:o},d.id))}),m.jsxs("p",{className:"compute-footnote",children:[m.jsx(sN,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const eL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function tL({settings:e}){return e.configured?e.valid?m.jsx("span",{className:"badge ok",children:"connected"}):m.jsx("span",{className:"badge err",children:"invalid token"}):m.jsx("span",{className:"badge",children:"not configured"})}function nL({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?m.jsx("span",{className:"badge ok",children:"jobs: write OK"}):e.jobsWrite===!1?m.jsx("span",{className:"badge err",children:"no job.write permission"}):m.jsx("span",{className:"badge",children:"jobs permission unknown"})}function iL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null),p=V.useRef(!1);V.useEffect(()=>{PN().then(_=>{p.current||t(_)}).catch(_=>{p.current||r(_ instanceof Error?_.message:String(_))})},[]);async function d(_){if(_.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const v=await UN(a.trim());p.current=!0,t(v),r(null),l("")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",m.jsx("code",{children:"--backend hf --flavor <name>"})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?m.jsx("div",{className:"error",children:n}):e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Status"}),m.jsx("span",{className:"v",children:m.jsx(tL,{settings:e})}),m.jsx("span",{className:"k",children:"Account"}),m.jsx("span",{className:"v",children:e.username??"—"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.maskedToken??"—"}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:e.source?eL[e.source]:"not configured"}),m.jsx("span",{className:"k",children:"Jobs"}),m.jsxs("span",{className:"v",children:[m.jsx(nL,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&m.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&m.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",m.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",m.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading status…"]}),m.jsxs("form",{className:"form settings-form",onSubmit:d,children:[m.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",m.jsx("input",{type:"password",value:a,onChange:_=>l(_.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const ww=/^hf_[A-Za-z0-9]{10,}$/;function Cw(){return m.jsx("tr",{children:m.jsx("td",{colSpan:3,children:m.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",m.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const U1=["HF_TOKEN","WANDB_API_KEY"];function rL({name:e,entry:t,onVars:n,onError:r}){const[a,l]=V.useState(""),[u,o]=V.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await ZS(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await WN(e))}catch(d){c(d)}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{className:"mono",children:e}),m.jsx("td",{className:"mono muted",children:t?m.jsxs(m.Fragment,{children:[t.maskedValue,t.inProcessEnv&&m.jsx("span",{className:"badge",children:"overridden by env"})]}):m.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),m.jsx("td",{children:t?m.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:m.jsx(Gu,{size:13})}):a.trim()&&m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&ww.test(a.trim())&&m.jsx(Cw,{})]})}function sL({onVars:e,onError:t,onDone:n}){const[r,a]=V.useState(""),[l,u]=V.useState(""),[o,c]=V.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await ZS(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return m.jsxs(m.Fragment,{children:[m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),m.jsx("td",{children:m.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),m.jsxs("td",{children:[m.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),m.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:m.jsx(Fo,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&ww.test(l.trim())&&m.jsx(Cw,{})]})}function aL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[u,o]=V.useState(null);V.useEffect(()=>{YN().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!U1.includes(d)),p=[...U1,...f];return m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Environment variables"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[m.jsx(bg,{size:12})," Add variable"]})]}),m.jsxs("p",{className:"settings-sub",children:["Stored in ",m.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",m.jsx("code",{children:"HF_TOKEN"})," and ",m.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?m.jsx("div",{className:"error",children:n}):e===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsx("table",{className:"env-table",children:m.jsxs("tbody",{children:[p.map(d=>m.jsx(rL,{name:d,entry:e.find(_=>_.key===d),onVars:c,onError:o},d)),a&&m.jsx(sL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&m.jsx("div",{className:"error",children:u})]})}function oL(){const[e,t]=V.useState(null),[n,r]=V.useState(""),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null);V.useEffect(()=>{ex().then(_=>{t(_),r(_.userName??""),l(_.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(_){if(_.preventDefault(),!(u||p)){o(!0),f(null);try{const v=await lT({userName:n.trim(),userEmail:a.trim()});t(v),r(v.userName??""),l(v.userEmail??"")}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Git"}),m.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("form",{className:"form",onSubmit:d,children:[m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["user.name",m.jsx("input",{type:"text",value:n,onChange:_=>r(_.target.value),autoComplete:"off"})]}),m.jsxs("label",{children:["user.email",m.jsx("input",{type:"text",value:a,onChange:_=>l(_.target.value),autoComplete:"off"})]})]}),c&&m.jsx("div",{className:"error",children:c}),m.jsx("div",{className:"actions",children:m.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),m.jsxs("div",{className:"settings-card",children:[m.jsx("h3",{children:"GitHub access"}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"git"}),m.jsx("span",{className:"v",children:e.gitVersion??"not found"}),m.jsx("span",{className:"k",children:"Token"}),m.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",m.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),m.jsx(Sw,{onSaved:t})]}),e.githubTokenSource==="stored"&&m.jsx("div",{className:"actions",children:m.jsx("button",{className:"btn",onClick:()=>{uT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}function lL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return m.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[m.jsx("div",{className:"progress-track",children:m.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),m.jsxs("div",{className:"progress-caption",children:[m.jsx("span",{children:n??`${r}%`}),t>0&&m.jsxs("span",{className:"mono",children:[ns(e)," / ",ns(t)]})]})]})}const cL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function uL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(""),[u,o]=V.useState(!1),[c,f]=V.useState(null),[p,d]=V.useState({kind:"idle"}),[_,v]=V.useState(null),w=()=>QS().then(E=>{t(E),l(R=>R||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));V.useEffect(()=>{w()},[]),V.useEffect(()=>kT(E=>{E.type==="progress"?d(R=>{const N=R.kind==="moving"?R.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),w()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const C=(e==null?void 0:e.source)==="env",b=a.trim(),S=e!==null&&b===e.current;async function x(){if(!(u||!b)){o(!0),v(null),f(null);try{f(await XN(b))}catch(E){v(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function y(E){if(E.preventDefault(),!(p.kind==="moving"||!b||S)&&(v(null),!!window.confirm(`Move all orx data to: -${b} - -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await ZN(b)}catch(R){d({kind:"idle"}),v(R instanceof Error?R.message:String(R))}}}return m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Storage"}),m.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",m.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?m.jsx("div",{className:"settings-card",children:m.jsx("div",{className:"error",children:n})}):e?m.jsxs("div",{className:"settings-card",children:[m.jsxs("div",{className:"settings-card-head",children:[m.jsx("h3",{children:"Data directory"}),m.jsx("div",{className:"spacer",style:{flex:1}}),m.jsx("span",{className:"badge",children:e.isDefault?"default":"custom"})]}),m.jsxs("div",{className:"kv",children:[m.jsx("span",{className:"k",children:"Current"}),m.jsx("span",{className:"v mono",children:e.current}),m.jsx("span",{className:"k",children:"Source"}),m.jsx("span",{className:"v",children:cL[e.source]}),!e.isDefault&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"k",children:"Default"}),m.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),C?m.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):m.jsxs("form",{className:"form settings-form",onSubmit:y,children:[m.jsxs("label",{children:["New location",m.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&m.jsxs("p",{className:"settings-note",children:["Ready to move ",ns(c.treeBytes??0),c.freeBytes!=null&&` — ${ns(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&m.jsx("div",{className:"error",children:c.error}),_&&m.jsx("div",{className:"error",children:_}),p.kind==="moving"&&m.jsx(lL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&m.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&m.jsxs(m.Fragment,{children:[" ","The old copy was left at ",m.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&m.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),m.jsxs("div",{className:"actions",children:[m.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!b||S||p.kind==="moving",children:u?"Checking…":"Check"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!b||S||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]})]})}const qp=e=>e==="running"||e==="starting";function hL(e){return qp(e.status)?Fy(Date.now()-e.createdAt):e.endedAt?Fy(e.endedAt-e.createdAt):"—"}function $1({instances:e,emptyLabel:t}){return e.length===0?m.jsx("p",{className:"instances-empty",children:t}):m.jsx("div",{className:"instances-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Project"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Runtime"})]})}),m.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsxs("span",{className:"backend-cell",children:[m.jsx(jj,{backend:n.backend}),r&&m.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:m.jsx(PS,{size:12})})]})}),m.jsx("td",{children:n.projectName??Tp(n.projectId)}),m.jsx("td",{children:m.jsx(Vo,{status:n.status})}),m.jsx("td",{children:Sa(n.createdAt)}),m.jsx("td",{className:"mono",children:hL(n)})]},n.id)})})]})})}function fL(){const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState(!1),[,u]=V.useState(0);V.useEffect(()=>{const d=setInterval(()=>u(_=>_+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),ON().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(_=>_??[])}).finally(()=>l(!1))};V.useEffect(()=>o(),[]);const c=(d,_)=>_.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>qp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!qp(d.status)).sort(c);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"settings-head-row",children:[m.jsx("h1",{children:"Instances"}),m.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[m.jsx(Su,{size:12,className:a?"spin":""})," Refresh"]})]}),m.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&m.jsx("div",{className:"error",children:n}),!f||!p?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading…"]}):m.jsxs(m.Fragment,{children:[m.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&m.jsx("span",{className:"count-badge",children:f.length})]}),m.jsx($1,{instances:f,emptyLabel:"Nothing running right now."}),m.jsx("h2",{className:"instances-section-title",children:"Past"}),m.jsx($1,{instances:p,emptyLabel:"No past instances yet."})]})]})}const dL=[{id:"harnesses",label:"Harnesses",icon:m.jsx(EA,{size:15})},{id:"compute",label:"Compute",icon:m.jsx(FA,{size:15})},{id:"instances",label:"Instances",icon:m.jsx(Ap,{size:15})},{id:"environment",label:"Environment",icon:m.jsx(wN,{size:15})},{id:"git",label:"Git",icon:m.jsx($u,{size:15})},{id:"storage",label:"Storage",icon:m.jsx(iN,{size:15})}];function pL({tab:e}){return m.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&m.jsx(Bj,{}),e==="compute"&&m.jsx(Jj,{}),e==="environment"&&m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"Environment"}),m.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),m.jsx(aL,{})]}),e==="instances"&&m.jsx(fL,{}),e==="git"&&m.jsx(oL,{}),e==="storage"&&m.jsx(uL,{})]})}function gL({skills:e,activeIndex:t,onPick:n,onHover:r}){return m.jsx("div",{className:"skill-menu",children:e.map((a,l)=>m.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[m.jsxs("span",{className:"skill-name",children:["/",a.name," ",m.jsx("span",{className:"skill-hint",children:a.argHint})]}),m.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Ew={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function G1(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function th(){const[e,t]=V.useState(!1),n=V.useRef(null);return V.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function mL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=V.useState([]),{open:u,setOpen:o,ref:c}=th(),[f,p]=V.useState("");V.useEffect(()=>{wg().then(w=>{l(w),n==null||n(w)}).catch(()=>{})},[]);const d=V.useMemo(()=>{const w=f.trim().toLowerCase();return(r&&e?a.filter(b=>b.id===e.harness):a).map(b=>{let S=b.models;return w?S=S.filter(x=>x.id.toLowerCase().includes(w)):b.id==="opencode"&&(S=S.slice(0,6)),{harness:b,models:S,hidden:w?0:b.models.length-S.length}})},[a,f,r,e]),_=(w,C)=>{var S,x;const b=(e==null?void 0:e.harness)===w.id;t({harness:w.id,model:C,permissionMode:b?e.permissionMode:((S=w.options)==null?void 0:S.defaultPermissionMode)??null,reasoningLevel:b?e.reasoningLevel:((x=w.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},v=e?e.model?xu(e.model):"Default model":"Model";return m.jsxs("div",{className:"model-picker",ref:c,children:[m.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(w=>!w),children:[v,m.jsx(cs,{size:12})]}),u&&m.jsxs("div",{className:"model-menu align-right",children:[m.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:w=>p(w.target.value)}),m.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:w,models:C,hidden:b})=>m.jsxs("div",{children:[m.jsx("div",{className:"model-group",children:w.name}),w.agentReady?m.jsxs(m.Fragment,{children:[C.map(S=>m.jsxs("button",{className:"model-item",onClick:()=>_(w,S.id),children:[m.jsxs("span",{children:[xu(S.id),m.jsx("span",{className:"model-id",children:S.id})]}),(e==null?void 0:e.harness)===w.id&&(e==null?void 0:e.model)===S.id&&m.jsx(_n,{size:13})]},S.id)),b>0&&m.jsxs("div",{className:"model-more",children:[b," more — search to find"]})]}):m.jsx("div",{className:"model-more",children:w.agentNote??"Not available"})]},w.id)),a.length===0&&m.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&m.jsxs("div",{className:"model-locked-note",children:[m.jsx(cN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function q1({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var S,x;const{open:f,setOpen:p,ref:d}=th();if(e.length===0)return null;const _=t??n??((S=e[0])==null?void 0:S.id)??null,v=e.find(y=>y.id===_),w=e.find(y=>y.id===n),C=(v==null?void 0:v.label)??((x=e[0])==null?void 0:x.label)??"",b=y=>{c(y),p(!1)};return m.jsxs("div",{className:"option-picker",ref:d,children:[m.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(y=>!y),children:[C,m.jsx(cs,{size:12})]}),f&&m.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&m.jsx("div",{className:"model-group",children:r}),w&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"model-item",onClick:()=>b(w.id),children:[m.jsxs("span",{children:[w.label," ",m.jsx("span",{className:"option-default",children:"· Default"})]}),_===w.id&&m.jsx(_n,{size:13})]}),m.jsx("div",{className:"option-sep"})]}),e.map((y,E)=>m.jsxs("button",{className:"model-item",onClick:()=>b(y.id),children:[m.jsx("span",{children:y.label}),_===y.id?m.jsx(_n,{size:13}):o&&m.jsx("span",{className:"option-num",children:E+1})]},y.id))]})]})}const kw="orx:agent-selection";function _L(){try{const e=localStorage.getItem(kw);return e?JSON.parse(e):null}catch{return null}}const Aw="local-";function vL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith(Aw)):e,t]}function yL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:vL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${Aw}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function bL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?m.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):m.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Nw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function SL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function V1(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Vp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${V1(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${V1(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function xL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return m.jsxs("details",{className:"tool-row",open:!1,children:[m.jsxs("summary",{children:[m.jsx("span",{className:Nw(n==null?void 0:n.status)}),m.jsx("span",{className:"tool-line",children:Vp(e)}),l&&t&&m.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&m.jsxs("div",{className:"tool-detail",children:[a&&m.jsx("div",{className:"tool-cmd-full",children:a}),r&&m.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function wL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=V.useState(!1),u=a||n,o=e.length===1?Vp(e[0]):n?Vp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return m.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[m.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[m.jsx("span",{className:Nw(n?"running":r?"error":"completed")}),m.jsx("span",{className:"tool-line",children:o}),m.jsx(Uu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&m.jsx("div",{className:"tool-group-rows",children:e.map(c=>m.jsx(xL,{part:c,onOpenFile:t},c.id))})]})}function CL({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,_;const a=e.prompt,[l,u]=V.useState([]),o=!t,c=v=>t==null?void 0:t({promptId:e.id,...v});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const w=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",C=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),m.jsx("span",{className:`prompt-outcome ${C}`,children:w})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[m.jsx(qo,{text:a.plan??"",onOpenFile:n}),a.note&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const v=(a.answers??[]).join(", ")||a.note||"";return m.jsxs("details",{className:"prompt-collapsed",children:[m.jsxs("summary",{children:[m.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),m.jsx("span",{className:`prompt-outcome ${v?"chosen":""}`,children:v||"Resolved"})]}),m.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&m.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(w=>{var C;return m.jsx("li",{className:(C=a.answers)!=null&&C.includes(w.label)?"sel":"",children:w.label},w.label)})}),a.note&&a.note!==v&&m.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const v=!!r;return m.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[m.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),m.jsx("div",{className:`prompt-plan ${v?"clamped":""}`,children:m.jsx(qo,{text:a.plan??"",onOpenFile:n})}),v&&m.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!v&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const v=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",w=typeof((_=a.toolInput)==null?void 0:_.reason)=="string"&&a.toolInput.reason||"";return m.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[m.jsxs("div",{className:"prompt-head",children:["Permission needed: ",m.jsx("code",{children:a.tool})]}),v&&m.jsx("div",{className:"prompt-sub",children:v}),w&&m.jsx("div",{className:"prompt-sub",children:w}),!o&&m.jsxs("div",{className:"prompt-actions",children:[m.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),m.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=v=>u(w=>a.multiSelect?w.includes(v)?w.filter(C=>C!==v):[...w,v]:[v]);return m.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&m.jsx("div",{className:"prompt-head",children:a.header}),a.question&&m.jsx("div",{className:"prompt-q",children:a.question}),m.jsx("div",{className:"prompt-options",children:(a.options??[]).map(v=>{const w=l.includes(v.label);return m.jsxs("button",{className:`prompt-option ${w?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(v.label):c({answers:[v.label]}),children:[m.jsx("span",{className:"prompt-option-label",children:v.label}),v.description&&m.jsx("span",{className:"prompt-option-desc",children:v.description})]},v.label)})}),a.multiSelect&&!o&&m.jsx("div",{className:"prompt-actions",children:m.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function EL(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function kL({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` -`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:yT(f.text));return m.jsxs("div",{className:"msg-user",children:[o,c.length>0&&m.jsx("div",{className:"msg-images",children:c.map((f,p)=>m.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:m.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(m.jsx(wL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(m.jsx(qo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(m.jsxs("details",{className:"reasoning",children:[m.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(m.jsx(CL,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),m.jsx("div",{className:"msg-assistant",children:a})}const Tw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function AL({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=th();return m.jsxs("div",{className:"rail-filter",ref:a,children:[m.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:m.jsx(SN,{size:13})}),n&&m.jsx("div",{className:"option-menu drop-down align-right",children:Tw.map(l=>m.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[m.jsx("span",{children:l.label}),e===l.id&&m.jsx(_n,{size:13})]},l.id))})]})}function NL({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var y;const{open:c,setOpen:f,ref:p}=th(),d=((y=e.title)==null?void 0:y.trim())||"Untitled",[_,v]=V.useState(!1),[w,C]=V.useState(""),b=V.useRef(null);function S(){var E;C(((E=e.title)==null?void 0:E.trim())||""),v(!0)}function x(){var R;const E=w.trim();v(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&l(E)}return V.useEffect(()=>{var E,R;_&&((E=b.current)==null||E.focus(),(R=b.current)==null||R.select())},[_]),m.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${_?"editing":""}`,title:`${Ew[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{_||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[m.jsx("span",{className:"session-dot",children:n&&m.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),_?m.jsx("input",{ref:b,className:"session-title-input","aria-label":"Session title",value:w,onChange:E=>C(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),v(!1))}}):m.jsx("span",{className:"session-title",children:d}),m.jsx("span",{className:"session-time",children:SL(e.updatedAt)}),m.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(R=>!R)},children:m.jsx(UA,{size:14})}),c&&m.jsxs("div",{className:"option-menu drop-down session-menu",children:[m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),S()},children:m.jsx("span",{children:"Rename"})}),m.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:m.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),m.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:m.jsx("span",{children:"Delete"})})]})]})}function TL({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,children:d}){var On,vi,ni;const[_,v]=V.useState([]),[w,C]=V.useState(null),[b,S]=V.useState("active"),[x,y]=V.useState(""),[E,R]=V.useState([]),[N,D]=V.useReducer(yL,{messagesBySession:{},busySessions:new Set}),[T,j]=V.useState([]),[B,z]=V.useState(_L),[G,U]=V.useState({}),H=V.useRef(new Set),Y=V.useRef(new Set),q=V.useRef(null),X=V.useRef(null),K=V.useRef(!0),L=V.useRef(null),[M,O]=V.useState([]),[$,F]=V.useState(0),[Q,re]=V.useState(!1);V.useEffect(()=>{pT().then(O).catch(()=>{})},[]);const ae=x.startsWith("/")&&!/\s/.test(x)?x.slice(1):null,Z=ae!==null&&!Q?M.filter(oe=>oe.name.startsWith(ae.toLowerCase())):[],P=Z.length>0,ee=Math.min($,Math.max(0,Z.length-1));V.useEffect(()=>F(0),[ae]);function ne(oe){var we;y(`/${oe.name} `),(we=L.current)==null||we.focus()}function ge(oe){for(const we of oe){if(!/^image\/(png|jpeg|gif|webp)$/.test(we.type))continue;const Ne=new FileReader;Ne.onload=()=>{const qe=Ne.result;R(at=>[...at,{dataUrl:qe,mediaType:we.type}])},Ne.readAsDataURL(we)}}function he(oe){const we=Array.from(oe.clipboardData.items).filter(Ne=>Ne.kind==="file"&&Ne.type.startsWith("image/")).map(Ne=>Ne.getAsFile()).filter(Ne=>Ne!==null);we.length>0&&(oe.preventDefault(),ge(we))}const ye=_.find(oe=>oe.id===w),be=ye?{harness:ye.harness,model:G.model??ye.model,permissionMode:G.permissionMode??ye.permissionMode,reasoningLevel:G.reasoningLevel??ye.reasoningLevel}:B??G1(T),ke=be?T.find(oe=>oe.id===be.harness):void 0,Ee=ke==null?void 0:ke.options,Ce=oe=>{ye?U({model:oe.model,permissionMode:oe.permissionMode,reasoningLevel:oe.reasoningLevel}):(z(oe),localStorage.setItem(kw,JSON.stringify(oe)))},rt=oe=>{be&&Ce({...be,permissionMode:oe})},bt=oe=>{be&&Ce({...be,reasoningLevel:oe})};V.useEffect(()=>{v([]),C(null),y(""),R([]),D({type:"reset"}),H.current=new Set,zy(e).then(oe=>{v(oe),C(we=>{var Ne;return we??((Ne=oe.find(qe=>!qe.archived))==null?void 0:Ne.id)??null}),D({type:"seedBusy",sessions:oe.filter(we=>we.busy).map(we=>we.id)})}).catch(()=>{})},[e]),V.useEffect(()=>{!w||H.current.has(w)||(H.current.add(w),Hy(w).then(oe=>D({type:"seed",sessionId:w,messages:oe})).catch(()=>H.current.delete(w)))},[w]),V.useEffect(()=>ET(oe=>{switch(oe.type){case"session":if(oe.session.projectId!==e||Y.current.has(oe.session.id))return;v(we=>{const Ne=we.findIndex(at=>at.id===oe.session.id);if(Ne<0)return[oe.session,...we];const qe=we.slice();return qe[Ne]=oe.session,qe});break;case"sessionDeleted":Ct(oe.sessionId);break;case"message":D({type:"upsertMessage",sessionId:oe.sessionId,message:oe.message});break;case"busy":D({type:"busy",sessionId:oe.sessionId,busy:oe.busy});break}}),[e]);const Ge=w?N.messagesBySession[w]??[]:[],ct=w?N.busySessions.has(w):!1,Pt=oe=>N.busySessions.has(oe)&&(N.messagesBySession[oe]??[]).some(we=>we.parts.some(Ne=>Ne.type==="prompt"&&Ne.prompt&&!Ne.prompt.resolved&&Ne.prompt.nativeId)),ht=w?Pt(w):!1,Fe=ye,fe=V.useMemo(()=>{var oe;for(let we=Ge.length-1;we>=0;we--)for(const Ne of Ge[we].parts)if(Ne.type==="prompt"&&((oe=Ne.prompt)==null?void 0:oe.kind)==="plan"&&!Ne.prompt.resolved)return{promptId:Ne.id,plan:Ne.prompt.plan??"",synthesized:!!Ne.prompt.synthesized};return null},[Ge]),ie=V.useMemo(()=>{if(!w||(Fe==null?void 0:Fe.harness)!=="claude-code")return null;for(let oe=Ge.length-1;oe>=0;oe--)for(const we of Ge[oe].parts)if(!(we.type!=="prompt"||!we.prompt||we.prompt.resolved)&&we.prompt.kind==="question")return we.prompt.nativeId&&!N.busySessions.has(w)?null:we.id;return null},[Ge,Fe==null?void 0:Fe.harness,w,N.busySessions]),[de,Se]=V.useState(null),Ae=de&&de.sessionId===w?de:null;V.useEffect(()=>{if(!de)return;const oe=N.busySessions.has(de.sessionId),we=de.sessionId===w&&fe&&fe.promptId!==de.promptId;(!oe||we)&&Se(null)},[de,fe,N.busySessions,w]);const De=p&&w?(oe,we)=>p(oe,w,we):void 0;V.useEffect(()=>U({}),[w]);const Ve=l==="chat"&&(Ge.length>0||ct);V.useLayoutEffect(()=>{K.current=!0;const oe=q.current;oe&&(oe.scrollTop=oe.scrollHeight)},[w,Ve]),V.useLayoutEffect(()=>{const oe=q.current;oe&&K.current&&(oe.scrollTop=oe.scrollHeight)},[Ge,ct]),V.useEffect(()=>{const oe=q.current,we=X.current;if(!oe||!we)return;const Ne=new ResizeObserver(()=>{K.current&&(oe.scrollTop=oe.scrollHeight)});return Ne.observe(we),Ne.observe(oe),()=>Ne.disconnect()},[Ve]);async function Ie(){const oe=x.trim(),we=E;if(!oe&&we.length===0)return;if(oe&&ie&&we.length===0){y(""),Ut({promptId:ie,answers:[],note:oe}).then(at=>{at||y(yi=>yi||oe)});return}if(ct)return;const Ne=be;if(!Ne&&!w)return;y(""),R([]);let qe=w;try{if(!qe){const nn=await gT(e,Ne.harness,{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel});H.current.add(nn.id),v(gs=>[nn,...gs]),C(nn.id),qe=nn.id}D({type:"optimisticUser",sessionId:qe,text:oe,imageUrls:we.map(nn=>nn.dataUrl)}),D({type:"busy",sessionId:qe,busy:!0}),K.current=!0,b==="archived"&&S("active");const at=Ne?{model:Ne.model,permissionMode:Ne.permissionMode,reasoningLevel:Ne.reasoningLevel}:{};U({});const yi=we.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await bT(qe,oe,at,yi.length?yi:void 0)}catch{qe&&D({type:"busy",sessionId:qe,busy:!1})}}function Nt(){w&&ST(w)}V.useEffect(()=>{if(!ct||l!=="chat")return;function oe(we){var Ne;we.key!=="Escape"||we.defaultPrevented||(we.preventDefault(),Nt(),(Ne=L.current)==null||Ne.focus())}return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[ct,w,l]);function Ct(oe){Y.current.add(oe),v(we=>we.filter(Ne=>Ne.id!==oe)),C(we=>we===oe?null:we),H.current.delete(oe),D({type:"forget",sessionId:oe})}function qt(oe,we){const Ne=oe.archived;v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:we}:at)),_T(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,archived:Ne}:at))})}function st(oe,we){const Ne=oe.title;v(qe=>qe.map(at=>at.id===oe.id?{...at,title:we}:at)),vT(oe.id,we).catch(()=>{v(qe=>qe.map(at=>at.id===oe.id?{...at,title:Ne}:at))})}async function Ln(oe){var Ne;const we=((Ne=oe.title)==null?void 0:Ne.trim())||"Untitled";if(window.confirm(`Delete "${we}"? - -Its transcript is permanently removed.`)){try{await mT(oe.id)}catch(qe){window.alert(`Failed to delete "${we}": ${qe instanceof Error?qe.message:String(qe)}`);return}Ct(oe.id)}}function Ut(oe){if(!w)return Promise.resolve(!1);const we=w;return D({type:"busy",sessionId:we,busy:!0}),xT(we,oe).then(()=>!0).catch(()=>!1).finally(()=>{Hy(we).then(Ne=>D({type:"seed",sessionId:we,messages:Ne})).catch(()=>{}),zy(e).then(Ne=>{var qe;return D({type:"busy",sessionId:we,busy:!!((qe=Ne.find(at=>at.id===we))!=null&&qe.busy)})}).catch(()=>{})})}const ps=_.filter(oe=>b==="all"?!0:b==="archived"?oe.archived:!oe.archived),gi=m.jsxs("aside",{className:"session-rail floating-panel",children:[n,m.jsxs("nav",{className:"rail-nav",children:[m.jsxs("button",{className:"rail-nav-item",onClick:()=>{C(null),u("chat")},children:[m.jsx(bg,{size:15}),"New session"]}),m.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,onClick:()=>u("files"),children:[m.jsx($S,{size:15}),"Files"]}),dL.map(oe=>m.jsxs("button",{className:`rail-nav-item ${l===oe.id?"active":""}`,onClick:()=>u(oe.id),children:[oe.icon,oe.label]},oe.id))]}),m.jsxs("div",{className:"rail-body",children:[m.jsxs("div",{className:"rail-section-head",children:[m.jsx("div",{className:"rail-section-label",children:((On=Tw.find(oe=>oe.id===b))==null?void 0:On.railLabel)??"Recents"}),m.jsx(AL,{value:b,onChange:S})]}),ps.map(oe=>m.jsx(NL,{session:oe,active:oe.id===w&&l==="chat",busy:N.busySessions.has(oe.id),waiting:Pt(oe.id),onOpen:()=>{C(oe.id),u("chat")},onRename:we=>st(oe,we),onSetArchived:we=>qt(oe,we),onDelete:()=>void Ln(oe)},oe.id)),ps.length===0&&m.jsx("div",{className:"rail-empty",children:b==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),mi=`chat-header${r?"":" rail-hidden"}`,_i=!r&&m.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:m.jsx(qS,{size:15})});return l!=="chat"?m.jsxs(m.Fragment,{children:[r&&gi,m.jsxs("section",{className:"chat-pane",children:[!r&&m.jsx("div",{className:mi,children:_i}),m.jsx("div",{className:"settings-view-scroll",children:d})]})]}):m.jsxs(m.Fragment,{children:[r&&gi,m.jsxs("section",{className:"chat-pane",children:[m.jsxs("div",{className:mi,children:[_i,m.jsx("div",{className:"title",title:Fe?((vi=Fe.title)==null?void 0:vi.trim())||"Untitled":"New session",children:Fe?((ni=Fe.title)==null?void 0:ni.trim())||"Untitled":"New session"}),m.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:m.jsx(KA,{size:15})})]}),Ve?m.jsx("div",{className:"chat-thread",ref:q,onScroll:oe=>{const we=oe.currentTarget;K.current=we.scrollHeight-we.scrollTop-we.clientHeight<60},children:m.jsxs("div",{className:"chat-thread-inner",ref:X,children:[Ge.filter(EL).map(oe=>m.jsx(kL,{message:oe,onOpenFile:f&&(we=>f(we,w??void 0)),onRespond:Ut,onOpenPlan:De},oe.id)),ct&&(ht?m.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):m.jsxs("div",{className:"working",children:[m.jsx("span",{className:"spinner"})," Working…"]}))]})}):m.jsxs("div",{className:"chat-empty",children:[m.jsxs("h2",{children:["Open",m.jsx("span",{children:"Research"})]}),m.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),m.jsx(bL,{harnesses:T,selection:B??G1(T)}),t&&m.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var oe;y(`/reproduce-paper ${t} on `),(oe=L.current)==null||oe.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),m.jsxs("div",{className:"composer",children:[fe&&!(Ae&&fe.promptId===Ae.promptId)&&m.jsx(Nj,{synthesized:fe.synthesized,onView:()=>De==null?void 0:De(fe.plan,fe.promptId),onApprove:oe=>Ut({promptId:fe.promptId,approve:!0,resumeMode:oe}),onReject:()=>Ut({promptId:fe.promptId,approve:!1}),onRevise:oe=>{w&&Se({sessionId:w,promptId:fe.promptId}),Ut({promptId:fe.promptId,approve:!1,note:oe})}}),m.jsxs("div",{className:"composer-box",children:[P&&m.jsx(gL,{skills:Z,activeIndex:ee,onPick:ne,onHover:F}),E.length>0&&m.jsx("div",{className:"composer-attachments",children:E.map((oe,we)=>m.jsxs("div",{className:"attachment-thumb",children:[m.jsx("img",{src:oe.dataUrl,alt:"pasted"}),m.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>R(Ne=>Ne.filter((qe,at)=>at!==we)),children:m.jsx(Fo,{size:11})})]},we))}),m.jsx("textarea",{ref:L,value:x,placeholder:ie?"Type a custom answer…":be?`Message ${Ew[be.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:he,onDragOver:oe=>{oe.dataTransfer.types.includes("Files")&&oe.preventDefault()},onDrop:oe=>{oe.dataTransfer.files.length!==0&&(oe.preventDefault(),ge(Array.from(oe.dataTransfer.files)))},onChange:oe=>{y(oe.target.value),re(!1)},onKeyDown:oe=>{if(P){if(oe.key==="ArrowDown"||oe.key==="ArrowUp"){oe.preventDefault();const we=oe.key==="ArrowDown"?1:-1;F((ee+we+Z.length)%Z.length);return}if(oe.key==="Enter"||oe.key==="Tab"){oe.preventDefault(),ne(Z[ee]);return}if(oe.key==="Escape"){oe.preventDefault(),re(!0);return}}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),Ie())}}),m.jsxs("div",{className:"composer-actions",children:[m.jsx(q1,{choices:(Ee==null?void 0:Ee.permissionModes)??[],value:(be==null?void 0:be.permissionMode)??null,defaultId:(Ee==null?void 0:Ee.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:rt}),m.jsx("div",{style:{flex:1}}),m.jsx(mL,{value:be,onSelect:Ce,onHarnesses:j,lockHarness:!!ye}),m.jsx(q1,{choices:(Ee==null?void 0:Ee.reasoningLevels)??[],value:(be==null?void 0:be.reasoningLevel)??null,defaultId:(Ee==null?void 0:Ee.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:bt}),ct&&!ie?m.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:Nt,children:m.jsx(Fo,{size:16})}):m.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void Ie(),disabled:!x.trim()&&E.length===0,children:m.jsx(FS,{size:16})})]})]})]})]})]})}function Y1(){return{dirs:new Map,files:[]}}function RL(e){const t=Y1();for(const n of e){const r=n.split("/");let a=t;for(let l=0;l<r.length-1;l++){const u=r[l];let o=a.dirs.get(u);o||(o=Y1(),a.dirs.set(u,o)),a=o}a.files.push(r[r.length-1])}return t}function DL({name:e,node:t,path:n,depth:r,toggled:a,onToggle:l,onOpenFile:u}){const o=r===0,c=a.has(n)?!o:o;return m.jsxs(m.Fragment,{children:[m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+r*14},onClick:()=>l(n),title:n,children:[c?m.jsx(cs,{size:13,className:"code-tree-chev"}):m.jsx(Uu,{size:13,className:"code-tree-chev"}),c?m.jsx($S,{size:13}):m.jsx(eN,{size:13}),m.jsx("span",{className:"code-tree-name",children:e})]}),c&&m.jsx(Rw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function Rw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return m.jsxs(m.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return m.jsx(DL,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return m.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[m.jsx(WA,{size:13}),m.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function ML({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=V.useState(null),[p,d]=V.useState(null),[_,v]=V.useState(!0),w=V.useRef(0),C=V.useCallback(()=>{const E=++w.current;v(!0),FN(e,r?{ref:r}:{}).then(R=>{E===w.current&&(f(R),d(null))}).catch(R=>{E===w.current&&d(R.message)}).finally(()=>{E===w.current&&v(!1)})},[e,r]);V.useEffect(()=>(f(null),d(null),C(),()=>{w.current++}),[C]);const b=V.useMemo(()=>c?RL(c.entries):null,[c]),S=V.useCallback(E=>{const R=new Set(a);R.has(E)?R.delete(E):R.add(E),u(R)},[a,u]),x=V.useMemo(()=>{const E=new Set,R=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),R.push({branch:N.branchName,label:N.slug}));return R},[n]),y=r||(c==null?void 0:c.branch)||null;return m.jsxs("div",{className:"code-tab",children:[m.jsxs("div",{className:"code-tab-header",children:[m.jsx("span",{className:"ctl-label",children:"Source"}),m.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[m.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&m.jsx("option",{value:r,children:r}),x.map(E=>m.jsx("option",{value:E.branch,children:E.label},E.branch))]}),y&&m.jsx("a",{className:"icon-btn",href:xg(t.githubOwner,t.githubRepo,y),target:"_blank",rel:"noopener noreferrer",title:`Open ${y} on GitHub`,children:m.jsx(pm,{size:13})}),m.jsx("span",{style:{flex:1}}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:C,children:_?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),(c==null?void 0:c.truncated)&&m.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&b&&m.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),m.jsx("div",{className:"code-tab-body",children:b?b.dirs.size===0&&b.files.length===0?m.jsx("div",{className:"code-tab-note",children:"No files."}):m.jsx("div",{className:"code-tree",children:m.jsx(Rw,{node:b,parentPath:"",depth:0,toggled:a,onToggle:S,onOpenFile:E=>o(E,void 0,r||void 0)})}):m.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}const jL="project";function LL(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function OL(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const BL=/\.(png|jpe?g|gif|webp|svg)$/i;function Yp(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Yp(n.children??[],t);if(r)return r}}return null}function IL({projectId:e,folder:t,markdown:n}){const r=a=>LL(a)?a:Np(e,`${t}/${a.replace(/^\.?\//,"")}`);return m.jsx("div",{className:"md report-md",children:m.jsx(Fx,{remarkPlugins:[uw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return m.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return m.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[m.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&m.jsx("span",{className:"report-img-caption",children:l})]})},...bw},children:OL(n)})})}function zL({projectId:e,entry:t,onBack:n,onDelete:r}){const[a,l]=V.useState(null),[u,o]=V.useState(null);return V.useEffect(()=>{aT(e,t.path).then(c=>l(c.markdown)).catch(c=>o(c instanceof Error?c.message:String(c)))},[e,t.path,t.modifiedAt]),m.jsx("div",{className:"report-view",children:m.jsxs("div",{className:"report-view-col",children:[m.jsxs("div",{className:"report-view-head",children:[m.jsxs("button",{className:"report-back",onClick:n,children:[m.jsx(jo,{size:13})," Files"]}),m.jsx("span",{style:{flex:1}}),m.jsx("span",{className:"report-date",children:new Date(t.modifiedAt).toLocaleString()}),m.jsx("button",{className:"icon-btn",title:"Delete report folder","aria-label":"Delete report folder",onClick:()=>{window.confirm(`Delete the "${t.path}" folder from the files dir?`)&&r()},children:m.jsx(Gu,{size:14})})]}),u?m.jsx("div",{className:"error",children:u}):a===null?m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading report…"]}):m.jsx(IL,{projectId:e,folder:t.path,markdown:a})]})})}function HL({dir:e}){const[t,n]=V.useState(!1);return m.jsxs("div",{className:"files-pill files-pill-dir",title:e,children:[m.jsx("code",{children:e}),m.jsx("button",{className:"icon-btn",title:"Copy path","aria-label":"Copy files directory path",onClick:()=>{var r;(r=navigator.clipboard)==null||r.writeText(e),n(!0),setTimeout(()=>n(!1),1200)},children:t?m.jsx(_n,{size:13}):m.jsx(yg,{size:13})})]})}function Dw({projectId:e,entries:t,depth:n,expanded:r,onToggle:a,onOpenReport:l,onDelete:u}){return m.jsx(m.Fragment,{children:t.map(o=>{var p;const c={paddingLeft:14+n*22},f=m.jsx("button",{className:"icon-btn ftree-del",title:`Delete ${o.path}`,"aria-label":`Delete ${o.path}`,onClick:d=>{d.stopPropagation(),window.confirm(`Delete "${o.path}" from the files dir?`)&&u(o.path)},children:m.jsx(Gu,{size:13})});if(o.isDir){const d=o.reportTitle!==void 0,_=r.has(o.path),v=n===0?o.experiment:void 0,w=d&&n>0,C=v?[v.title,v.branchName].filter(Boolean).join(" — "):d&&!w?o.reportTitle:void 0;return m.jsxs("div",{children:[m.jsxs("div",{className:"ftree-row clickable",style:c,title:C,onClick:()=>d?l(o.path):a(o.path),children:[m.jsx("button",{className:`ftree-chevron ${_?"open":""}`,"aria-label":_?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:b=>{b.stopPropagation(),a(o.path)},children:m.jsx(Uu,{size:13})}),w?m.jsx("span",{className:"ftree-title",children:o.reportTitle}):m.jsxs("span",{className:"ftree-dirname",children:[o.name,"/"]}),d&&m.jsx("span",{className:"ftree-tag",children:"report"}),(v==null?void 0:v.latestRunStatus)&&m.jsx("span",{className:"ftree-status",children:v.latestRunStatus}),f,m.jsx("span",{className:"ftree-date",children:new Date(o.modifiedAt).toLocaleDateString()})]}),_&&(((p=o.children)==null?void 0:p.length)??0)>0&&m.jsx("div",{className:"ftree-children",children:m.jsx(Dw,{projectId:e,entries:o.children??[],depth:n+1,expanded:r,onToggle:a,onOpenReport:l,onDelete:u})})]},o.path)}return m.jsxs("div",{className:"ftree-row",style:c,children:[m.jsx("span",{className:"ftree-chevron spacer"}),m.jsxs("a",{className:"ftree-link",href:Np(e,o.path),target:"_blank",rel:"noopener noreferrer",title:o.path,children:[BL.test(o.name)&&m.jsx("img",{className:"ftree-thumb",src:Np(e,o.path),alt:"",loading:"lazy"}),m.jsx("span",{className:"ftree-name",children:o.name})]}),f,m.jsx("span",{className:"ftree-size",children:ns(o.size)})]},o.path)})})}function FL(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===jL?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function PL({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=V.useState(null),[u,o]=V.useState(new Set),c=a&&t?Yp(t.entries,a):null;V.useEffect(()=>{var b;a&&t&&!((b=Yp(t.entries,a))!=null&&b.reportTitle)&&l(null)},[a,t]);const f=b=>o(S=>{const x=new Set(S);return x.has(b)?x.delete(b):x.add(b),x}),p=b=>{oT(e.id,b).catch(()=>{}).finally(n)};if(c!=null&&c.reportTitle)return m.jsx(zL,{projectId:e.id,entry:c,onBack:()=>l(null),onDelete:()=>{p(c.path),l(null)}});if(!t)return m.jsx("div",{className:"files-tab",children:m.jsx("div",{className:"files-col",children:m.jsxs("div",{className:"settings-loading",children:[m.jsx("span",{className:"spinner"})," Loading files…"]})})});const{project:d,experiments:_,other:v}=FL(t.entries),w=b=>m.jsx(Dw,{projectId:e.id,entries:b,depth:0,expanded:u,onToggle:f,onOpenReport:l,onDelete:p}),C=`https://github.com/${e.githubOwner}/${e.githubRepo}`;return m.jsx("div",{className:"files-tab",children:m.jsxs("div",{className:"files-col",children:[m.jsxs("div",{className:"files-meta",children:[m.jsxs("a",{className:"files-pill",href:C,target:"_blank",rel:"noopener noreferrer",children:[m.jsxs("code",{children:[e.githubOwner,"/",e.githubRepo]}),m.jsx(PS,{size:12})]}),m.jsx(HL,{dir:t.dir}),m.jsx("button",{type:"button",className:"files-pill files-pill-link",onClick:r,children:"Change storage location →"})]}),m.jsxs("p",{className:"files-hint",children:["An explorer over this folder — the agent writes each experiment's reports and figures into the folder named for its slug (project-wide reports under ",m.jsx("code",{children:"project/"}),"), and you can drop in your own files."]}),t.entries.length===0?m.jsxs("p",{className:"files-empty",children:["Nothing here yet. Ask the agent for a write-up of its findings — it saves each experiment's report folder (",m.jsx("code",{children:"report.md"})," + images) into the folder above."]}):m.jsxs("div",{className:"files-card",children:[w(d),w(_),v.length>0&&(_.length>0||d.length>0)&&m.jsx("div",{className:"ftree-divider",children:"Not linked to an experiment"}),w(v),t.truncated&&m.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]})]})})}function Gc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return m.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,m.jsx("span",{className:"tab-label",children:t}),m.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:m.jsx(Fo,{size:12})})]})}function UL({owner:e,repo:t,branch:n}){return m.jsxs("a",{className:"files-pill",href:xg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[m.jsx("code",{children:n}),m.jsx(pm,{size:12})]})}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(n),!0).forEach((function(r){Wp(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W1(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Wp(e,t,n){return(t=(function(r){var a=(function(l,u){if(typeof l!="object"||l===null)return l;var o=l[Symbol.toPrimitive];if(o!==void 0){var c=o.call(l,u);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(l)})(r,"string");return typeof a=="symbol"?a:String(a)})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(e,t){if(e==null)return{};var n,r,a=(function(u,o){if(u==null)return{};var c,f,p={},d=Object.keys(u);for(f=0;f<d.length;f++)c=d[f],o.indexOf(c)>=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Je(e,t){return jw(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(_){d=!0,u=_}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||nh(e,t)||Ow()}function Mw(e){return jw(e)||Lw(e)||nh(e)||Ow()}function Rn(e){return(function(t){if(Array.isArray(t))return Xp(t)})(e)||Lw(e)||nh(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function jw(e){if(Array.isArray(e))return e}function Lw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nh(e,t){if(e){if(typeof e=="string")return Xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xp(e,t):void 0}}function Xp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ow(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gm(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=nh(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return u=c.done,c},e:function(c){o=!0,l=c},f:function(){try{u||n.return==null||n.return()}finally{if(o)throw l}}}}var qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(e,t){return e(t={exports:{}},t.exports),t.exports}var Nn=fl((function(e){/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a<arguments.length;a++){var l=arguments[a];if(l){var u=typeof l;if(u==="string"||u==="number")r.push(l);else if(Array.isArray(l)){if(l.length){var o=n.apply(null,l);o&&r.push(o)}}else if(u==="object"){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){r.push(l.toString());continue}for(var c in l)t.call(l,c)&&l[c]&&r.push(c)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),gn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Bw=V.createContext(gn),$L=Bw.Provider,GL=function(){return V.useContext(Bw)},qL=fl((function(e,t){(function(n){function r(l){var u=l.slice(11),o=null,c=null;switch(u.indexOf('"')){case-1:o=(d=u.split(" "))[0].slice(2),c=d[1].slice(2);break;case 0:var f=u.indexOf('"',2);o=u.slice(3,f);var p=u.indexOf('"',f+1);c=p<0?u.slice(f+4):u.slice(p+3,-1);break;default:var d;o=(d=u.split(" "))[0].slice(2),c=d[1].slice(3,-1)}return{oldPath:o,newPath:c}}var a={parse:function(l){for(var u,o,c,f,p,d=[],_=2,v=l.split(` -`),w=v.length,C=0;C<w;){var b=v[C];if(b.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(p=r(b)).oldPath,newPath:p.newPath},d.push(u);var S,x=null;e:for(;S=v[++C];){var y=S.indexOf(" "),E=y>-1?S.slice(0,y):E;switch(E){case"diff":C--;break e;case"deleted":case"new":var R=S.slice(y+1);R.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=R.slice(10));break;case"similarity":u.similarity=parseInt(S.split(" ")[2],10);break;case"index":var N=S.slice(y+1).split(" "),D=N[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=S.slice(y+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=S.slice(y+1),B=v[++C].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),_=5;break e}}u.type=x||"modify"}else if(b.indexOf("Binary")===0)u.isBinary=!0,u.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",_=2,u=null;else if(_===5)if(b.indexOf("@@")===0){var z=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);o={content:b,oldStart:z[1]-0,newStart:z[4]-0,oldLines:z[3]-0||1,newLines:z[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var G=b.slice(0,1),U={content:b.slice(1)};switch(G){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=f,f++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=c,c++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=c,U.newLineNumber=f,c++,f++;break;case"\\":var H=o.changes[o.changes.length-1];H.isDelete||(u.newEndingNewLine=!1),H.isInsert||(u.oldEndingNewLine=!1)}U.type&&o.changes.push(U)}C++}return d}};e.exports=a})()}));function Tr(e){return e.type==="insert"}function Dn(e){return e.type==="delete"}function Ui(e){return e.type==="normal"}function VL(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=Je(l,3),f=c[0],p=c[1],d=c[2];return p?Tr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Dn(u)&&Dn(p)?d:o]):(f.push(u),[f,u,Dn(u)?o:-1])}),[[],null,-1]);return Je(a,1)[0]})(e.changes):e.changes;return lt(lt({},e),{},{isPlain:!1,changes:n})}function YL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` -`),l=r.indexOf(` -`,a+1),u=r.slice(0,a),o=r.slice(a+1,l),c=u.split(" ").slice(1,-3).join(" "),f=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(f),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(f),r.slice(l+1)].join(` -`)})(e.trimStart());return qL.parse(n).map((function(r){return(function(a,l){var u=a.hunks.map((function(o){return VL(o,l)}));return lt(lt({},a),{},{hunks:u})})(r,t)}))}function WL(e){return e[0]}function XL(e){return e[e.length-1]}function Kp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Yo(e){return e==="old"?function(t){return Tr(t)?-1:Ui(t)?t.oldLineNumber:t.lineNumber}:function(t){return Dn(t)?-1:Ui(t)?t.newLineNumber:t.lineNumber}}function Iw(e,t){return function(n,r){var a=n[e],l=a+n[t];return r>=a&&r<l}}function KL(e,t){return function(n,r,a){var l=n[e]+n[t],u=r[e];return a>=l&&a<u}}function zw(e){var t=Yo(e),n=(function(r){var a=Je(Kp(r),2),l=Iw(a[0],a[1]);return function(u,o){return u.find((function(c){return l(c,o)}))}})(e);return function(r,a){var l=n(r,a);if(l)return l.changes.find((function(u){return t(u)===a}))}}function mm(e){var t=e==="old"?"new":"old",n=Je(Kp(e),2),r=n[0],a=n[1],l=Je(Kp(t),2),u=l[0],o=l[1],c=Yo(e),f=Yo(t),p=Iw(r,a),d=KL(r,a);return function(_,v){var w=WL(_);if(v<w[r]){var C=w[r]-v;return w[u]-C}var b=XL(_);if(b[r]+b[a]<=v){var S=v-b[r]-b[a];return b[u]+b[o]+S}for(var x=0;x<_.length;x++){var y=_[x],E=_[x+1];if(p(y,v)){var R=y.changes.findIndex((function(z){return c(z)===v})),N=y.changes[R];if(Ui(N))return f(N);var D=Dn(N)?R+1:R-1,T=y.changes[D];if(!T)return-1;var j=Tr(N)?"delete":"insert";return T.type===j?f(T):-1}if(d(y,E,v)){var B=v-y[r]-y[a];return y[u]+y[o]+B}}throw new Error("Unexpected line position ".concat(v))}}var ZL=function(e,t,n,r){for(var a=e.length,l=n+-1;++l<a;)if(t(e[l],l,e))return l;return-1},QL=function(){this.__data__=[],this.size=0},Hw=function(e,t){return e===t||e!=e&&t!=t},ih=function(e,t){for(var n=e.length;n--;)if(Hw(e[n][0],t))return n;return-1},JL=Array.prototype.splice,eO=function(e){var t=this.__data__,n=ih(t,e);return!(n<0)&&(n==t.length-1?t.pop():JL.call(t,n,1),--this.size,!0)},tO=function(e){var t=this.__data__,n=ih(t,e);return n<0?void 0:t[n][1]},nO=function(e){return ih(this.__data__,e)>-1},iO=function(e,t){var n=this.__data__,r=ih(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function ia(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ia.prototype.clear=QL,ia.prototype.delete=eO,ia.prototype.get=tO,ia.prototype.has=nO,ia.prototype.set=iO;var rh=ia,rO=function(){this.__data__=new rh,this.size=0},sO=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},aO=function(e){return this.__data__.get(e)},oO=function(e){return this.__data__.has(e)},Fw=typeof qc=="object"&&qc&&qc.Object===Object&&qc,lO=typeof self=="object"&&self&&self.Object===Object&&self,qi=Fw||lO||Function("return this")(),hi=qi.Symbol,Pw=Object.prototype,cO=Pw.hasOwnProperty,uO=Pw.toString,No=hi?hi.toStringTag:void 0,hO=function(e){var t=cO.call(e,No),n=e[No];try{e[No]=void 0;var r=!0}catch{}var a=uO.call(e);return r&&(t?e[No]=n:delete e[No]),a},fO=Object.prototype.toString,dO=function(e){return fO.call(e)},X1=hi?hi.toStringTag:void 0,Ea=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":X1&&X1 in Object(e)?hO(e):dO(e)},Wo=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},Uw=function(e){if(!Wo(e))return!1;var t=Ea(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},cp=qi["__core-js_shared__"],K1=(function(){var e=/[^.]+$/.exec(cp&&cp.keys&&cp.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),pO=function(e){return!!K1&&K1 in e},gO=Function.prototype.toString,fs=function(e){if(e!=null){try{return gO.call(e)}catch{}try{return e+""}catch{}}return""},mO=/^\[object .+?Constructor\]$/,_O=Function.prototype,vO=Object.prototype,yO=_O.toString,bO=vO.hasOwnProperty,SO=RegExp("^"+yO.call(bO).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xO=function(e){return!(!Wo(e)||pO(e))&&(Uw(e)?SO:mO).test(fs(e))},wO=function(e,t){return e==null?void 0:e[t]},ds=function(e,t){var n=wO(e,t);return xO(n)?n:void 0},Xo=ds(qi,"Map"),Ko=ds(Object,"create"),CO=function(){this.__data__=Ko?Ko(null):{},this.size=0},EO=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kO=Object.prototype.hasOwnProperty,AO=function(e){var t=this.__data__;if(Ko){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return kO.call(t,e)?t[e]:void 0},NO=Object.prototype.hasOwnProperty,TO=function(e){var t=this.__data__;return Ko?t[e]!==void 0:NO.call(t,e)},RO=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ko&&t===void 0?"__lodash_hash_undefined__":t,this};function ra(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ra.prototype.clear=CO,ra.prototype.delete=EO,ra.prototype.get=AO,ra.prototype.has=TO,ra.prototype.set=RO;var Z1=ra,DO=function(){this.size=0,this.__data__={hash:new Z1,map:new(Xo||rh),string:new Z1}},MO=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},sh=function(e,t){var n=e.__data__;return MO(t)?n[typeof t=="string"?"string":"hash"]:n.map},jO=function(e){var t=sh(this,e).delete(e);return this.size-=t?1:0,t},LO=function(e){return sh(this,e).get(e)},OO=function(e){return sh(this,e).has(e)},BO=function(e,t){var n=sh(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function sa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sa.prototype.clear=DO,sa.prototype.delete=jO,sa.prototype.get=LO,sa.prototype.has=OO,sa.prototype.set=BO;var ah=sa,IO=function(e,t){var n=this.__data__;if(n instanceof rh){var r=n.__data__;if(!Xo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ah(r)}return n.set(e,t),this.size=n.size,this};function aa(e){var t=this.__data__=new rh(e);this.size=t.size}aa.prototype.clear=rO,aa.prototype.delete=sO,aa.prototype.get=aO,aa.prototype.has=oO,aa.prototype.set=IO;var fu=aa,zO=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},HO=function(e){return this.__data__.has(e)};function du(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ah;++t<n;)this.add(e[t])}du.prototype.add=du.prototype.push=zO,du.prototype.has=HO;var FO=du,PO=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},UO=function(e,t){return e.has(t)},$w=function(e,t,n,r,a,l){var u=1&n,o=e.length,c=t.length;if(o!=c&&!(u&&c>o))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,_=!0,v=2&n?new FO:void 0;for(l.set(e,t),l.set(t,e);++d<o;){var w=e[d],C=t[d];if(r)var b=u?r(C,w,d,t,e,l):r(w,C,d,e,t,l);if(b!==void 0){if(b)continue;_=!1;break}if(v){if(!PO(t,(function(S,x){if(!UO(v,x)&&(w===S||a(w,S,n,r,l)))return v.push(x)}))){_=!1;break}}else if(w!==C&&!a(w,C,n,r,l)){_=!1;break}}return l.delete(e),l.delete(t),_},Q1=qi.Uint8Array,$O=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r,a){n[++t]=[a,r]})),n},GO=function(e){var t=-1,n=Array(e.size);return e.forEach((function(r){n[++t]=r})),n},J1=hi?hi.prototype:void 0,up=J1?J1.valueOf:void 0,qO=function(e,t,n,r,a,l,u){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new Q1(e),new Q1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Hw(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=$O;case"[object Set]":var c=1&r;if(o||(o=GO),e.size!=t.size&&!c)return!1;var f=u.get(e);if(f)return f==t;r|=2,u.set(e,t);var p=$w(o(e),o(t),r,a,l,u);return u.delete(e),p;case"[object Symbol]":if(up)return up.call(e)==up.call(t)}return!1},Gw=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e},Mn=Array.isArray,VO=function(e,t,n){var r=t(e);return Mn(e)?r:Gw(r,n(e))},YO=function(e,t){for(var n=-1,r=e==null?0:e.length,a=0,l=[];++n<r;){var u=e[n];t(u,n,e)&&(l[a++]=u)}return l},WO=function(){return[]},XO=Object.prototype.propertyIsEnumerable,eb=Object.getOwnPropertySymbols,KO=eb?function(e){return e==null?[]:(e=Object(e),YO(eb(e),(function(t){return XO.call(e,t)})))}:WO,ZO=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},da=function(e){return e!=null&&typeof e=="object"},tb=function(e){return da(e)&&Ea(e)=="[object Arguments]"},qw=Object.prototype,QO=qw.hasOwnProperty,JO=qw.propertyIsEnumerable,oh=tb((function(){return arguments})())?tb:function(e){return da(e)&&QO.call(e,"callee")&&!JO.call(e,"callee")},e6=function(){return!1},Au=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?qi.Buffer:void 0,l=(a?a.isBuffer:void 0)||e6;e.exports=l})),t6=/^(?:0|[1-9]\d*)$/,Vw=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&t6.test(e))&&e>-1&&e%1==0&&e<t},_m=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},wt={};wt["[object Float32Array]"]=wt["[object Float64Array]"]=wt["[object Int8Array]"]=wt["[object Int16Array]"]=wt["[object Int32Array]"]=wt["[object Uint8Array]"]=wt["[object Uint8ClampedArray]"]=wt["[object Uint16Array]"]=wt["[object Uint32Array]"]=!0,wt["[object Arguments]"]=wt["[object Array]"]=wt["[object ArrayBuffer]"]=wt["[object Boolean]"]=wt["[object DataView]"]=wt["[object Date]"]=wt["[object Error]"]=wt["[object Function]"]=wt["[object Map]"]=wt["[object Number]"]=wt["[object Object]"]=wt["[object RegExp]"]=wt["[object Set]"]=wt["[object String]"]=wt["[object WeakMap]"]=!1;var n6=function(e){return da(e)&&_m(e.length)&&!!wt[Ea(e)]},i6=function(e){return function(t){return e(t)}},nb=fl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&Fw.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),ib=nb&&nb.isTypedArray,vm=ib?i6(ib):n6,r6=Object.prototype.hasOwnProperty,s6=function(e,t){var n=Mn(e),r=!n&&oh(e),a=!n&&!r&&Au(e),l=!n&&!r&&!a&&vm(e),u=n||r||a||l,o=u?ZO(e.length,String):[],c=o.length;for(var f in e)!r6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Vw(f,c))||o.push(f);return o},a6=Object.prototype,Yw=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||a6)},o6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),l6=Object.prototype.hasOwnProperty,Ww=function(e){if(!Yw(e))return o6(e);var t=[];for(var n in Object(e))l6.call(e,n)&&n!="constructor"&&t.push(n);return t},lh=function(e){return e!=null&&_m(e.length)&&!Uw(e)},ym=function(e){return lh(e)?s6(e):Ww(e)},rb=function(e){return VO(e,ym,KO)},c6=Object.prototype.hasOwnProperty,u6=function(e,t,n,r,a,l){var u=1&n,o=rb(e),c=o.length;if(c!=rb(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:c6.call(t,p)))return!1}var d=l.get(e),_=l.get(t);if(d&&_)return d==t&&_==e;var v=!0;l.set(e,t),l.set(t,e);for(var w=u;++f<c;){var C=e[p=o[f]],b=t[p];if(r)var S=u?r(b,C,p,t,e,l):r(C,b,p,e,t,l);if(!(S===void 0?C===b||a(C,b,n,r,l):S)){v=!1;break}w||(w=p=="constructor")}if(v&&!w){var x=e.constructor,y=t.constructor;x==y||!("constructor"in e)||!("constructor"in t)||typeof x=="function"&&x instanceof x&&typeof y=="function"&&y instanceof y||(v=!1)}return l.delete(e),l.delete(t),v},Zp=ds(qi,"DataView"),Qp=ds(qi,"Promise"),Jp=ds(qi,"Set"),eg=ds(qi,"WeakMap"),h6=fs(Zp),f6=fs(Xo),d6=fs(Qp),p6=fs(Jp),g6=fs(eg),Kr=Ea;(Zp&&Kr(new Zp(new ArrayBuffer(1)))!="[object DataView]"||Xo&&Kr(new Xo)!="[object Map]"||Qp&&Kr(Qp.resolve())!="[object Promise]"||Jp&&Kr(new Jp)!="[object Set]"||eg&&Kr(new eg)!="[object WeakMap]")&&(Kr=function(e){var t=Ea(e),n=t=="[object Object]"?e.constructor:void 0,r=n?fs(n):"";if(r)switch(r){case h6:return"[object DataView]";case f6:return"[object Map]";case d6:return"[object Promise]";case p6:return"[object Set]";case g6:return"[object WeakMap]"}return t});var tg=Kr,Vc="[object Object]",sb=Object.prototype.hasOwnProperty,m6=function(e,t,n,r,a,l){var u=Mn(e),o=Mn(t),c=u?"[object Array]":tg(e),f=o?"[object Array]":tg(t),p=(c=c=="[object Arguments]"?Vc:c)==Vc,d=(f=f=="[object Arguments]"?Vc:f)==Vc,_=c==f;if(_&&Au(e)){if(!Au(t))return!1;u=!0,p=!1}if(_&&!p)return l||(l=new fu),u||vm(e)?$w(e,t,n,r,a,l):qO(e,t,c,n,r,a,l);if(!(1&n)){var v=p&&sb.call(e,"__wrapped__"),w=d&&sb.call(t,"__wrapped__");if(v||w){var C=v?e.value():e,b=w?t.value():t;return l||(l=new fu),a(C,b,n,r,l)}}return!!_&&(l||(l=new fu),u6(e,t,n,r,a,l))},ch=function e(t,n,r,a,l){return t===n||(t==null||n==null||!da(t)&&!da(n)?t!=t&&n!=n:m6(t,n,r,a,e,l))},_6=function(e,t,n,r){var a=n.length,l=a;if(e==null)return!l;for(e=Object(e);a--;){var u=n[a];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<l;){var o=(u=n[a])[0],c=e[o],f=u[1];if(u[2]){if(c===void 0&&!(o in e))return!1}else{var p=new fu,d;if(!(d===void 0?ch(f,c,3,r,p):d))return!1}}return!0},Xw=function(e){return e==e&&!Wo(e)},v6=function(e){for(var t=ym(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,Xw(a)]}return t},Kw=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},y6=function(e){var t=v6(e);return t.length==1&&t[0][2]?Kw(t[0][0],t[0][1]):function(n){return n===e||_6(n,e,t)}},uh=function(e){return typeof e=="symbol"||da(e)&&Ea(e)=="[object Symbol]"},b6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S6=/^\w*$/,bm=function(e,t){if(Mn(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!uh(e))||S6.test(e)||!b6.test(e)||t!=null&&e in Object(t)};function Sm(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],l=n.cache;if(l.has(a))return l.get(a);var u=e.apply(this,r);return n.cache=l.set(a,u)||l,u};return n.cache=new(Sm.Cache||ah),n}Sm.Cache=ah;var x6=Sm,w6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C6=/\\(\\)?/g,E6=(function(e){var t=x6(e,(function(r){return n.size===500&&n.clear(),r})),n=t.cache;return t})((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(w6,(function(n,r,a,l){t.push(a?l.replace(C6,"$1"):r||n)})),t})),Zw=function(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},ab=hi?hi.prototype:void 0,ob=ab?ab.toString:void 0,k6=function e(t){if(typeof t=="string")return t;if(Mn(t))return Zw(t,e)+"";if(uh(t))return ob?ob.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},A6=function(e){return e==null?"":k6(e)},Qw=function(e,t){return Mn(e)?e:bm(e,t)?[e]:E6(A6(e))},hh=function(e){if(typeof e=="string"||uh(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},Jw=function(e,t){for(var n=0,r=(t=Qw(t,e)).length;e!=null&&n<r;)e=e[hh(t[n++])];return n&&n==r?e:void 0},N6=function(e,t,n){var r=e==null?void 0:Jw(e,t);return r===void 0?n:r},T6=function(e,t){return e!=null&&t in Object(e)},R6=function(e,t,n){for(var r=-1,a=(t=Qw(t,e)).length,l=!1;++r<a;){var u=hh(t[r]);if(!(l=e!=null&&n(e,u)))break;e=e[u]}return l||++r!=a?l:!!(a=e==null?0:e.length)&&_m(a)&&Vw(u,a)&&(Mn(e)||oh(e))},D6=function(e,t){return e!=null&&R6(e,t,T6)},M6=function(e,t){return bm(e)&&Xw(t)?Kw(hh(e),t):function(n){var r=N6(n,e);return r===void 0&&r===t?D6(n,e):ch(t,r,3)}},j6=function(e){return e},L6=function(e){return function(t){return t==null?void 0:t[e]}},O6=function(e){return function(t){return Jw(t,e)}},B6=function(e){return bm(e)?L6(hh(e)):O6(e)},fh=function(e){return typeof e=="function"?e:e==null?j6:typeof e=="object"?Mn(e)?M6(e[0],e[1]):y6(e):B6(e)},I6=/\s/,z6=function(e){for(var t=e.length;t--&&I6.test(e.charAt(t)););return t},H6=/^\s+/,F6=function(e){return e&&e.slice(0,z6(e)+1).replace(H6,"")},P6=/^[-+]0x[0-9a-f]+$/i,U6=/^0b[01]+$/i,$6=/^0o[0-7]+$/i,G6=parseInt,q6=function(e){if(typeof e=="number")return e;if(uh(e))return NaN;if(Wo(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Wo(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=F6(e);var n=U6.test(e);return n||$6.test(e)?G6(e.slice(2),n?2:8):P6.test(e)?NaN:+e},V6=function(e){return e?(e=q6(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0},Y6=function(e){var t=V6(e),n=t%1;return t==t?n?t-n:t:0};function kr(e){if(!e)throw new Error("change is not provided");if(Ui(e))return"N".concat(e.oldLineNumber);var t=Tr(e)?"I":"D";return"".concat(t).concat(e.lineNumber)}mm("old");var dh=Yo("old"),ph=Yo("new");zw("old");zw("new");mm("new");mm("old");var lb=(function(){try{var e=ds(Object,"defineProperty");return e({},"",{}),e}catch{}})(),xm=function(e,t,n){t=="__proto__"&&lb?lb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},W6=function(e){return function(t,n,r){for(var a=-1,l=Object(t),u=r(t),o=u.length;o--;){var c=u[++a];if(n(l[c],c,l)===!1)break}return t}},X6=W6(),eC=function(e,t){return e&&X6(e,t,ym)},tC=function(e,t){var n={};return t=fh(t),eC(e,(function(r,a,l){xm(n,a,t(r,a,l))})),n},K6=["changeKey","text","tokens","renderToken"],cb=function e(t,n){var r=t.type,a=t.value,l=t.markType,u=t.properties,o=t.className,c=t.children,f=function(d){return m.jsx("span",{className:d,children:a||c&&c.map(e)},n)};switch(r){case"text":return a;case"mark":return f("diff-code-mark diff-code-mark-".concat(l));case"edit":return f("diff-code-edit");default:var p=u&&u.className;return f(Nn(o||p))}};function Z6(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=Je(e,1)[0];return t.type==="text"&&!t.value}return!0}function Q6(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Ar(e,K6),u=a?function(o,c){return a(o,cb,c)}:cb;return m.jsx("td",lt(lt({},l),{},{"data-change-key":t,children:r?Z6(r)?" ":r.map(u):n||" "}))}var nC=V.memo(Q6);function iC(e,t){return function(){var n=t==="old"?dh(e):ph(e);return n===-1?void 0:n}}function rC(e,t){return function(n){return e&&n?m.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Nu(e,t){return t?function(n){e(),t(n)}:e}function ub(e,t,n,r){return V.useMemo((function(){var a=tC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=Nu(n,a.onMouseEnter),a.onMouseLeave=Nu(r,a.onMouseLeave),a}),[e,n,r,t])}function hb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:iC(t,r),wrapInAnchor:rC(a,l)};return m.jsx("td",lt(lt({className:e},u),{},{"data-change-key":n,children:c(f)}))}function J6(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.gutterAnchor,C=e.generateAnchorID,b=e.renderToken,S=e.renderGutter,x=a.type,y=a.content,E=kr(a),R=(t=Je(V.useState(!1),2),n=t[0],r=t[1],[n,V.useCallback((function(){return r(!0)}),[]),V.useCallback((function(){return r(!1)}),[])]),N=Je(R,3),D=N[0],T=N[1],j=N[2],B=V.useMemo((function(){return{change:a}}),[a]),z=ub(d,B,T,j),G=ub(_,B,T,j),U=C(a),H=c({changes:[a],defaultGenerate:function(){return o}}),Y=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),q=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return m.jsxs("tr",{id:U,className:Nn("diff-line",H),children:[!v&&hb(Y,a,E,"old",w,U,z,D,S),!v&&hb(Y,a,E,"new",w,U,z,D,S),m.jsx(nC,lt({className:q,changeKey:E,text:y,tokens:u,renderToken:b},G))]})}var e8=V.memo(J6);function t8(e){var t=e.hideGutter,n=e.element;return m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var n8=["hideGutter","selectedChanges","tokens","lineClassName"],i8=["hunk","widgets","className"];function r8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,i8),l=(function(u,o){return u.reduce((function(c,f){var p=kr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,3),p=f[0],d=f[1],_=f[2],v=c.hideGutter,w=c.selectedChanges,C=c.tokens,b=c.lineClassName,S=Ar(c,n8);if(p==="change"){var x=Dn(_)?"old":"new",y=Dn(_)?dh(_):ph(_),E=C?C[x][y-1]:null;return m.jsx(e8,lt({className:b,change:_,hideGutter:v,selected:w.includes(d),tokens:E},S),"change".concat(d))}return p==="widget"?m.jsx(t8,{hideGutter:v,element:_},"widget".concat(d)):null})(u,a)}))})}var sC=0;function Yc(e,t,n,r){var a=V.useCallback((function(){return t(e)}),[e,t]),l=V.useCallback((function(){return t("")}),[t]);return V.useMemo((function(){var u=tC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=Nu(a,u.onMouseEnter),u.onMouseLeave=Nu(l,u.onMouseLeave),u}),[n,r,a,e,l])}function hp(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,_=e.hideGutter,v=e.hover,w=e.renderToken,C=e.renderGutter;if(!t){var b=Nn("diff-gutter","diff-gutter-omit",l),S=Nn("diff-code","diff-code-omit",u);return[!_&&m.jsx("td",{className:b},"gutter"),m.jsx("td",{className:S},"code")]}var x=t.type,y=t.content,E=kr(t),R=n===sC?"old":"new",N=lt({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),Wp({"diff-gutter-selected":r},"diff-line-hover-"+R,v),l),children:C({change:t,side:R,inHoverState:v,renderDefault:iC(t,R),wrapInAnchor:rC(p,d)})},o),D=Nn("diff-code","diff-code-".concat(x),Wp({"diff-code-selected":r},"diff-line-hover-"+R,v),u);return[!_&&m.jsx("td",lt(lt({},N),{},{"data-change-key":E}),"gutter"),m.jsx(nC,lt({className:D,changeKey:E,text:y,tokens:a,renderToken:w},c),"code")]}function s8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,_=e.codeEvents,v=e.hideGutter,w=e.generateAnchorID,C=e.generateLineClassName,b=e.gutterAnchor,S=e.renderToken,x=e.renderGutter,y=Je(V.useState(""),2),E=y[0],R=y[1],N=Yc("old",R,n,d),D=Yc("new",R,r,d),T=Yc("old",R,n,_),j=Yc("new",R,r,_),B=n&&w(n),z=r&&w(r),G=C({changes:[n,r],defaultGenerate:function(){return t}}),U={monotonous:c,hideGutter:v,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:_,renderToken:S,renderGutter:x},H=lt(lt({},U),{},{change:n,side:sC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:b,gutterAnchorTarget:B,hover:E==="old"}),Y=lt(lt({},U),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:D,codeEvents:j,anchorID:n===r?null:z,gutterAnchor:b,gutterAnchorTarget:n===r?B:z,hover:E==="new"});if(c)return m.jsx("tr",{className:Nn("diff-line",G),children:hp(n?H:Y)});var q=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return m.jsxs("tr",{className:Nn("diff-line",q,G),children:[hp(H),hp(Y)]})}var a8=V.memo(s8);function o8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?m.jsx("tr",{className:"diff-widget",children:m.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):m.jsxs("tr",{className:"diff-widget",children:[m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),m.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var l8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],c8=["hunk","widgets","className"];function Wc(e,t){return(e?kr(e):"00")+(t?kr(t):"00")}function u8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Ar(e,c8),l=(function(u,o){for(var c=function(S){if(!S)return null;var x=kr(S);return o[x]||null},f=[],p=0;p<u.length;p++){var d=u[p];if(Ui(d))f.push(["change",Wc(d,d),d,d]);else if(Dn(d)){var _=u[p+1];_&&Tr(_)?(p+=1,f.push(["change",Wc(d,_),d,_])):f.push(["change",Wc(d,null),d,null])}else f.push(["change",Wc(null,d),null,d]);var v=f[f.length-1],w=c(v[2]),C=c(v[3]);if(w||C){var b=v[1];f.push(["widget",b,w,C])}}return f})(t.changes,n);return m.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=Je(o,4),p=f[0],d=f[1],_=f[2],v=f[3],w=c.selectedChanges,C=c.monotonous,b=c.hideGutter,S=c.tokens,x=c.lineClassName,y=Ar(c,l8);if(p==="change"){var E=!!_&&w.includes(kr(_)),R=!!v&&w.includes(kr(v)),N=_&&S?S.old[dh(_)-1]:null,D=v&&S?S.new[ph(v)-1]:null;return m.jsx(a8,lt({className:x,oldChange:_,newChange:v,monotonous:C,hideGutter:b,oldSelected:E,newSelected:R,oldTokens:N,newTokens:D},y),"change".concat(d))}return p==="widget"?m.jsx(o8,{monotonous:C,hideGutter:b,oldElement:_,newElement:v},"widget".concat(d)):null})(u,a)}))})}var h8=["gutterType","hunkClassName"];function f8(e){var t=e.hunk,n=GL(),r=n.gutterType,a=n.hunkClassName,l=Ar(n,h8),u=r==="none",o=r==="anchor",c=l.viewType==="unified"?r8:u8;return m.jsx(c,lt(lt({},l),{},{hunk:t,hideGutter:u,gutterAnchor:o,className:a}))}function d8(){}function fb(e,t){var n=t?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function p8(e){return e.map((function(t){return m.jsx(f8,{hunk:t},(function(n){return"-".concat(n.oldStart,",").concat(n.oldLines," +").concat(n.newStart,",").concat(n.newLines)})(t))}))}function g8(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,a=e.className,l=e.hunkClassName,u=l===void 0?gn.hunkClassName:l,o=e.lineClassName,c=o===void 0?gn.lineClassName:o,f=e.generateLineClassName,p=f===void 0?gn.generateLineClassName:f,d=e.gutterClassName,_=d===void 0?gn.gutterClassName:d,v=e.codeClassName,w=v===void 0?gn.codeClassName:v,C=e.gutterType,b=C===void 0?gn.gutterType:C,S=e.viewType,x=S===void 0?gn.viewType:S,y=e.gutterEvents,E=y===void 0?gn.gutterEvents:y,R=e.codeEvents,N=R===void 0?gn.codeEvents:R,D=e.generateAnchorID,T=D===void 0?gn.generateAnchorID:D,j=e.selectedChanges,B=j===void 0?gn.selectedChanges:j,z=e.widgets,G=z===void 0?gn.widgets:z,U=e.renderGutter,H=U===void 0?gn.renderGutter:U,Y=e.tokens,q=e.renderToken,X=e.children,K=X===void 0?p8:X,L=V.useRef(null),M=V.useCallback((function(ae){var Z=ae.target;if(ae.button===0){var P=(function(be,ke){for(var Ee=be;Ee&&Ee!==document.documentElement&&!Ee.classList.contains(ke);)Ee=Ee.parentElement;return Ee===document.documentElement?null:Ee})(Z,"diff-code");if(P&&P.parentElement){var ee=window.getSelection();ee&&ee.removeAllRanges();var ne=Rn(P.parentElement.children).indexOf(P);if(ne===1||ne===3){var ge,he=gm(L.current?L.current.querySelectorAll(".diff-line"):[]);try{for(he.s();!(ge=he.n()).done;){var ye=ge.value.children;fb(ye[1],ne===1),fb(ye[3],ne===3)}}catch(be){he.e(be)}finally{he.f()}}}}}),[]),O=b==="none",$=t==="add"||t==="delete",F=x==="split"&&!$&&r?M:d8,Q=V.useMemo((function(){return m.jsxs("colgroup",x==="unified"?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:$?{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]}:{children:[!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{}),!O&&m.jsx("col",{className:"diff-gutter-col"}),m.jsx("col",{})]})}),[x,$,O]),re=V.useMemo((function(){return{hunkClassName:u,lineClassName:c,generateLineClassName:p,gutterClassName:_,codeClassName:w,monotonous:$,hideGutter:O,viewType:x,gutterType:b,codeEvents:N,gutterEvents:E,generateAnchorID:T,selectedChanges:B,widgets:G,renderGutter:H,tokens:Y,renderToken:q}}),[w,N,T,_,E,b,O,u,c,p,$,H,q,B,Y,x,G]);return m.jsx($L,{value:re,children:m.jsxs("table",{ref:L,className:Nn("diff","diff-".concat(x),a),onMouseDown:F,children:[Q,K(n)]})})}var m8=V.memo(g8),_8=function(e,t,n,r){for(var a=-1,l=e==null?0:e.length;++a<l;){var u=e[a];t(r,u,n(u),e)}return r},v8=function(e,t){return function(n,r){if(n==null)return n;if(!lh(n))return e(n,r);for(var a=n.length,l=-1,u=Object(n);++l<a&&r(u[l],l,u)!==!1;);return n}},aC=v8(eC),y8=function(e,t,n,r){return aC(e,(function(a,l,u){t(r,a,n(a),u)})),r},oC=function(e,t){return function(n,r){var a=Mn(n)?_8:y8,l=t?t():{};return a(n,e,fh(r),l)}},b8=oC((function(e,t,n){xm(e,n,t)})),db=hi?hi.isConcatSpreadable:void 0,S8=function(e){return Mn(e)||oh(e)||!!(db&&e&&e[db])},lC=function(t,n,r,a,l){var u=-1,o=t.length;for(r||(r=S8),l||(l=[]);++u<o;){var c=t[u];r(c)?Gw(l,c):l[l.length]=c}return l},x8=function(e,t){var n=-1,r=lh(e)?Array(e.length):[];return aC(e,(function(a,l,u){r[++n]=t(a,l,u)})),r},w8=function(e,t){return(Mn(e)?Zw:x8)(e,fh(t))},wm=function(e,t){return lC(w8(e,t))};function C8(e,t){var n=t.newStart,r=t.changes.reduce((function(a,l){var u=Je(a,2),o=u[0],c=u[1];return Dn(l)?(o.splice(c,1),[o,c]):(Tr(l)&&o.splice(c,0,l.content),[o,c+1])}),[e,n-1]);return Je(r,1)[0]}function pb(e,t,n){if(!e.length)return[];var r=t==="old"?dh:ph,a=b8(e,r),l=r(e[e.length-1]);return Array.from({length:l}).map((function(u,o){return n(a[o+1])}))}function E8(e){var t=(function(u){return wm(u,(function(o){return o.changes})).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1];return Ui(c)?(p.push(c),d.push(c)):Dn(c)?p.push(c):d.push(c),[p,d]}),[[],[]])})(e),n=Je(t,2),r=n[0],a=n[1],l=function(u){return u?u.content:""};return[pb(r,"old",l).join(` -`),pb(a,"new",l).join(` -`)]}function Xc(e){return{type:"root",children:e}}function k8(e,t){if(t.oldSource){var n=(function(c,f){return f.reduce(C8,c.split(` -`)).join(` -`)})(t.oldSource,e),r=t.highlight?function(c){return t.refractor.highlight(c,t.language)}:function(c){return[{type:"text",value:c}]};return[Xc(r(t.oldSource)),Xc(r(n))]}var a=Je(E8(e),2),l=a[0],u=a[1],o=t.highlight?function(c){return Xc(t.refractor.highlight(c,t.language))}:function(c){return Xc([{type:"text",value:c}])};return[o(l),o(u)]}function oa(e){return e.map((function(t){return lt({},t)}))}function A8(e,t){return[].concat(Rn(oa(e.slice(0,-1))),[t])}function N8(e){return e.type==="text"}function Cm(e){var t=e[e.length-1];if(N8(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function T8(e,t,n,r){var a=e.slice(0,-1),l=Cm(e),u=[];if(n<=0||t>=(l==null?void 0:l.value.length))return[e];var o=function(d,_){var v=l.value.slice(d,_);return[].concat(Rn(a),[lt(lt({},l),{},{value:v})])};if(t>0){var c=o(0,t);u.push(oa(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,_){return[_].concat(Rn(oa(d)))})(f,r):oa(f)),n<l.value.length){var p=o(n);u.push(oa(p))}return u}var R8=["children"];function cC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Ar(e,R8);n.push(a);var l,u=gm(r);try{for(u.s();!(l=u.n()).done;)cC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(oa([].concat(Rn(n.slice(1)),[e])));return t}function D8(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Cm(c);return f.value.includes(` -`)?f.value.split(` -`).map((function(p){return A8(c,lt(lt({},f),{},{value:p}))})):[c]})(n),l=Mw(a),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(r),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function gb(e){return D8(cC(e))}var M8=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?ch(e,t,void 0,n):!!r},j8=function(e,t){return ch(e,t)},L8=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function O8(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,a=L8(e.children);return a&&(r=t,(n=a).type===r.type&&(n.type==="text"||n.children&&r.children&&M8(n,r,(function(l,u,o){return o==="chlidren"||j8(l,u)}))))?e.children[e.children.length-1]=(function(l,u){return"value"in l&&"value"in u?lt(lt({},l),{},{value:"".concat(l.value).concat(u.value)}):l})(a,t):e.children.push(t),e.children[e.children.length-1]}function mb(e){var t,n={type:"root",children:[]},r=gm(e);try{var a=function(){var l=t.value;l.reduce((function(u,o,c){return O8(u,c===l.length-1?lt({},o):lt(lt({},o),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)a()}catch(l){r.e(l)}finally{r.f()}return n}var B8=Object.prototype.hasOwnProperty,I8=oC((function(e,t,n){B8.call(e,n)?e[n].push(t):xm(e,n,[t])})),z8=Object.prototype.hasOwnProperty,H8=function(e){if(e==null)return!0;if(lh(e)&&(Mn(e)||typeof e=="string"||typeof e.splice=="function"||Au(e)||vm(e)||oh(e)))return!e.length;var t=tg(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(Yw(e))return!Ww(e).length;for(var n in e)if(z8.call(e,n))return!1;return!0},F8=function(e,t){var n=t.start,r=t.length,a=n+r,l=e.reduce((function(u,o){var c=Je(u,2),f=c[0],p=c[1],d=p+Cm(o).value.length;if(p>a||d<n)f.push(o);else{var _=T8(o,n-p,a-p,t);f.push.apply(f,Rn(_))}return[f,d]}),[[],0]);return Je(l,1)[0]};function _b(e,t){var n=I8(t,"lineNumber");return e.map((function(r,a){return(function(l,u){return H8(u)?l:u.reduce(F8,l)})(r,n[a+1])}))}function P8(e,t){return function(n){var r=Je(n,2),a=r[0],l=r[1];return[_b(a,e),_b(l,t)]}}var vb=function(e){return e!=null&&e.length?lC(e):[]},U8=Math.max,yb=function(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:Y6(n);return a<0&&(a=U8(r+a,0)),ZL(e,fh(t),a)},gh=fl((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(n,r){return[n,r]},t.prototype.diff_main=function(n,r,a,l){l===void 0&&(l=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=l;if(n==null||r==null)throw new Error("Null input. (diff_main)");if(n==r)return n?[new t.Diff(0,n)]:[];a===void 0&&(a=!0);var o=a,c=this.diff_commonPrefix(n,r),f=n.substring(0,c);n=n.substring(c),r=r.substring(c),c=this.diff_commonSuffix(n,r);var p=n.substring(n.length-c);n=n.substring(0,n.length-c),r=r.substring(0,r.length-c);var d=this.diff_compute_(n,r,o,u);return f&&d.unshift(new t.Diff(0,f)),p&&d.push(new t.Diff(0,p)),this.diff_cleanupMerge(d),d},t.prototype.diff_compute_=function(n,r,a,l){var u;if(!n)return[new t.Diff(1,r)];if(!r)return[new t.Diff(-1,n)];var o=n.length>r.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],_=p[1],v=p[2],w=p[3],C=p[4],b=this.diff_main(d,v,a,l),S=this.diff_main(_,w,a,l);return b.concat([new t.Diff(0,C)],S)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",_="";c<o.length;){switch(o[c][0]){case 1:p++,_+=o[c][1];break;case-1:f++,d+=o[c][1];break;case 0:if(f>=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var v=this.diff_main(d,_,!1,a),w=v.length-1;w>=0;w--)o.splice(c,0,v[w]);c+=v.length}p=0,f=0,d="",_=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),_=0;_<f;_++)p[_]=-1,d[_]=-1;p[c+1]=0,d[c+1]=0;for(var v=l-u,w=v%2!=0,C=0,b=0,S=0,x=0,y=0;y<o&&!(new Date().getTime()>a);y++){for(var E=-y+C;E<=y-b;E+=2){for(var R=c+E,N=(z=E==-y||E!=y&&p[R-1]<p[R+1]?p[R+1]:p[R-1]+1)-E;z<l&&N<u&&n.charAt(z)==r.charAt(N);)z++,N++;if(p[R]=z,z>l)b+=2;else if(N>u)C+=2;else if(w&&(j=c+v-E)>=0&&j<f&&d[j]!=-1&&z>=(T=l-d[j]))return this.diff_bisectSplit_(n,r,z,N,a)}for(var D=-y+S;D<=y-x;D+=2){for(var T,j=c+D,B=(T=D==-y||D!=y&&d[j-1]<d[j+1]?d[j+1]:d[j-1]+1)-D;T<l&&B<u&&n.charAt(l-T-1)==r.charAt(u-B-1);)T++,B++;if(d[j]=T,T>l)x+=2;else if(B>u)S+=2;else if(!w&&(R=c+v-D)>=0&&R<f&&p[R]!=-1){var z;if(N=c+(z=p[R])-R,z>=(T=l-T))return this.diff_bisectSplit_(n,r,z,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),_=this.diff_main(f,p,!1,u);return d.concat(_)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,_=-1,v=a.length;_<f.length-1;){(_=f.indexOf(` -`,d))==-1&&(_=f.length-1);var w=f.substring(d,_+1);(l.hasOwnProperty?l.hasOwnProperty(w):l[w]!==void 0)?p+=String.fromCharCode(l[w]):(v==o&&(w=f.substring(d),_=f.length),p+=String.fromCharCode(v),l[w]=v,a[v++]=w),d=_+1}return p}a[0]="";var o=4e4,c=u(n);return o=65535,{chars1:c,chars2:u(r),lineArray:a}},t.prototype.diff_charsToLines_=function(n,r){for(var a=0;a<n.length;a++){for(var l=n[a][1],u=[],o=0;o<l.length;o++)u[o]=r[l.charCodeAt(o)];n[a][1]=u.join("")}},t.prototype.diff_commonPrefix=function(n,r){if(!n||!r||n.charAt(0)!=r.charAt(0))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(o,u)==r.substring(o,u)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonSuffix=function(n,r){if(!n||!r||n.charAt(n.length-1)!=r.charAt(r.length-1))return 0;for(var a=0,l=Math.min(n.length,r.length),u=l,o=0;a<u;)n.substring(n.length-u,n.length-o)==r.substring(r.length-u,r.length-o)?o=a=u:l=u,u=Math.floor((l-a)/2+a);return u},t.prototype.diff_commonOverlap_=function(n,r){var a=n.length,l=r.length;if(a==0||l==0)return 0;a>l?n=n.substring(a-l):a<l&&(r=r.substring(0,a));var u=Math.min(a,l);if(n==r)return u;for(var o=0,c=1;;){var f=n.substring(u-c),p=r.indexOf(f);if(p==-1)return o;c+=p,p!=0&&n.substring(u-c)!=r.substring(0,c)||(o=c,c++)}},t.prototype.diff_halfMatch_=function(n,r){if(this.Diff_Timeout<=0)return null;var a=n.length>r.length?n:r,l=n.length>r.length?r:n;if(a.length<4||2*l.length<a.length)return null;var u=this;function o(C,b,S){for(var x,y,E,R,N=C.substring(S,S+Math.floor(C.length/4)),D=-1,T="";(D=b.indexOf(N,D+1))!=-1;){var j=u.diff_commonPrefix(C.substring(S),b.substring(D)),B=u.diff_commonSuffix(C.substring(0,S),b.substring(0,D));T.length<B+j&&(T=b.substring(D-B,D)+b.substring(D,D+j),x=C.substring(0,S-B),y=C.substring(S+j),E=b.substring(0,D-B),R=b.substring(D+j))}return 2*T.length>=C.length?[x,y,E,R,T]:null}var c,f,p,d,_,v=o(a,l,Math.ceil(a.length/4)),w=o(a,l,Math.ceil(a.length/2));return v||w?(c=w?v&&v[4].length>w[4].length?v:w:v,n.length>r.length?(f=c[0],p=c[1],d=c[2],_=c[3]):(d=c[0],_=c[1],f=c[2],p=c[3]),[f,p,d,_,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=0,f=0,p=0,d=0;o<n.length;)n[o][0]==0?(a[l++]=o,c=p,f=d,p=0,d=0,u=n[o][1]):(n[o][0]==1?p+=n[o][1].length:d+=n[o][1].length,u&&u.length<=Math.max(c,f)&&u.length<=Math.max(p,d)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,o=--l>0?a[l-1]:-1,c=0,f=0,p=0,d=0,u=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o<n.length;){if(n[o-1][0]==-1&&n[o][0]==1){var _=n[o-1][1],v=n[o][1],w=this.diff_commonOverlap_(_,v),C=this.diff_commonOverlap_(v,_);w>=C?(w>=_.length/2||w>=v.length/2)&&(n.splice(o,0,new t.Diff(0,v.substring(0,w))),n[o-1][1]=_.substring(0,_.length-w),n[o+1][1]=v.substring(w),o++):(C>=_.length/2||C>=v.length/2)&&(n.splice(o,0,new t.Diff(0,_.substring(0,C))),n[o-1][0]=1,n[o-1][1]=v.substring(0,v.length-C),n[o+1][0]=-1,n[o+1][1]=_.substring(C),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(C,b){if(!C||!b)return 6;var S=C.charAt(C.length-1),x=b.charAt(0),y=S.match(t.nonAlphaNumericRegex_),E=x.match(t.nonAlphaNumericRegex_),R=y&&S.match(t.whitespaceRegex_),N=E&&x.match(t.whitespaceRegex_),D=R&&S.match(t.linebreakRegex_),T=N&&x.match(t.linebreakRegex_),j=D&&C.match(t.blanklineEndRegex_),B=T&&b.match(t.blanklineStartRegex_);return j||B?5:D||T?4:y&&!R&&N?3:R||N?2:y||E?1:0}for(var a=1;a<n.length-1;){if(n[a-1][0]==0&&n[a+1][0]==0){var l=n[a-1][1],u=n[a][1],o=n[a+1][1],c=this.diff_commonSuffix(l,u);if(c){var f=u.substring(u.length-c);l=l.substring(0,l.length-c),u=f+u.substring(0,u.length-c),o=f+o}for(var p=l,d=u,_=o,v=r(l,u)+r(u,o);u.charAt(0)===o.charAt(0);){l+=u.charAt(0),u=u.substring(1)+o.charAt(0),o=o.substring(1);var w=r(l,u)+r(u,o);w>=v&&(v=w,p=l,d=u,_=o)}n[a-1][1]!=p&&(p?n[a-1][1]=p:(n.splice(a-1,1),a--),n[a][1]=d,_?n[a+1][1]=_:(n.splice(a+1,1),a--))}a++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=!1,f=!1,p=!1,d=!1;o<n.length;)n[o][0]==0?(n[o][1].length<this.Diff_EditCost&&(p||d)?(a[l++]=o,c=p,f=d,u=n[o][1]):(l=0,u=null),p=d=!1):(n[o][0]==-1?d=!0:p=!0,u&&(c&&f&&p&&d||u.length<this.Diff_EditCost/2&&c+f+p+d==3)&&(n.splice(a[l-1],0,new t.Diff(-1,u)),n[a[l-1]+1][0]=1,l--,u=null,c&&f?(p=d=!0,l=0):(o=--l>0?a[l-1]:-1,p=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,a=0,l=0,u=0,o="",c="";a<n.length;)switch(n[a][0]){case 1:u++,c+=n[a][1],a++;break;case-1:l++,o+=n[a][1],a++;break;case 0:l+u>1?(l!==0&&u!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(a-l-u>0&&n[a-l-u-1][0]==0?n[a-l-u-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),a++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-r)+n[a][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),a-=l+u,n.splice(a,l+u),o.length&&(n.splice(a,0,new t.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new t.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,u=0,l=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var f=!1;for(a=1;a<n.length-1;)n[a-1][0]==0&&n[a+1][0]==0&&(n[a][1].substring(n[a][1].length-n[a-1][1].length)==n[a-1][1]?(n[a][1]=n[a-1][1]+n[a][1].substring(0,n[a][1].length-n[a-1][1].length),n[a+1][1]=n[a-1][1]+n[a+1][1],n.splice(a-1,1),f=!0):n[a][1].substring(0,n[a+1][1].length)==n[a+1][1]&&(n[a-1][1]+=n[a+1][1],n[a][1]=n[a][1].substring(n[a+1][1].length)+n[a+1][1],n.splice(a+1,1),f=!0)),a++;f&&this.diff_cleanupMerge(n)},t.prototype.diff_xIndex=function(n,r){var a,l=0,u=0,o=0,c=0;for(a=0;a<n.length&&(n[a][0]!==1&&(l+=n[a][1].length),n[a][0]!==-1&&(u+=n[a][1].length),!(l>r));a++)o=l,c=u;return n.length!=a&&n[a][0]===-1?c:c+(r-o)},t.prototype.diff_prettyHtml=function(n){for(var r=[],a=/&/g,l=/</g,u=/>/g,o=/\n/g,c=0;c<n.length;c++){var f=n[c][0],p=n[c][1].replace(a,"&").replace(l,"<").replace(u,">").replace(o,"¶<br>");switch(f){case 1:r[c]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case-1:r[c]='<del style="background:#ffe6e6;">'+p+"</del>";break;case 0:r[c]="<span>"+p+"</span>"}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_text2=function(n){for(var r=[],a=0;a<n.length;a++)n[a][0]!==-1&&(r[a]=n[a][1]);return r.join("")},t.prototype.diff_levenshtein=function(n){for(var r=0,a=0,l=0,u=0;u<n.length;u++){var o=n[u][0],c=n[u][1];switch(o){case 1:a+=c.length;break;case-1:l+=c.length;break;case 0:r+=Math.max(a,l),a=0,l=0}}return r+=Math.max(a,l)},t.prototype.diff_toDelta=function(n){for(var r=[],a=0;a<n.length;a++)switch(n[a][0]){case 1:r[a]="+"+encodeURI(n[a][1]);break;case-1:r[a]="-"+n[a][1].length;break;case 0:r[a]="="+n[a][1].length}return r.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(n,r){for(var a=[],l=0,u=0,o=r.split(/\t/g),c=0;c<o.length;c++){var f=o[c].substring(1);switch(o[c].charAt(0)){case"+":try{a[l++]=new t.Diff(1,decodeURI(f))}catch{throw new Error("Illegal escape in diff_fromDelta: "+f)}break;case"-":case"=":var p=parseInt(f,10);if(isNaN(p)||p<0)throw new Error("Invalid number in diff_fromDelta: "+f);var d=n.substring(u,u+=p);o[c].charAt(0)=="="?a[l++]=new t.Diff(0,d):a[l++]=new t.Diff(-1,d);break;default:if(o[c])throw new Error("Invalid diff operation in diff_fromDelta: "+o[c])}}if(u!=n.length)throw new Error("Delta length ("+u+") does not equal source text length ("+n.length+").");return a},t.prototype.match_main=function(n,r,a){if(n==null||r==null||a==null)throw new Error("Null input. (match_main)");return a=Math.max(0,Math.min(a,n.length)),n==r?0:n.length?n.substring(a,a+r.length)==r?a:this.match_bitap_(n,r,a):-1},t.prototype.match_bitap_=function(n,r,a){if(r.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(r),u=this;function o(N,D){var T=N/r.length,j=Math.abs(a-D);return u.Match_Distance?T+j/u.Match_Distance:j?1:T}var c=this.Match_Threshold,f=n.indexOf(r,a);f!=-1&&(c=Math.min(o(0,f),c),(f=n.lastIndexOf(r,a+r.length))!=-1&&(c=Math.min(o(0,f),c)));var p,d,_=1<<r.length-1;f=-1;for(var v,w=r.length+n.length,C=0;C<r.length;C++){for(p=0,d=w;p<d;)o(C,a+d)<=c?p=d:w=d,d=Math.floor((w-p)/2+p);w=d;var b=Math.max(1,a-d+1),S=Math.min(a+d,n.length)+r.length,x=Array(S+2);x[S+1]=(1<<C)-1;for(var y=S;y>=b;y--){var E=l[n.charAt(y-1)];if(x[y]=C===0?(x[y+1]<<1|1)&E:(x[y+1]<<1|1)&E|(v[y+1]|v[y])<<1|1|v[y+1],x[y]&_){var R=o(C,y-1);if(R<=c){if(c=R,!((f=y-1)>a))break;b=Math.max(1,2*a-f)}}}if(o(C+1,a)>c)break;v=x}return f},t.prototype.match_alphabet_=function(n){for(var r={},a=0;a<n.length;a++)r[n.charAt(a)]=0;for(a=0;a<n.length;a++)r[n.charAt(a)]|=1<<n.length-a-1;return r},t.prototype.patch_addContext_=function(n,r){if(r.length!=0){if(n.start2===null)throw Error("patch not initialized");for(var a=r.substring(n.start2,n.start2+n.length1),l=0;r.indexOf(a)!=r.lastIndexOf(a)&&a.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)l+=this.Patch_Margin,a=r.substring(n.start2-l,n.start2+n.length1+l);l+=this.Patch_Margin;var u=r.substring(n.start2-l,n.start2);u&&n.diffs.unshift(new t.Diff(0,u));var o=r.substring(n.start2+n.length1,n.start2+n.length1+l);o&&n.diffs.push(new t.Diff(0,o)),n.start1-=u.length,n.start2-=u.length,n.length1+=u.length+o.length,n.length2+=u.length+o.length}},t.prototype.patch_make=function(n,r,a){var l,u;if(typeof n=="string"&&typeof r=="string"&&a===void 0)l=n,(u=this.diff_main(l,r,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(n&&typeof n=="object"&&r===void 0&&a===void 0)u=n,l=this.diff_text1(u);else if(typeof n=="string"&&r&&typeof r=="object"&&a===void 0)l=n,u=r;else{if(typeof n!="string"||typeof r!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");l=n,u=a}if(u.length===0)return[];for(var o=[],c=new t.patch_obj,f=0,p=0,d=0,_=l,v=l,w=0;w<u.length;w++){var C=u[w][0],b=u[w][1];switch(f||C===0||(c.start1=p,c.start2=d),C){case 1:c.diffs[f++]=u[w],c.length2+=b.length,v=v.substring(0,d)+b+v.substring(d);break;case-1:c.length1+=b.length,c.diffs[f++]=u[w],v=v.substring(0,d)+v.substring(d+b.length);break;case 0:b.length<=2*this.Patch_Margin&&f&&u.length!=w+1?(c.diffs[f++]=u[w],c.length1+=b.length,c.length2+=b.length):b.length>=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,_),o.push(c),c=new t.patch_obj,f=0,_=v,p=d)}C!==1&&(p+=b.length),C!==-1&&(d+=b.length)}return f&&(this.patch_addContext_(c,_),o.push(c)),o},t.prototype.patch_deepCopy=function(n){for(var r=[],a=0;a<n.length;a++){var l=n[a],u=new t.patch_obj;u.diffs=[];for(var o=0;o<l.diffs.length;o++)u.diffs[o]=new t.Diff(l.diffs[o][0],l.diffs[o][1]);u.start1=l.start1,u.start2=l.start2,u.length1=l.length1,u.length2=l.length2,r[a]=u}return r},t.prototype.patch_apply=function(n,r){if(n.length==0)return[r,[]];n=this.patch_deepCopy(n);var a=this.patch_addPadding(n);r=a+r+a,this.patch_splitMax(n);for(var l=0,u=[],o=0;o<n.length;o++){var c,f,p=n[o].start2+l,d=this.diff_text1(n[o].diffs),_=-1;if(d.length>this.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),p))!=-1&&((_=this.match_main(r,d.substring(d.length-this.Match_MaxBits),p+d.length-this.Match_MaxBits))==-1||c>=_)&&(c=-1):c=this.match_main(r,d,p),c==-1)u[o]=!1,l-=n[o].length2-n[o].length1;else if(u[o]=!0,l=c-p,d==(f=_==-1?r.substring(c,c+d.length):r.substring(c,_+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[o].diffs)+r.substring(c+d.length);else{var v=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(v)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(v);for(var w,C=0,b=0;b<n[o].diffs.length;b++){var S=n[o].diffs[b];S[0]!==0&&(w=this.diff_xIndex(v,C)),S[0]===1?r=r.substring(0,c+w)+S[1]+r.substring(c+w):S[0]===-1&&(r=r.substring(0,c+w)+r.substring(c+this.diff_xIndex(v,C+S[1].length))),S[0]!==-1&&(C+=S[1].length)}}}}return[r=r.substring(a.length,r.length-a.length),u]},t.prototype.patch_addPadding=function(n){for(var r=this.Patch_Margin,a="",l=1;l<=r;l++)a+=String.fromCharCode(l);for(l=0;l<n.length;l++)n[l].start1+=r,n[l].start2+=r;var u=n[0],o=u.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,a)),u.start1-=r,u.start2-=r,u.length1+=r,u.length2+=r;else if(r>o[0][1].length){var c=r-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],u.start1-=c,u.start2-=c,u.length1+=c,u.length2+=c}return(o=(u=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,a)),u.length1+=r,u.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),u.length1+=c,u.length2+=c),a},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,a=0;a<n.length;a++)if(!(n[a].length1<=r)){var l=n[a];n.splice(a--,1);for(var u=l.start1,o=l.start2,c="";l.diffs.length!==0;){var f=new t.patch_obj,p=!0;for(f.start1=u-c.length,f.start2=o-c.length,c!==""&&(f.length1=f.length2=c.length,f.diffs.push(new t.Diff(0,c)));l.diffs.length!==0&&f.length1<r-this.Patch_Margin;){var d=l.diffs[0][0],_=l.diffs[0][1];d===1?(f.length2+=_.length,o+=_.length,f.diffs.push(l.diffs.shift()),p=!1):d===-1&&f.diffs.length==1&&f.diffs[0][0]==0&&_.length>2*r?(f.length1+=_.length,u+=_.length,p=!1,f.diffs.push(new t.Diff(d,_)),l.diffs.shift()):(_=_.substring(0,r-f.length1-this.Patch_Margin),f.length1+=_.length,u+=_.length,d===0?(f.length2+=_.length,o+=_.length):p=!1,f.diffs.push(new t.Diff(d,_)),_==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(_.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var v=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);v!==""&&(f.length1+=v.length,f.length2+=v.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=v:f.diffs.push(new t.Diff(0,v))),p||n.splice(++a,0,f)}}},t.prototype.patch_toText=function(n){for(var r=[],a=0;a<n.length;a++)r[a]=n[a];return r.join("")},t.prototype.patch_fromText=function(n){var r=[];if(!n)return r;for(var a=n.split(` -`),l=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;l<a.length;){var o=a[l].match(u);if(!o)throw new Error("Invalid patch string: "+a[l]);var c=new t.patch_obj;for(r.push(c),c.start1=parseInt(o[1],10),o[2]===""?(c.start1--,c.length1=1):o[2]=="0"?c.length1=0:(c.start1--,c.length1=parseInt(o[2],10)),c.start2=parseInt(o[3],10),o[4]===""?(c.start2--,c.length2=1):o[4]=="0"?c.length2=0:(c.start2--,c.length2=parseInt(o[4],10)),l++;l<a.length;){var f=a[l].charAt(0);try{var p=decodeURI(a[l].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+p)}if(f=="-")c.diffs.push(new t.Diff(-1,p));else if(f=="+")c.diffs.push(new t.Diff(1,p));else if(f==" ")c.diffs.push(new t.Diff(0,p));else{if(f=="@")break;if(f!=="")throw new Error('Invalid patch mode "'+f+'" in: '+p)}l++}}return r},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var n,r=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@ -`],a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case 1:n="+";break;case-1:n="-";break;case 0:n=" "}r[a+1]=n+encodeURI(this.diffs[a][1])+` -`}return r.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0})),$8=gh.DIFF_EQUAL,G8=gh.DIFF_DELETE,q8=gh.DIFF_INSERT;function uC(e){var t=yb(e,(function(r){return!Ui(r)}));if(t===-1)return[];var n=yb(e,(function(r){return!!Ui(r)}),t);return n===-1?[e.slice(t)]:[e.slice(t,n)].concat(Rn(uC(e.slice(n))))}function bb(e){return e.reduce((function(t,n){var r=Je(n,2),a=r[0],l=Mw(r[1].split(` -`).map((function(c){return[a,c]}))),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(t[t.length-1]),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function ng(e,t){return e.reduce((function(n,r){var a=Je(n,2),l=a[0],u=a[1],o=Je(r,2),c=o[0],f=o[1];if(c!==$8){var p={type:"edit",lineNumber:t,start:u,length:f.length};l.push(p)}return[l,u+f.length]}),[[],0])[0]}function Sb(e,t){return wm(e,(function(n,r){return ng(n,t+r)}))}function hC(e,t){var n=new gh,r=n.diff_main(e,t);return n.diff_cleanupSemantic(r),r.length<=1?[[],[]]:(function(a){return a.reduce((function(l,u){var o=Je(l,2),c=o[0],f=o[1];switch(Je(u,1)[0]){case q8:f.push(u);break;case G8:c.push(u);break;default:c.push(u),f.push(u)}return[c,f]}),[[],[]])})(r)}function V8(e){var t=e.reduce((function(f,p){var d=Je(f,2),_=d[0],v=d[1];return Dn(p)?[_+(_?` -`:"")+p.content,v]:[_,v+(v?` -`:"")+p.content]}),["",""]),n=Je(t,2),r=Je(hC(n[0],n[1]),2),a=r[0],l=r[1];if(a.length===0&&l.length===0)return[[],[]];var u=function(f){if(f&&!Ui(f))return f.lineNumber},o=u(e.find(Dn)),c=u(e.find(Tr));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[Sb(bb(a),o),Sb(bb(l),c)]}function Y8(e){var t=e.reduce((function(r,a){var l=Je(r,3),u=l[0],o=l[1],c=l[2];if(!c||!Dn(c)||!Tr(a))return[u,o,a];var f=Je(hC(c.content,a.content),2),p=f[0],d=f[1];return[u.concat(ng(p,c.lineNumber)),o.concat(ng(d,a.lineNumber)),a]}),[[],[],null]),n=Je(t,2);return[n[0],n[1]]}function W8(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?V8:Y8,r=wm(e.map((function(o){return o.changes})),uC).map(n).reduce((function(o,c){var f=Je(o,2),p=f[0],d=f[1],_=Je(c,2),v=_[0],w=_[1];return[p.concat(v),d.concat(w)]}),[[],[]]),a=Je(r,2),l=a[0],u=a[1];return P8(vb(l),vb(u))}var X8=["enhancers"],xb=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=Je(k8(e,Ar(n,X8)),2),u=l[0],o=l[1],c=[gb(u),gb(o)],f=(t=[c[0],c[1]],a.reduce((function(C,b){return b(C)}),t)),p=Je(f,2),d=p[0],_=p[1],v=[d.map(mb),_.map(mb)],w=v[1];return{old:v[0].map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]})),new:w.map((function(C){var b;return(b=C.children)!==null&&b!==void 0?b:[]}))}};const K8=2e3,Z8={highlight(e,t){return je.highlight(e,t).children}};function Q8(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function J8(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function eB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function tB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function nB(e){const t=[W8(e.hunks,{type:"line"})],n=hw(eB(e));return n&&je.registered(n)?xb(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:Z8}):xb(e.hunks,{enhancers:t,highlight:!1})}const iB=({change:e,side:t})=>t==="old"?null:Q8(e);function wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function rB({bytesRead:e,byteLimit:t}){return m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsxs("p",{children:["This diff is larger than ",wb(t)," (",wb(e)," read). View it locally with git."]})]})}function sB({file:e,defaultExpanded:t}){const[n,r]=V.useState(t),{additions:a,deletions:l}=V.useMemo(()=>J8(e),[e]),u=n&&a+l<=K8,o=V.useMemo(()=>{if(u)try{return nB(e)}catch{return}},[e,u]);return m.jsxs("section",{className:"diff-file-card",children:[m.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[m.jsx("span",{className:"chev",children:n?m.jsx(cs,{size:14}):m.jsx(Uu,{size:14})}),m.jsx("span",{className:"path",children:m.jsx("code",{children:tB(e)})}),m.jsxs("span",{className:"stats",children:[m.jsxs("span",{className:"diff-stat-add",children:["+",a]}),m.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?m.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):m.jsx(m8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:iB,tokens:o,viewType:"unified"}))]})}function fC({diff:e,className:t}){const n=V.useMemo(()=>{if(!e.trim())return[];try{return YL(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?m.jsx("div",{className:"diff-empty",children:"No changes."}):m.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>m.jsx(sB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var fp={exports:{}},Cb;function aB(){return Cb||(Cb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),_=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(_/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(fp)),fp.exports}var oB=aB(),dp={exports:{}},Eb;function lB(){return Eb||(Eb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),_=c(9924),v=c(844),w=c(4725),C=c(2585),b=c(3656);let S=o.AccessibilityManager=class extends v.Disposable{constructor(x,y,E,R){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;N<this._terminal.rows;N++)this._rowElements[N]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[N]);if(this._topBoundaryFocusListener=N=>this._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let y=0;y<x;y++)this._handleChar(" ")}_handleChar(x){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const E=this._terminal.buffer,R=E.lines.length.toString();for(let N=x;N<=y;N++){const D=E.lines.get(E.ydisp+N),T=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),z=this._rowElements[N];z&&(j.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=j,this._rowColumns.set(z,T)),z.setAttribute("aria-posinset",B),z.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const E=x.target,R=this._rowElements[y===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==R)return;let N,D;if(y===0?(N=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((y.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===E.node&&y.offset>E.offset)&&([y,E]=[E,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:z})=>{const G=B instanceof Text?B.parentNode:B;let U=parseInt(G==null?void 0:G.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(G);if(!H)return console.warn("columns is null. Race condition?"),null;let Y=z<H.length?H[z]:H.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++U,Y=0),{row:U,column:Y}},D=N(y),T=N(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>x;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x<this._terminal.rows;x++)this._refreshRowDimensions(this._rowElements[x])}}_refreshRowDimensions(x){x.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=f([p(1,C.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],S)},3614:(u,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,v){return v?"\x1B[200~"+_+"\x1B[201~":_}function p(_,v,w,C){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),v.value=""}function d(_,v,w){const C=w.getBoundingClientRect(),b=_.clientX-C.left-10,S=_.clientY-C.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${b}px`,v.style.top=`${S}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(_,v){_.clipboardData&&_.clipboardData.setData("text/plain",v.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,v,w,C){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),v,w,C)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(_,v,w,C,b){d(_,v,w),b&&C.rightClickSelect(_),v.value=C.selectionText,v.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,_){this._css.set(p,d,_)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,_){this._color.set(p,d,_)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),_=c(8460),v=c(844),w=c(2585),C=c(4725);let b=o.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(S,x,y,E,R){super(),this._element=S,this._mouseService=x,this._renderService=y,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=S.composedPath();for(let E=0;E<y.length;E++){const R=y[E];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&x.x===this._lastBufferCell.x&&x.y===this._lastBufferCell.y||(this._handleHover(x),this._lastBufferCell=x)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,x){var E,R;this._activeProviderReplies&&x||((E=this._activeProviderReplies)==null||E.forEach((N=>{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let y=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())x?(R=this._activeProviderReplies)!=null&&R.get(N)&&(y=this._checkLinkProviderResult(N,S,y)):D.provideLinks(S.y,(T=>{var B,z;if(this._isMouseOut)return;const j=T==null?void 0:T.map((G=>({link:G})));(B=this._activeProviderReplies)==null||B.set(N,j),y=this._checkLinkProviderResult(N,S,y),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,x){const y=new Set;for(let E=0;E<x.size;E++){const R=x.get(E);if(R)for(let N=0;N<R.length;N++){const D=R[N],T=D.link.range.start.y<S?0:D.link.range.start.x,j=D.link.range.end.y>S?this._bufferService.cols:D.link.range.end.x;for(let B=T;B<=j;B++){if(y.has(B)){R.splice(N--,1);break}y.add(B)}}}}_checkLinkProviderResult(S,x,y){var N;if(!this._activeProviderReplies)return y;const E=this._activeProviderReplies.get(S);let R=!1;for(let D=0;D<S;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&E){const D=E.find((T=>this._linkAtPosition(T.link,x)));D&&(y=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let D=0;D<this._activeProviderReplies.size;D++){const T=(N=this._activeProviderReplies.get(D))==null?void 0:N.find((j=>this._linkAtPosition(j.link,x)));if(T){y=!0,this._handleNewLink(T);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const x=this._positionFromMouseEvent(S,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,x){this._currentLink&&this._lastMouseEvent&&(!S||!x||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(S.link,x)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.pointerCursor},set:y=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,E;return(E=(y=this._currentLink)==null?void 0:y.state)==null?void 0:E.decorations.underline},set:y=>{var E,R,N;(E=this._currentLink)!=null&&E.state&&((N=(R=this._currentLink)==null?void 0:R.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const E=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(S,x){const y=S.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-E-1,y.end.x,y.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(S,x,y){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(S,x){const y=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,R=x.y*this._bufferService.cols+x.x;return y<=R&&R<=E}_positionFromMouseEvent(S,x,y){const E=y.getCoords(S,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,x,y,E,R){return{x1:S,y1:x,x2:y,y2:E,cols:this._bufferService.cols,fg:R}}};o.Linkifier=b=f([p(1,C.IMouseService),p(2,C.IRenderService),p(3,w.IBufferService),p(4,C.ILinkProviderService)],b)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),_=c(2585);let v=o.OscLinkProvider=class{constructor(C,b,S){this._bufferService=C,this._optionsService=b,this._oscLinkService=S}provideLinks(C,b){var j;const S=this._bufferService.buffer.lines.get(C-1);if(!S)return void b(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,E=new d.CellData,R=S.getTrimmedLength();let N=-1,D=-1,T=!1;for(let B=0;B<R;B++)if(D!==-1||S.hasContent(B)){if(S.loadCell(B,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=B,N=E.extended.urlId;continue}T=E.extended.urlId!==N}else D!==-1&&(T=!0);if(T||D!==-1&&B===R-1){const z=(j=this._oscLinkService.getLinkData(N))==null?void 0:j.uri;if(z){const G={start:{x:D+1,y:C},end:{x:B+(T||B!==R-1?0:1),y:C}};let U=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const H=new URL(z);["http:","https:"].includes(H.protocol)||(U=!0)}catch{U=!0}U||x.push({text:z,range:G,activate:(H,Y)=>y?y.activate(H,Y,G):w(0,Y),hover:(H,Y)=>{var q;return(q=y==null?void 0:y.hover)==null?void 0:q.call(y,H,Y,G)},leave:(H,Y)=>{var q;return(q=y==null?void 0:y.leave)==null?void 0:q.call(y,H,Y,G)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,N=E.extended.urlId):(D=-1,N=-1)}}b(x)}};function w(C,b){if(confirm(`Do you want to navigate to ${b}? - -WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=v=f([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],v)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),_=c(9042),v=c(3730),w=c(1680),C=c(3107),b=c(5744),S=c(2950),x=c(1296),y=c(428),E=c(4269),R=c(5114),N=c(8934),D=c(3230),T=c(9312),j=c(4725),B=c(6731),z=c(8055),G=c(8969),U=c(8460),H=c(844),Y=c(6114),q=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),$=c(5435),F=c(4567),Q=c(779);class re extends G.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ee)=>this.refresh(P,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,H.toDisposable)((()=>{var P,ee;this._customKeyEventHandler=void 0,(ee=(P=this.element)==null?void 0:P.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const P of Z){let ee,ne="";switch(P.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+P.index}switch(P.type){case 0:const ge=z.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(ge)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((he=>he.ansi[P.index]=z.channels.toColor(...P.color)));else{const he=ee;this._themeService.modifyColors((ye=>ye[he]=z.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(Z);if(!P)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ge=P.getWidth(ee),he=this._renderService.dimensions.css.cell.width*ge,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,be=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=be+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=he+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,f.copyHandler)(P,this._selectionService)})));const Z=P=>(0,f.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),Y.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,f.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,f.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(F.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,P=this.element;function ee(he){const ye=Z._mouseService.getMouseReportCoords(he,Z.screenElement);if(!ye)return!1;let be,ke;switch(he.overrideType||he.type){case"mousemove":ke=32,he.buttons===void 0?(be=3,he.button!==void 0&&(be=he.button<3?he.button:3)):be=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":ke=0,be=he.button<3?he.button:3;break;case"mousedown":ke=1,be=he.button<3?he.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(he)===!1||Z.viewport.getLinesScrolled(he)===0)return!1;ke=he.deltaY<0?0:1,be=4;break;default:return!1}return!(ke===void 0||be===void 0||be>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:be,action:ke,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ge={mouseup:he=>(ee(he),he.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(he)),wheel:he=>(ee(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ee(he)},mousemove:he=>{he.buttons||ee(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&he?ne.mousemove||(P.addEventListener("mousemove",ge.mousemove),ne.mousemove=ge.mousemove):(P.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&he?ne.wheel||(P.addEventListener("wheel",ge.wheel,{passive:!1}),ne.wheel=ge.wheel):(P.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&he?ne.mouseup||(ne.mouseup=ge.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&he?ne.mousedrag||(ne.mousedrag=ge.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(P,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ee(he),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(he)}))),this.register((0,p.addDisposableDomListener)(P,"wheel",(he=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(he);if(ye===0)return;const be=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let ke="";for(let Ee=0;Ee<Math.abs(ye);Ee++)ke+=be;return this.coreService.triggerDataEvent(ke,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(P,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(P,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(Z,P){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,P)}updateCursorStyle(Z){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,P,ee=0){var ne;ee===1?(super.scrollLines(Z,P,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,P,ee){this._selectionService.setSelection(Z,P,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,P){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,P)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!P&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,P){const ee=Z.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||Z.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||Z.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ee:ee&&(!P.keyCode||P.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)P=Z.charCode;else if(Z.which===null||Z.which===void 0)P=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;P=Z.which}return!(!P||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=Z.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(Z),!0}return!1}resize(Z,P){Z!==this.cols||P!==this.rows?super.resize(Z,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,P){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Z=this.viewport)==null||Z.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ee;this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Z;(Z=this._renderService)==null||Z.clearTextureAtlas()}_reportFocus(){var Z;(Z=this.element)!=null&&Z.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ee};${P}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ge=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ge};${ne}t`)}}cancel(Z,P){if(this.options.cancelEvents||P)return Z.preventDefault(),Z.stopPropagation(),!1}}o.Terminal=re},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,v=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),_=c(4725),v=c(8460),w=c(844),C=c(2585);let b=o.Viewport=class extends w.Disposable{constructor(S,x,y,E,R,N,D,T){super(),this._viewportElement=S,this._scrollArea=x,this._bufferService=y,this._optionsService=E,this._charSizeService=R,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const x=this._getPixelsScrolled(S);return x!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+x:this._smoothScrollState.target+=x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const x=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+x,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?x*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._currentRowHeight*this._bufferService.rows),x}getBufferElements(S,x){var T;let y,E="";const R=[],N=x??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let j=S;j<N;j++){const B=D.get(j);if(!B)continue;const z=(T=D.get(j+1))==null?void 0:T.isWrapped;if(E+=B.translateToString(!z),!z||j===D.length-1){const G=document.createElement("div");G.textContent=E,R.push(G),E.length>0&&(y=G),E=""}}return{bufferElements:R,cursorElement:y}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let x=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(S,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const x=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(S,x))}};o.Viewport=b=f([p(2,C.IBufferService),p(3,C.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],b)},3107:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),v=c(2585);let w=o.BufferDecorationRenderer=class extends _.Disposable{constructor(C,b,S,x,y){super(),this._screenElement=C,this._bufferService=b,this._coreBrowserService=S,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var x;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((x=C==null?void 0:C.options)==null?void 0:x.layer)==="top"),b.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=C.options.x??0;return S&&S>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(C,b),b}_refreshStyle(C){const b=C.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let S=this._decorationElements.get(C);S||(S=this._createElement(C),C.element=S,this._decorationElements.set(C,S),this._container.appendChild(S),C.onDispose((()=>{this._decorationElements.delete(C),S.remove()}))),S.style.top=b*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(S)}}_refreshXPosition(C,b=C.element){if(!b)return;const S=C.options.x??0;(C.options.anchor||"left")==="right"?b.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var b;(b=this._decorationElements.get(C))==null||b.remove(),this._decorationElements.delete(C),C.dispose()}};o.BufferDecorationRenderer=w=f([p(1,v.IBufferService),p(2,d.ICoreBrowserService),p(3,v.IDecorationService),p(4,d.IRenderService)],w)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),v=c(844),w=c(2585),C={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends v.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,R,N,D,T,j){var z;super(),this._viewportElement=y,this._screenElement=E,this._bufferService=R,this._decorationService=N,this._renderService=D,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,v.toDisposable)((()=>{var G;(G=this._canvas)==null||G.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=y,b.center=E,b.right=y,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=b.left,S.right=b.left+b.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);C.left=E,C.center=E,C.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(S[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-C[y.position||"full"]/2),b[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(C,b,S,x){var y,E=arguments.length,R=E<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,b,S,x);else for(var N=C.length-1;N>=0;N--)(y=C[N])&&(R=(E<3?y(R):E>3?y(b,S,R):y(b,S))||R);return E>3&&R&&Object.defineProperty(b,S,R),R},p=this&&this.__param||function(C,b){return function(S,x){b(S,x,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),_=c(2585),v=c(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,b,S,x,y,E){this._textarea=C,this._compositionView=b,this._bufferService=S,this._optionsService=x,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,S=b.replace(C,"");this._dataAlreadySent=S,b.length>C.length?this._coreService.triggerDataEvent(S,!0):b.length<C.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):b.length===C.length&&b!==C&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,x=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=x+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=x+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=w=f([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,d.IRenderService)],w)},9806:(u,o)=>{function c(f,p,d){const _=d.getBoundingClientRect(),v=f.getComputedStyle(d),w=parseInt(v.getPropertyValue("padding-left")),C=parseInt(v.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-C]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,_,v,w,C,b,S){if(!w)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(S?C/2:0))/C),x[1]=Math.ceil(x[1]/b),x[0]=Math.min(Math.max(x[0],1),_+(S?1:0)),x[1]=Math.min(Math.max(x[1],1),v),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(b,S,x,y){const E=b-d(b,x),R=S-d(S,x),N=Math.abs(E-R)-(function(D,T,j){let B=0;const z=D-d(D,j),G=T-d(T,j);for(let U=0;U<Math.abs(z-G);U++){const H=_(D,T)==="A"?-1:1,Y=j.buffer.lines.get(z+H*U);Y!=null&&Y.isWrapped&&B++}return B})(b,S,x);return C(N,w(_(b,S),y))}function d(b,S){let x=0,y=S.buffer.lines.get(b),E=y==null?void 0:y.isWrapped;for(;E&&b>=0&&b<S.rows;)x++,y=S.buffer.lines.get(--b),E=y==null?void 0:y.isWrapped;return x}function _(b,S){return b>S?"A":"B"}function v(b,S,x,y,E,R){let N=b,D=S,T="";for(;N!==x||D!==y;)N+=E?1:-1,E&&N>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,b,N),N=0,b=0,D++):!E&&N<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,b+1),N=R.cols-1,b=N,D--);return T+R.buffer.translateBufferLineToString(D,!1,b,N)}function w(b,S){const x=S?"O":"[";return f.C0.ESC+x+b}function C(b,S){b=Math.floor(b);let x="";for(let y=0;y<b;y++)x+=S;return x}o.moveToCellSequence=function(b,S,x,y){const E=x.buffer.x,R=x.buffer.y;if(!x.buffer.hasScrollback)return(function(T,j,B,z,G,U){return p(j,z,G,U).length===0?"":C(v(T,j,T,j-d(j,G),!1,G).length,w("D",U))})(E,R,0,S,x,y)+p(R,S,x,y)+(function(T,j,B,z,G,U){let H;H=p(j,z,G,U).length>0?z-d(z,G):j;const Y=z,q=(function(X,K,L,M,O,$){let F;return F=p(L,M,O,$).length>0?M-d(M,O):K,X<L&&F<=M||X>=L&&F<M?"C":"D"})(T,j,B,z,G,U);return C(v(T,H,B,Y,q==="C",G).length,w(q,U))})(E,R,b,S,x,y);let N;if(R===S)return N=E>b?"D":"C",C(Math.abs(E-b),w(N,y));N=R>S?"D":"C";const D=Math.abs(R-S);return C((function(T,j){return j.cols-T})(R>S?b:E,x)+(D-1)*x.cols+1+((R>S?E:b)-1),w(N,y))}},1296:function(u,o,c){var f=this&&this.__decorate||function(U,H,Y,q){var X,K=arguments.length,L=K<3?H:q===null?q=Object.getOwnPropertyDescriptor(H,Y):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(U,H,Y,q);else for(var M=U.length-1;M>=0;M--)(X=U[M])&&(L=(K<3?X(L):K>3?X(H,Y,L):X(H,Y))||L);return K>3&&L&&Object.defineProperty(H,Y,L),L},p=this&&this.__param||function(U,H){return function(Y,q){H(Y,q,U)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),_=c(2550),v=c(2223),w=c(6171),C=c(6052),b=c(4725),S=c(8055),x=c(8460),y=c(844),E=c(2585),R="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let z=1,G=o.DomRenderer=class extends y.Disposable{constructor(U,H,Y,q,X,K,L,M,O,$,F,Q,re){super(),this._terminal=U,this._document=H,this._element=Y,this._screenElement=q,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=$,this._bufferService=F,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${N} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${N} .xterm-dim { color: ${S.color.multiplyOpacity(U.foreground,.5).css};}`,H+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;H+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${q} { 50% { box-shadow: none; }}`,H+=`@keyframes ${X} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,H+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of U.ansi.entries())H+=`${this._terminalSelector} .${D}${K} { color: ${L.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${S.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;H+=`${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${T}${v.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,H){for(let Y=this._rowElements.length;Y<=H;Y++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,H){this._refreshRowElements(U,H),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,H,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,H,Y),this.renderRows(0,this._bufferService.rows-1),!U||!H)return;this._selectionRenderModel.update(this._terminal,U,H,Y);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(Y){const O=U[0]>H[0];M.appendChild(this._createSelectionElement(K,O?H[0]:U[0],O?U[0]:H[0],L-K+1))}else{const O=q===K?U[0]:0,$=K===X?H[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,$));const F=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,F)),K!==L){const Q=X===L?H[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(U,H,Y,q=1){const X=this._document.createElement("div"),K=H*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(Y-H);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=U*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,H){const Y=this._bufferService.buffer,q=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=U;O<=H;O++){const $=O+Y.ydisp,F=this._rowElements[O],Q=Y.lines.get($);if(!F||!Q)break;F.replaceChildren(...this._rowFactory.createRow(Q,$,$===q,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,H,Y,q,X,K){Y<0&&(U=0),q<0&&(H=0);const L=this._bufferService.rows-1;Y=Math.max(Math.min(Y,L),0),q=Math.max(Math.min(q,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,$=Math.min(M.x,X-1),F=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=Y;ae<=q;++ae){const Z=ae+M.ydisp,P=this._rowElements[ae],ee=M.lines.get(Z);if(!P||!ee)break;P.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,$,F,this.dimensions.css.cell.width,this._widthCache,K?ae===Y?U:0:-1,K?(ae===q?H:X)-1:-1))}}};o.DomRenderer=G=f([p(7,E.IInstantiationService),p(8,b.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,b.ICoreBrowserService),p(12,b.IThemeService)],G)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,D,T,j){var B,z=arguments.length,G=z<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(N,D,T,j);else for(var U=N.length-1;U>=0;U--)(B=N[U])&&(G=(z<3?B(G):z>3?B(D,T,G):B(D,T))||G);return z>3&&G&&Object.defineProperty(D,T,G),G},p=this&&this.__param||function(N,D){return function(T,j){D(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),v=c(511),w=c(2585),C=c(8055),b=c(4725),S=c(4269),x=c(6171),y=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,D,T,j,B,z,G){this._document=N,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=z,this._themeService=G,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,T){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=T}createRow(N,D,T,j,B,z,G,U,H,Y,q){const X=[],K=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O<z+1&&(O=z+1);let $=0,F="",Q=0,re=0,ae=0,Z=!1,P=0,ee=!1,ne=0;const ge=[],he=Y!==-1&&q!==-1;for(let ye=0;ye<O;ye++){N.loadCell(ye,this._workCell);let be=this._workCell.getWidth();if(be===0)continue;let ke=!1,Ee=ye,Ce=this._workCell;if(K.length>0&&ye===K[0][0]){ke=!0;const Ie=K.shift();Ce=new S.JoinedCellData(this._workCell,N.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),Ee=Ie[1]-1,be=Ce.getWidth()}const rt=this._isCellInSelection(ye,D),bt=T&&ye===z,Ge=he&&ye>=Y&&ye<=q;let ct=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{ct=!0}));let Pt=Ce.getChars()||_.WHITESPACE_CELL_CHAR;if(Pt===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Pt=" "),ne=be*U-H.get(Pt,Ce.isBold(),Ce.isItalic()),M){if($&&(rt&&ee||!rt&&!ee&&Ce.bg===Q)&&(rt&&ee&&L.selectionForeground||Ce.fg===re)&&Ce.extended.ext===ae&&Ge===Z&&ne===P&&!bt&&!ke&&!ct){Ce.isInvisible()?F+=_.WHITESPACE_CELL_CHAR:F+=Pt,$++;continue}$&&(M.textContent=F),M=this._document.createElement("span"),$=0,F=""}else M=this._document.createElement("span");if(Q=Ce.bg,re=Ce.fg,ae=Ce.extended.ext,Z=Ge,P=ne,ee=rt,ke&&z>=ye&&z<=Ee&&(z=ye),!this._coreService.isCursorHidden&&bt&&this._coreService.isCursorInitialized){if(ge.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&ge.push("xterm-cursor-blink"),ge.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":ge.push("xterm-cursor-outline");break;case"block":ge.push("xterm-cursor-block");break;case"bar":ge.push("xterm-cursor-bar");break;case"underline":ge.push("xterm-cursor-underline")}}if(Ce.isBold()&&ge.push("xterm-bold"),Ce.isItalic()&&ge.push("xterm-italic"),Ce.isDim()&&ge.push("xterm-dim"),F=Ce.isInvisible()?_.WHITESPACE_CELL_CHAR:Ce.getChars()||_.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(ge.push(`xterm-underline-${Ce.extended.underlineStyle}`),F===" "&&(F=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ie=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ie<8&&(Ie+=8),M.style.textDecorationColor=L.ansi[Ie].css}Ce.isOverline()&&(ge.push("xterm-overline"),F===" "&&(F=" ")),Ce.isStrikethrough()&&ge.push("xterm-strikethrough"),Ge&&(M.style.textDecoration="underline");let ht=Ce.getFgColor(),Fe=Ce.getFgColorMode(),fe=Ce.getBgColor(),ie=Ce.getBgColorMode();const de=!!Ce.isInverse();if(de){const Ie=ht;ht=fe,fe=Ie;const Nt=Fe;Fe=ie,ie=Nt}let Se,Ae,De,Ve=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ie=>{Ie.options.layer!=="top"&&Ve||(Ie.backgroundColorRGB&&(ie=50331648,fe=Ie.backgroundColorRGB.rgba>>8&16777215,Se=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(Fe=50331648,ht=Ie.foregroundColorRGB.rgba>>8&16777215,Ae=Ie.foregroundColorRGB),Ve=Ie.options.layer==="top")})),!Ve&&rt&&(Se=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,fe=Se.rgba>>8&16777215,ie=50331648,Ve=!0,L.selectionForeground&&(Fe=50331648,ht=L.selectionForeground.rgba>>8&16777215,Ae=L.selectionForeground)),Ve&&ge.push("xterm-decoration-top"),ie){case 16777216:case 33554432:De=L.ansi[fe],ge.push(`xterm-bg-${fe}`);break;case 50331648:De=C.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(M,`background-color:#${R((fe>>>0).toString(16),"0",6)}`);break;default:de?(De=L.foreground,ge.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):De=L.background}switch(Se||Ce.isDim()&&(Se=C.color.multiplyOpacity(De,.5)),Fe){case 16777216:case 33554432:Ce.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(M,De,L.ansi[ht],Ce,Se,void 0)||ge.push(`xterm-fg-${ht}`);break;case 50331648:const Ie=C.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(M,De,Ie,Ce,Se,Ae)||this._addStyle(M,`color:#${R(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,De,L.foreground,Ce,Se,Ae)||de&&ge.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ge.length&&(M.className=ge.join(" "),ge.length=0),bt||ke||ct?M.textContent=F:$++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ee}return M&&$&&(M.textContent=F),X}_applyMinimumContrast(N,D,T,j,B,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const G=this._getContrastCache(j);let U;if(B||z||(U=G.getColor(D.rgba,T.rgba)),U===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);U=C.color.ensureContrastRatio(B||D,z||T,H),G.setColor((B||D).rgba,(z||T).rgba,U??null)}return!!U&&(this._addStyle(N,`color:${U.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&D>=T[1]&&N<j[0]&&D<=j[1]:N<T[0]&&D>=T[1]&&N>=j[0]&&D<=j[1]:D>T[1]&&D<j[1]||T[1]===j[1]&&D===T[1]&&N>=T[0]&&N<j[0]||T[1]<j[1]&&D===j[1]&&N<j[0]||T[1]<j[1]&&D===T[1]&&N>=T[0])}};function R(N,D,T){for(;N.length<T;)N=D+N;return N}o.DomRendererRowFactory=E=f([p(1,b.ICharacterJoinerService),p(2,w.IOptionsService),p(3,b.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,b.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[p,d,_,v],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(v),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),p&&(_+="I");let v=this._holey.get(_);if(v===void 0){let w=0;f&&(w|=1),p&&(w|=2),v=this._measure(c,w),v>0&&this._holey.set(_,v)}return v}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,_,v){return d===1&&_>Math.ceil(1.5*v)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,_=0){return(p-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,_,v=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,C=d[1]-w,b=_[1]-w,S=Math.max(C,0),x=Math.min(b,p.rows-1);S>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=v,this.viewportStartRow=C,this.viewportEndRow=b,this.viewportCappedStartRow=S,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=_[0])}isCellSelected(p,d,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),_=c(8460),v=c(844);let w=o.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new b(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([p(2,d.IOptionsService)],w);class C extends v.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,E){y!==void 0&&y>0&&E!==void 0&&E>0&&(this._result.width=y,this._result.height=E)}}class b extends C{constructor(y,E,R){super(),this._document=y,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends C{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(S,x,y,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,x,y,E);else for(var T=S.length-1;T>=0;T--)(R=S[T])&&(D=(N<3?R(D):N>3?R(x,y,D):R(x,y))||D);return N>3&&D&&Object.defineProperty(x,y,D),D},p=this&&this.__param||function(S,x){return function(y,E){x(y,E,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),_=c(643),v=c(511),w=c(2585);class C extends d.AttributeData{constructor(x,y,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=C;let b=o.CharacterJoinerService=class dC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===x)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(x){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(x);if(!y||y.length===0)return[];const E=[],R=y.translateToString(!0);let N=0,D=0,T=0,j=y.getFg(0),B=y.getBg(0);for(let z=0;z<y.getTrimmedLength();z++)if(y.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==B){if(z-N>1){const G=this._getJoinedRanges(R,T,D,y,N);for(let U=0;U<G.length;U++)E.push(G[U])}N=z,T=D,j=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-N>1){const z=this._getJoinedRanges(R,T,D,y,N);for(let G=0;G<z.length;G++)E.push(z[G])}return E}_getJoinedRanges(x,y,E,R,N){const D=x.substring(y,E);let T=[];try{T=this._characterJoiners[0].handler(D)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const B=this._characterJoiners[j].handler(D);for(let z=0;z<B.length;z++)dC._mergeRanges(T,B[z])}catch(B){console.error(B)}return this._stringRangesToCellRanges(T,R,N),T}_stringRangesToCellRanges(x,y,E){let R=0,N=!1,D=0,T=x[R];if(T){for(let j=E;j<this._bufferService.cols;j++){const B=y.getWidth(j),z=y.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!N&&T[0]<=D&&(T[0]=j,N=!0),T[1]<=D){if(T[1]=j,T=x[++R],!T)break;T[0]<=D?(T[0]=j,N=!0):N=!1}D+=z}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(x,y){let E=!1;for(let R=0;R<x.length;R++){const N=x[R];if(E){if(y[1]<=N[0])return x[R-1][1]=y[1],x;if(y[1]<=N[1])return x[R-1][1]=Math.max(y[1],N[1]),x.splice(R,1),x;x.splice(R,1),R--}else{if(y[1]<=N[0])return x.splice(R,0,y),x;if(y[1]<=N[1])return N[0]=Math.min(y[0],N[0]),x;y[0]<N[1]&&(N[0]=Math.min(y[0],N[0]),E=!0)}}return E?x[x.length-1][1]=y[1]:x.push(y),x}};o.CharacterJoinerService=b=f([p(0,w.IBufferService)],b)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class _ extends f.Disposable{constructor(C,b,S){super(),this._textarea=C,this._window=b,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new v(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(C){this._window!==C&&(this._window=C,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=_;class v extends f.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const v=this.linkProviders.indexOf(_);v!==-1&&this.linkProviders.splice(v,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(w,C,b,S){var x,y=arguments.length,E=y<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,C,b,S);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(E=(y<3?x(E):y>3?x(C,b,E):x(C,b))||E);return y>3&&E&&Object.defineProperty(C,b,E),E},p=this&&this.__param||function(w,C){return function(b,S){C(b,S,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),_=c(9806);let v=o.MouseService=class{constructor(w,C){this._renderService=w,this._charSizeService=C}getCoords(w,C,b,S,x){return(0,_.getCoords)(window,w,C,b,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(w,C){const b=(0,_.getCoordsRelativeToElement)(window,w,C);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=v=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],v)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),_=c(4725),v=c(8460),w=c(844),C=c(7226),b=c(2585);let S=o.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,E,R,N,D,T,j){super(),this._rowCount=x,this._charSizeService=R,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,z)=>this._renderRows(B,z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,y),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(y),this._observerDisposable.value=(0,w.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,E){var R;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=E,(R=this._renderer.value)==null||R.handleSelectionChanged(x,y,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=S=f([p(2,b.IOptionsService),p(3,_.ICharSizeService),p(4,b.IDecorationService),p(5,b.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],S)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,z){var G,U=arguments.length,H=U<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(T,j,B,z);else for(var Y=T.length-1;Y>=0;Y--)(G=T[Y])&&(H=(U<3?G(H):U>3?G(j,B,H):G(j,B))||H);return U>3&&H&&Object.defineProperty(j,B,H),H},p=this&&this.__param||function(T,j){return function(B,z){j(B,z,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),_=c(9504),v=c(456),w=c(4725),C=c(8460),b=c(844),S=c(6114),x=c(4841),y=c(511),E=c(2585),R=" ",N=new RegExp(R,"g");let D=o.SelectionService=class extends b.Disposable{constructor(T,j,B,z,G,U,H,Y,q){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=z,this._coreService=G,this._mouseService=U,this._optionsService=H,this._renderService=Y,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const G=T[0]<j[0]?T[0]:j[0],U=T[0]<j[0]?j[0]:T[0];for(let H=T[1];H<=j[1];H++){const Y=B.translateBufferLineToString(H,!0,G,U);z.push(Y)}}else{const G=T[1]===j[1]?j[0]:void 0;z.push(B.translateBufferLineToString(T[1],!0,T[0],G));for(let U=T[1]+1;U<=j[1]-1;U++){const H=B.lines.get(U),Y=B.translateBufferLineToString(U,!0);H!=null&&H.isWrapped?z[z.length-1]+=Y:z.push(Y)}if(T[1]!==j[1]){const U=B.lines.get(j[1]),H=B.translateBufferLineToString(j[1],!0,0,j[0]);U&&U.isWrapped?z[z.length-1]+=H:z.push(H)}}return z.map((G=>G.replace(N," "))).join(S.isWindows?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(B&&z&&j)&&this._areCoordsInSelection(j,B,z)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!B||!z)&&this._areCoordsInSelection([T,j],B,z)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]<B[1]||j[1]===B[1]&&T[1]===j[1]&&T[0]>=j[0]&&T[0]<B[0]||j[1]<B[1]&&T[1]===B[1]&&T[0]<B[0]||j[1]<B[1]&&T[1]===j[1]&&T[0]>=j[0]}_selectWordAtCursor(T,j){var G,U;const B=(U=(G=this._linkifier.currentLink)==null?void 0:G.link)==null?void 0:U.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(T);return!!z&&(this._selectWordAt(z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return S.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(T),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const z=B.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const z=(0,_.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let z=0;j>=z;z++){const G=T.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:G>1&&j!==z&&(B+=G-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,z=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,U=G.lines.get(T[1]);if(!U)return;const H=G.translateBufferLineToString(T[1],!1);let Y=this._convertViewportColToCharacterIndex(U,T[0]),q=Y;const X=T[0]-Y;let K=0,L=0,M=0,O=0;if(H.charAt(Y)===" "){for(;Y>0&&H.charAt(Y-1)===" ";)Y--;for(;q<H.length&&H.charAt(q+1)===" ";)q++}else{let Q=T[0],re=T[0];U.getWidth(Q)===0&&(K++,Q--),U.getWidth(re)===2&&(L++,re++);const ae=U.getString(re).length;for(ae>1&&(O+=ae-1,q+=ae-1);Q>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(Q-1,this._workCell));){U.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,Y-=Z-1),Y--,Q--}for(;re<U.length&&q+1<H.length&&!this._isCharWordSeparator(U.loadCell(re+1,this._workCell));){U.loadCell(re+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,re++):Z>1&&(O+=Z-1,q+=Z-1),q++,re++}}q++;let $=Y+X-K+M,F=Math.min(this._bufferService.cols,q-Y+K+L-M-O);if(j||H.slice(Y,q).trim()!==""){if(B&&$===0&&U.getCodePoint(0)!==32){const Q=G.lines.get(T[1]-1);if(Q&&U.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const ae=this._bufferService.cols-re.start;$-=ae,F+=ae}}}if(z&&$+F===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const Q=G.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&(F+=re.length)}}return{start:$,length:F}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,w.IMouseService),p(6,E.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],D)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(D,T,j,B){var z,G=arguments.length,U=G<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,T,j,B);else for(var H=D.length-1;H>=0;H--)(z=D[H])&&(U=(G<3?z(U):G>3?z(T,j,U):z(T,j))||U);return G>3&&U&&Object.defineProperty(T,j,U),U},p=this&&this.__param||function(D,T){return function(j,B){T(j,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),v=c(8460),w=c(844),C=c(2585),b=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),x=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],z=T[j/6%6|0],G=T[j%6];D.push({css:_.channels.toCss(B,z,G),rgba:_.channels.toRgba(B,z,G)})}for(let j=0;j<24;j++){const B=8+10*j;D.push({css:_.channels.toCss(B,B,B),rgba:_.channels.toRgba(B,B,B)})}return D})());let R=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:S,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(S,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=N(D.foreground,b),T.background=N(D.background,S),T.cursor=N(D.cursor,x),T.cursorAccent=N(D.cursorAccent,y),T.selectionBackgroundTransparent=N(D.selectionBackground,E),T.selectionBackgroundOpaque=_.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=_.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?N(D.selectionForeground,_.NULL_COLOR):void 0,T.selectionForeground===_.NULL_COLOR&&(T.selectionForeground=void 0),_.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=_.color.opacity(T.selectionBackgroundTransparent,.3)),_.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=_.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(D.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(D.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(D.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(D.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(D.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(D.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(D.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(D.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<j;B++)T.ansi[B+16]=N(D.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function N(D,T){if(D!==void 0)try{return _.css.toColor(D)}catch{}return T}o.ThemeService=R=f([p(0,C.IOptionsService)],R)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const w=new Array(v);for(let C=0;C<Math.min(v,this.length);C++)w[C]=this._array[this._getCyclicIndex(C)];this._array=w,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let w=this._length;w<v;w++)this._array[w]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,w){this._array[this._getCyclicIndex(v)]=w}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,w,...C){if(w){for(let b=v;b<this._length-w;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+w)];this._length-=w,this.onDeleteEmitter.fire({index:v,amount:w})}for(let b=this._length-1;b>=v;b--)this._array[this._getCyclicIndex(b+C.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<C.length;b++)this._array[this._getCyclicIndex(v+b)]=C[b];if(C.length&&this.onInsertEmitter.fire({index:v,amount:C.length}),this._length+C.length>this._maxLength){const b=this._length+C.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=C.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,w,C){if(!(w<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let S=w-1;S>=0;S--)this.set(v+S+C,this.get(v+S));const b=v+w+C-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<w;b++)this.set(v+b+C,this.get(v+b))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}o.CircularList=d},1439:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=p<=1?f[_]:f[_]&&c(f[_],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var _,v,w,C,b;function S(y){const E=y.toString(16);return E.length<2?"0"+E:E}function x(y,E){return y<E?(E+.05)/(y+.05):(y+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(E,R,N,D){return D!==void 0?`#${S(E)}${S(R)}${S(N)}${S(D)}`:`#${S(E)}${S(R)}${S(N)}`},y.toRgba=function(E,R,N,D=255){return(E<<24|R<<16|N<<8|D)>>>0},y.toColor=function(E,R,N,D){return{css:y.toCss(E,R,N,D),rgba:y.toRgba(E,R,N,D)}}})(_||(o.channels=_={})),(function(y){function E(R,N){return d=Math.round(255*N),[c,f,p]=b.toChannels(R.rgba),{css:_.toCss(c,f,p,d),rgba:_.toRgba(c,f,p,d)}}y.blend=function(R,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=R.rgba>>24&255,z=R.rgba>>16&255,G=R.rgba>>8&255;return c=B+Math.round((D-B)*d),f=z+Math.round((T-z)*d),p=G+Math.round((j-G)*d),{css:_.toCss(c,f,p),rgba:_.toRgba(c,f,p)}},y.isOpaque=function(R){return(255&R.rgba)==255},y.ensureContrastRatio=function(R,N,D){const T=b.ensureContrastRatio(R.rgba,N.rgba,D);if(T)return _.toColor(T>>24&255,T>>16&255,T>>8&255)},y.opaque=function(R){const N=(255|R.rgba)>>>0;return[c,f,p]=b.toChannels(N),{css:_.toCss(c,f,p),rgba:N}},y.opacity=E,y.multiplyOpacity=function(R,N){return d=255&R.rgba,E(R,d*N/255)},y.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(v||(o.color=v={})),(function(y){let E,R;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),_.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),_.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(c,f,p,d);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,p,d),css:N}}})(w||(o.css=w={})),(function(y){function E(R,N,D){const T=R/255,j=N/255,B=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},y.relativeLuminance2=E})(C||(o.rgb=C={})),(function(y){function E(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let G=D>>24&255,U=D>>16&255,H=D>>8&255,Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));for(;Y<T&&(G>0||U>0||H>0);)G-=Math.max(0,Math.ceil(.1*G)),U-=Math.max(0,Math.ceil(.1*U)),H-=Math.max(0,Math.ceil(.1*H)),Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));return(G<<24|U<<16|H<<8|255)>>>0}function R(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let G=D>>24&255,U=D>>16&255,H=D>>8&255,Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));for(;Y<T&&(G<255||U<255||H<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),U=Math.min(255,U+Math.ceil(.1*(255-U))),H=Math.min(255,H+Math.ceil(.1*(255-H))),Y=x(C.relativeLuminance2(G,U,H),C.relativeLuminance2(j,B,z));return(G<<24|U<<16|H<<8|255)>>>0}y.blend=function(N,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,j=D>>16&255,B=D>>8&255,z=N>>24&255,G=N>>16&255,U=N>>8&255;return c=z+Math.round((T-z)*d),f=G+Math.round((j-G)*d),p=U+Math.round((B-U)*d),_.toRgba(c,f,p)},y.ensureContrastRatio=function(N,D,T){const j=C.relativeLuminance(N>>8),B=C.relativeLuminance(D>>8);if(x(j,B)<T){if(B<j){const U=E(N,D,T),H=x(j,C.relativeLuminance(U>>8));if(H<T){const Y=R(N,D,T);return H>x(j,C.relativeLuminance(Y>>8))?U:Y}return U}const z=R(N,D,T),G=x(j,C.relativeLuminance(z>>8));if(G<T){const U=E(N,D,T);return G>x(j,C.relativeLuminance(U>>8))?z:U}return z}},y.reduceLuminance=E,y.increaseLuminance=R,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(b||(o.rgba=b={})),o.toPaddedHex=S,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),_=c(7866),v=c(744),w=c(7302),C=c(6975),b=c(8460),S=c(1753),x=c(1480),y=c(7994),E=c(9282),R=c(5435),N=c(5981),D=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((z=>{var G;(G=this._onScrollApi)==null||G.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const G in z)this.optionsService.options[G]=z[G]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((G,U)=>this._inputHandler.parse(G,U)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,G){this._writeBuffer.write(z,G)}writeSync(z,G){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(z,G)}input(z,G=!0){this.coreService.triggerDataEvent(z,G)}resize(z,G){isNaN(z)||isNaN(G)||(z=Math.max(z,v.MINIMUM_COLS),G=Math.max(G,v.MINIMUM_ROWS),this._bufferService.resize(z,G))}scroll(z,G=!1){this._bufferService.scroll(z,G)}scrollLines(z,G,U){this._bufferService.scrollLines(z,G,U)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const G=z-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(z,G){return this._inputHandler.registerEscHandler(z,G)}registerDcsHandler(z,G){return this._inputHandler.registerDcsHandler(z,G)}registerCsiHandler(z,G){return this._inputHandler.registerCsiHandler(z,G)}registerOscHandler(z,G){return this._inputHandler.registerOscHandler(z,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?z=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const G of z)G.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const p=[];for(let d=0;d<this._listeners.length;d++)p.push(this._listeners[d]);for(let d=0;d<p.length;d++)p[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c((p=>f.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var $,F=arguments.length,Q=F<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)($=K[re])&&(Q=(F<3?$(Q):F>3?$(L,M,Q):$(L,M))||Q);return F>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),v=c(2015),w=c(844),C=c(482),b=c(8437),S=c(8460),x=c(643),y=c(511),E=c(3734),R=c(2585),N=c(1480),D=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function G(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var U;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(o.WindowsOptionsReportType=U={}));let H=0;class Y extends w.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,$,F,Q,re,ae,Z=new v.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=$,this._optionsService=F,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=ae,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ee.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((P,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ee,payload:ne})})),this._parser.setPrintHandler(((P,ee,ne)=>this.print(P,ee,ne))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new D.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new D.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new D.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new D.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new D.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new D.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new D.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new D.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new D.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new D.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((P,ee)=>this.requestStatusString(P,ee))))}_preserveStack(L,M,O,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=$}_logSlowResolvingAsync(L){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,$=this._activeBuffer.x,F=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;$=this._parseStack.cursorStartX,F=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(P=>String.fromCharCode(P))).join("")}"`),typeof L=="string"?L.split("").map((P=>P.charCodeAt(0))):L),this._parseBuffer.length<L.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(L.length,z))),re||this._dirtyRowTracker.clearRange(),L.length>z)for(let P=Q;P<L.length;P+=z){const ee=P+z<L.length?P+z:L.length,ne=typeof L=="string"?this._stringDecoder.decode(L.substring(P,ee),this._parseBuffer):this._utf8Decoder.decode(L.subarray(P,ee),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ne))return this._preserveStack($,F,ne,P),this._logSlowResolvingAsync(O),O}else if(!re){const P=typeof L=="string"?this._stringDecoder.decode(L,this._parseBuffer):this._utf8Decoder.decode(L,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack($,F,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===$&&this._activeBuffer.y===F||this._onCursorMove.fire();const ae=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(ae,this._bufferService.rows-1))}print(L,M,O){let $,F;const Q=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,ae=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ee=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-M>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let ge=this._parser.precedingJoinState;for(let he=M;he<O;++he){if($=L[he],$<127&&Q){const Ee=Q[String.fromCharCode($)];Ee&&($=Ee.charCodeAt(0))}const ye=this._unicodeService.charProperties($,ge);F=N.UnicodeService.extractWidth(ye);const be=N.UnicodeService.extractShouldJoin(ye),ke=be?N.UnicodeService.extractWidth(ge):0;if(ge=ye,re&&this._onA11yChar.fire((0,C.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+F-ke>ae){if(Z){const Ee=ne;let Ce=this._activeBuffer.x-ke;for(this._activeBuffer.x=ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ke>0&&ne instanceof b.BufferLine&&ne.copyCellsFrom(Ee,Ce,0,ke,!1);Ce<ae;)Ee.setCellFromCodepoint(Ce++,0,1,ee)}else if(this._activeBuffer.x=ae-1,F===2)continue}if(be&&this._activeBuffer.x){const Ee=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-Ee,$,F);for(let Ce=F-ke;--Ce>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(P&&(ne.insertCells(this._activeBuffer.x,F-ke,this._activeBuffer.getNullCell(ee)),ne.getWidth(ae-1)===2&&ne.setCellFromCodepoint(ae-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,$,F,ee),F>0)for(;--F;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=ge,this._activeBuffer.x<ae&&O-M>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!G(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,$=!1,F=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),F),$&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O<this._bufferService.rows;O++)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,M),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;M--;)this._activeBuffer.lines.splice(F-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;M--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.insertCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.deleteCells(this._activeBuffer.x,L.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(L){let M=L.params[0]||1;for(;M--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(0,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(L){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=L.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);$.deleteCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(L){this._restrictCursor();const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return M&&(M.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(L.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(L){const M=this._parser.precedingJoinState;if(!M)return!0;const O=L.params[0]||1,$=N.UnicodeService.extractWidth(M),F=this._activeBuffer.x-$,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(F),re=new Uint32Array(Q.length*O);let ae=0;for(let P=0;P<Q.length;){const ee=Q.codePointAt(P)||0;re[ae++]=ee,P+=ee>65535?2:1}let Z=ae;for(let P=1;P<O;++P)re.copyWithin(Z,0,ae),Z+=ae;return this.print(re,0,Z),!0}sendDeviceAttributesPrimary(L){return L.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(L){for(let M=0;M<L.length;M++)switch(L.params[M]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),L.params[M]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(L,M){const O=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:F}=this._coreMouseService,Q=this._coreService,{buffers:re,cols:ae}=this._bufferService,{active:Z,alt:P}=re,ee=this._optionsService.rawOptions,ne=be=>be?1:2,ge=L.params[0];return he=ge,ye=M?ge===2?4:ge===4?ne(Q.modes.insertMode):ge===12?3:ge===20?ne(ee.convertEol):0:ge===1?ne(O.applicationCursorKeys):ge===3?ee.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:ge===6?ne(O.origin):ge===7?ne(O.wraparound):ge===8?3:ge===9?ne($==="X10"):ge===12?ne(ee.cursorBlink):ge===25?ne(!Q.isCursorHidden):ge===45?ne(O.reverseWraparound):ge===66?ne(O.applicationKeypad):ge===67?4:ge===1e3?ne($==="VT200"):ge===1002?ne($==="DRAG"):ge===1003?ne($==="ANY"):ge===1004?ne(O.sendFocus):ge===1005?4:ge===1006?ne(F==="SGR"):ge===1015?4:ge===1016?ne(F==="SGR_PIXELS"):ge===1048?1:ge===47||ge===1047||ge===1049?ne(Z===P):ge===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${he};${ye}$y`),!0;var he,ye}_updateAttrColor(L,M,O,$,F){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,$,F])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const $=[0,0,-1,0,0,0];let F=0,Q=0;do{if($[Q+F]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let ae=0;do $[1]===5&&(F=1),$[Q+ae+1+F]=re[ae];while(++ae<re.length&&ae+Q+1+F<$.length);break}if($[1]===5&&Q+F>=2||$[1]===2&&Q+F>=5)break;$[1]&&(F=1)}while(++Q+M<L.length&&Q+F<$.length);for(let re=2;re<$.length;++re)$[re]===-1&&($[re]=0);switch($[0]){case 38:O.fg=this._updateAttrColor(O.fg,$[1],$[3],$[4],$[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,$[1],$[3],$[4],$[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,$[1],$[3],$[4],$[5])}return Q}_processUnderline(L,M){M.extended=M.extended.clone(),(!~L||L>5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=b.DEFAULT_ATTR_DATA.fg,L.bg=b.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const $=this._curAttrData;for(let F=0;F<M;F++)O=L.params[F],O>=30&&O<=37?($.fg&=-50331904,$.fg|=16777216|O-30):O>=40&&O<=47?($.bg&=-50331904,$.bg|=16777216|O-40):O>=90&&O<=97?($.fg&=-50331904,$.fg|=16777224|O-90):O>=100&&O<=107?($.bg&=-50331904,$.bg|=16777224|O-100):O===0?this._processSGR0($):O===1?$.fg|=134217728:O===3?$.bg|=67108864:O===4?($.fg|=268435456,this._processUnderline(L.hasSubParams(F)?L.getSubParams(F)[0]:1,$)):O===5?$.fg|=536870912:O===7?$.fg|=67108864:O===8?$.fg|=1073741824:O===9?$.fg|=2147483648:O===2?$.bg|=134217728:O===21?this._processUnderline(2,$):O===22?($.fg&=-134217729,$.bg&=-134217729):O===23?$.bg&=-67108865:O===24?($.fg&=-268435457,this._processUnderline(0,$)):O===25?$.fg&=-536870913:O===27?$.fg&=-67108865:O===28?$.fg&=-1073741825:O===29?$.fg&=2147483647:O===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):O===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?F+=this._extractColor(L,F,$):O===53?$.bg|=1073741824:O===55?$.bg&=-1073741825:O===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):O===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!G(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const $=O.shift(),F=O.shift();if(/^\d+$/.exec($)){const Q=parseInt($);if(X(Q))if(F==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)(F);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let $;const F=O.findIndex((Q=>Q.startsWith("id=")));return F!==-1&&($=O[F].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let $=0;$<O.length&&!(M>=this._specialColors.length);++$,++M)if(O[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const F=(0,j.parseColor)(O[$]);F&&this._onColor.fire([{type:1,index:this._specialColors[M],color:F}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let $=0;$<O.length;++$)if(/^\d+$/.exec(O[$])){const F=parseInt(O[$]);X(F)&&M.push({type:2,index:F})}return M.length&&this._onColor.fire(M),!0}restoreFgColor(L){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(L){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(L){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(L){return L.length!==2?(this.selectDefaultCharset(),!0):(L[0]==="/"||this._charsetService.setgCharset(B[L[0]],_.CHARSETS[L[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new y.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M<this._bufferService.rows;++M){const O=this._activeBuffer.ybase+this._activeBuffer.y+M,$=this._activeBuffer.lines.get(O);$&&($.fill(L),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(L,M){const O=this._bufferService.buffer,$=this._optionsService.rawOptions;return(F=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${F}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=Y;let q=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(H=K,K=L,L=H),K<this.start&&(this.start=K),L>this.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}q=f([p(0,R.IBufferService)],q)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,_){this._data[p]||(this._data[p]={}),this._data[p][d]=_}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,_,v){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,_,v)}get(f,p,d,_){var v;return(v=this._data.get(f,p))==null?void 0:v.get(d,_)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,p){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let p=0,d=this._array.length-1;for(;d>=p;){let _=p+d>>1;const v=this._getKey(this._array[_]);if(v>f)d=_-1;else{if(!(v<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}p=_+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let w=0,C=0,b=v.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),C=Math.max(w,C),S=v.timeRemaining(),1.5*C>S)return b-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-w))}ms`),void this._start();b=S}this.clear()}}class d extends p{_requestCallback(v){return setTimeout((()=>v(this._createDeadline(16))))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const w=Date.now()+v;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=d==null?void 0:d.get(p.cols-1),v=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);v&&_&&(v.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),_=c(8437),v=c(4634),w=c(511),C=c(643),b=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,E){this._hasScrollback=x,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&x<this._rows}_getCorrectBufferLength(x){if(!this._hasScrollback)return x;const y=x+this._optionsService.rawOptions.scrollback;return y>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols<x)for(let T=0;T<this.lines.length;T++)R+=+this.lines.get(T).resize(x,E);let D=0;if(this._rows<y)for(let T=this._rows;T<y;T++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(x,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(x,E)));else for(let T=this._rows;T>y;T--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N<this.lines.maxLength){const T=this.lines.length-N;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(x,E);this._cols=x,this._rows=y,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const E=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,v.reflowLargerCreateNewLayout)(this.lines,E);(0,v.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(x,y,R.countRemoved)}}_reflowLargerAdjustViewport(x,y,E){const R=this.getNullCell(_.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(x,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(x,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),R=[];let N=0;for(let D=this.lines.length-1;D>=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),j.unshift(T);const B=this.ybase+this.y;if(B>=D&&B<D+j.length)continue;const z=j[j.length-1].getTrimmedLength(),G=(0,v.reflowSmallerGetNewLineLengths)(j,this._cols,x),U=G.length-j.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const Y=[];for(let O=0;O<U;O++){const $=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);Y.push($)}Y.length>0&&(R.push({start:D+j.length+N,newLines:Y}),N+=Y.length),j.push(...Y);let q=G.length-1,X=G[q];X===0&&(q--,X=G[q]);let K=j.length-U-1,L=z;for(;K>=0;){const O=Math.min(L,X);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(q--,X=G[q]),L-=O,L===0){K--;const $=Math.max(K,0);L=(0,v.getWrappedLineTrimmedLength)(j,$,this._cols)}}for(let O=0;O<j.length;O++)G[O]<x&&j[O].setCell(G[O],E);let M=U-H;for(;M-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+N)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+y-1)}if(R.length>0){const D=[],T=[];for(let q=0;q<this.lines.length;q++)T.push(this.lines.get(q));const j=this.lines.length;let B=j-1,z=0,G=R[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+N);let U=0;for(let q=Math.min(this.lines.maxLength-1,j+N-1);q>=0;q--)if(G&&G.start>B+U){for(let X=G.newLines.length-1;X>=0;X--)this.lines.set(q--,G.newLines[X]);q++,D.push({index:B+1,amount:G.newLines.length}),U+=G.newLines.length,G=R[++z]}else this.lines.set(q,T[B--]);let H=0;for(let q=D.length-1;q>=0;q--)D[q].index+=H,this.lines.onInsertEmitter.fire(D[q]),H+=D[q].amount;const Y=Math.max(0,j+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(x,y,E=0,R){const N=this.lines.get(x);return N?N.translateToString(y,E,R):""}getWrappedRangeForLine(x){let y=x,E=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(x){for(x!=null?this.tabs[x]||(x=this.prevStop(x)):(this.tabs={},x=0);x<this._cols;x+=this._optionsService.rawOptions.tabStopWidth)this.tabs[x]=!0}prevStop(x){for(x==null&&(x=this.x);!this.tabs[--x]&&x>0;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x<this._cols;);return x>=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===x&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].dispose(),this.markers.splice(x--,1);this._isClearing=!1}addMarker(x){const y=new b.Marker(x);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let v=0;class w{constructor(b,S,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const y=S||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,y);this.length=b}get(b){const S=this._data[3*b+0],x=2097151&S;return[this._data[3*b+1],2097152&S?this._combined[b]:x?(0,_.stringFromCodePoint)(x):"",S>>22,2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):x]}set(b,S){this._data[3*b+1]=S[d.CHAR_DATA_ATTR_INDEX],S[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=S[1],this._data[3*b+0]=2097152|b|S[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&S}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b]:2097151&S?(0,_.stringFromCodePoint)(2097151&S):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,S){return v=3*b,S.content=this._data[v+0],S.fg=this._data[v+1],S.bg=this._data[v+2],2097152&S.content&&(S.combinedData=this._combined[b]),268435456&S.bg&&(S.extended=this._extendedAttrs[b]),S}setCell(b,S){2097152&S.content&&(this._combined[b]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=S.content,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}setCellFromCodepoint(b,S,x,y){268435456&y.bg&&(this._extendedAttrs[b]=y.extended),this._data[3*b+0]=S|x<<22,this._data[3*b+1]=y.fg,this._data[3*b+2]=y.bg}addCodepointToCell(b,S,x){let y=this._data[3*b+0];2097152&y?this._combined[b]+=(0,_.stringFromCodePoint)(S):2097151&y?(this._combined[b]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(S),y&=-2097152,y|=2097152):y=S|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*b+0]=y}insertCells(b,S,x){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length-b){const y=new p.CellData;for(let E=this.length-b-S-1;E>=0;--E)this.setCell(b+S+E,this.loadCell(b+E,y));for(let E=0;E<S;++E)this.setCell(b+E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,x)}deleteCells(b,S,x){if(b%=this.length,S<this.length-b){const y=new p.CellData;for(let E=0;E<this.length-b-S;++E)this.setCell(b+E,this.loadCell(b+S+E,y));for(let E=this.length-S;E<this.length;++E)this.setCell(E,x)}else for(let y=b;y<this.length;++y)this.setCell(y,x);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,x)}replaceCells(b,S,x,y=!1){if(y)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.isProtected(b)||this.setCell(b,x),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,x),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,x);b<S&&b<this.length;)this.setCell(b++,x)}resize(b,S){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const x=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y<b;++y)this.setCell(y,S)}else{this._data=this._data.subarray(0,x);const y=Object.keys(this._combined);for(let R=0;R<y.length;R++){const N=parseInt(y[R],10);N>=b&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let R=0;R<E.length;R++){const N=parseInt(E[R],10);N>=b&&delete this._extendedAttrs[N]}}return this.length=b,4*x*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,S=!1){if(S)for(let x=0;x<this.length;++x)this.isProtected(x)||this.setCell(x,b);else{this._combined={},this._extendedAttrs={};for(let x=0;x<this.length;++x)this.setCell(x,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const S in b._combined)this._combined[S]=b._combined[S];this._extendedAttrs={};for(const S in b._extendedAttrs)this._extendedAttrs[S]=b._extendedAttrs[S];this.isWrapped=b.isWrapped}clone(){const b=new w(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const S in this._combined)b._combined[S]=this._combined[S];for(const S in this._extendedAttrs)b._extendedAttrs[S]=this._extendedAttrs[S];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,S,x,y,E){const R=b._data;if(E)for(let D=y-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}else for(let D=0;D<y;D++){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(S+D)+T];268435456&R[3*(S+D)+2]&&(this._extendedAttrs[x+D]=b._extendedAttrs[S+D])}const N=Object.keys(b._combined);for(let D=0;D<N.length;D++){const T=parseInt(N[D],10);T>=S&&(this._combined[T-S+x]=b._combined[T])}}translateToString(b,S,x,y){S=S??0,x=x??this.length,b&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let E="";for(;S<x;){const R=this._data[3*S+0],N=2097151&R,D=2097152&R?this._combined[S]:N?(0,_.stringFromCodePoint)(N):d.WHITESPACE_CELL_CHAR;if(E+=D,y)for(let T=0;T<D.length;++T)y.push(S);S+=R>>22||1}return y&&y.push(S),E}}o.BufferLine=w},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const _=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,v=f[p+1].getWidth(0)===2;return _&&v?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,_,v){const w=[];for(let C=0;C<f.length-1;C++){let b=C,S=f.get(++b);if(!S.isWrapped)continue;const x=[f.get(C)];for(;b<f.length&&S.isWrapped;)x.push(S),S=f.get(++b);if(_>=C&&_<b){C+=x.length-1;continue}let y=0,E=c(x,y,p),R=1,N=0;for(;R<x.length;){const T=c(x,R,p),j=T-N,B=d-E,z=Math.min(j,B);x[y].copyCellsFrom(x[R],N,E,z,!1),E+=z,E===d&&(y++,E=0),N+=z,N===T&&(R++,N=0),E===0&&y!==0&&x[y-1].getWidth(d-1)===2&&(x[y].copyCellsFrom(x[y-1],d-1,E++,1,!1),x[y-1].setCell(d-1,v))}x[y].replaceCells(E,d,v);let D=0;for(let T=x.length-1;T>0&&(T>y||x[T].getTrimmedLength()===0);T--)D++;D>0&&(w.push(C+x.length-D),w.push(D)),C+=x.length-1}return w},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let _=0,v=p[_],w=0;for(let C=0;C<f.length;C++)if(v===C){const b=p[++_];f.onDeleteEmitter.fire({index:C-w,amount:b}),C+=b-1,w+=b,v=p[++_]}else d.push(C);return{layout:d,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,p){const d=[];for(let _=0;_<p.length;_++)d.push(f.get(p[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=p.length},o.reflowSmallerGetNewLineLengths=function(f,p,d){const _=[],v=f.map(((S,x)=>c(f,x,p))).reduce(((S,x)=>S+x));let w=0,C=0,b=0;for(;b<v;){if(v-b<d){_.push(v-b);break}w+=d;const S=c(f,C,p);w>S&&(w-=S,C++);const x=f[C].getWidth(w-1)===2;x&&w--;const y=x?d-1:d;_.push(y),b+=y}return _},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class _ extends p.Disposable{constructor(w,C){super(),this._optionsService=w,this._bufferService=C,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,C){this._normal.resize(w,C),this._alt.resize(w,C),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=_},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const C=new _;return C.setFromCharData(w),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const b=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const S=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(b-55296)+S-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,_,v,w){const C={type:0,cancel:!1,key:void 0},b=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:C.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(C.key=f.C0.ESC+C.key);break;case 9:if(d.shiftKey){C.key=f.C0.ESC+"[Z";break}C.key=f.C0.HT,C.cancel=!0;break;case 13:C.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,C.cancel=!0;break;case 27:C.key=f.C0.ESC,d.altKey&&(C.key=f.C0.ESC+f.C0.ESC),C.cancel=!0;break;case 37:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"D",C.key===f.C0.ESC+"[1;3D"&&(C.key=f.C0.ESC+(v?"b":"[1;5D"))):C.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"C",C.key===f.C0.ESC+"[1;3C"&&(C.key=f.C0.ESC+(v?"f":"[1;5C"))):C.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"A",v||C.key!==f.C0.ESC+"[1;3A"||(C.key=f.C0.ESC+"[1;5A")):C.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;b?(C.key=f.C0.ESC+"[1;"+(b+1)+"B",v||C.key!==f.C0.ESC+"[1;3B"||(C.key=f.C0.ESC+"[1;5B")):C.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(C.key=f.C0.ESC+"[2~");break;case 46:C.key=b?f.C0.ESC+"[3;"+(b+1)+"~":f.C0.ESC+"[3~";break;case 36:C.key=b?f.C0.ESC+"[1;"+(b+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:C.key=b?f.C0.ESC+"[1;"+(b+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?C.type=2:d.ctrlKey?C.key=f.C0.ESC+"[5;"+(b+1)+"~":C.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?C.type=3:d.ctrlKey?C.key=f.C0.ESC+"[6;"+(b+1)+"~":C.key=f.C0.ESC+"[6~";break;case 112:C.key=b?f.C0.ESC+"[1;"+(b+1)+"P":f.C0.ESC+"OP";break;case 113:C.key=b?f.C0.ESC+"[1;"+(b+1)+"Q":f.C0.ESC+"OQ";break;case 114:C.key=b?f.C0.ESC+"[1;"+(b+1)+"R":f.C0.ESC+"OR";break;case 115:C.key=b?f.C0.ESC+"[1;"+(b+1)+"S":f.C0.ESC+"OS";break;case 116:C.key=b?f.C0.ESC+"[15;"+(b+1)+"~":f.C0.ESC+"[15~";break;case 117:C.key=b?f.C0.ESC+"[17;"+(b+1)+"~":f.C0.ESC+"[17~";break;case 118:C.key=b?f.C0.ESC+"[18;"+(b+1)+"~":f.C0.ESC+"[18~";break;case 119:C.key=b?f.C0.ESC+"[19;"+(b+1)+"~":f.C0.ESC+"[19~";break;case 120:C.key=b?f.C0.ESC+"[20;"+(b+1)+"~":f.C0.ESC+"[20~";break;case 121:C.key=b?f.C0.ESC+"[21;"+(b+1)+"~":f.C0.ESC+"[21~";break;case 122:C.key=b?f.C0.ESC+"[23;"+(b+1)+"~":f.C0.ESC+"[23~";break;case 123:C.key=b?f.C0.ESC+"[24;"+(b+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!w||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?C.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(C.key=f.C0.US),d.key==="@"&&(C.key=f.C0.NUL)):d.keyCode===65&&(C.type=1);else{const S=p[d.keyCode],x=S==null?void 0:S[d.shiftKey?1:0];if(x)C.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const y=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(y);d.shiftKey&&(E=E.toUpperCase()),C.key=f.C0.ESC+E}else if(d.keyCode===32)C.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let y=d.code.slice(3,4);d.shiftKey||(y=y.toLowerCase()),C.key=f.C0.ESC+y,C.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?C.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?C.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?C.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?C.key=f.C0.DEL:d.keyCode===219?C.key=f.C0.ESC:d.keyCode===220?C.key=f.C0.FS:d.keyCode===221&&(C.key=f.C0.GS)}return C}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let _=f;_<p;++_){let v=c[_];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,_=0;if(this._interim){const v=c.charCodeAt(_++);56320<=v&&v<=57343?f[d++]=1024*(this._interim-55296)+v-56320+65536:(f[d++]=this._interim,f[d++]=v),this._interim=0}for(let v=_;v<p;++v){const w=c.charCodeAt(v);if(55296<=w&&w<=56319){if(++v>=p)return this._interim=w,d;const C=c.charCodeAt(v);56320<=C&&C<=57343?f[d++]=1024*(w-55296)+C-56320+65536:(f[d++]=w,f[d++]=C)}else w!==65279&&(f[d++]=w)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,_,v,w,C=0,b=0,S=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)R<<=6,R|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-D;for(;S<j;){if(S>=p)return 0;if(N=c[S++],(192&N)!=128){S--,E=!0;break}this.interim[D++]=N,R<<=6,R|=63&N}E||(T===2?R<128?S--:f[C++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(f[C++]=R):R<65536||R>1114111||(f[C++]=R)),this.interim.fill(0)}const x=p-4;let y=S;for(;y<p;){for(;!(!(y<x)||128&(d=c[y])||128&(_=c[y+1])||128&(v=c[y+2])||128&(w=c[y+3]));)f[C++]=d,f[C++]=_,f[C++]=v,f[C++]=w,y+=4;if(d=c[y++],d<128)f[C++]=d;else if((224&d)==192){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(b=(31&d)<<6|63&_,b<128){y--;continue}f[C++]=b}else if((240&d)==224){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(b=(15&d)<<12|(63&_)<<6|63&v,b<2048||b>=55296&&b<=57343||b===65279)continue;f[C++]=b}else if((248&d)==240){if(y>=p)return this.interim[0]=d,C;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,C;if(v=c[y++],(192&v)!=128){y--;continue}if(y>=p)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=v,C;if(w=c[y++],(192&w)!=128){y--;continue}if(b=(7&d)<<18|(63&_)<<12|(63&v)<<6|63&w,b<65536||b>1114111)continue;f[C++]=b}}return C}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let v=0;v<p.length;++v)_.fill(0,p[v][0],p[v][1]+1)}}wcwidth(v){return v<32?0:v<127?1:v<65536?_[v]:(function(w,C){let b,S=0,x=C.length-1;if(w<C[0][0]||w>C[x][1])return!1;for(;x>=S;)if(b=S+x>>1,w>C[b][1])S=b+1;else{if(!(w<C[b][0]))return!0;x=b-1}return!1})(v,d)?0:v>=131072&&v<=196605||v>=196608&&v<=262141?2:1}charProperties(v,w){let C=this.wcwidth(v),b=C===0&&w!==0;if(b){const S=f.UnicodeService.extractWidth(w);S===0?b=!1:S>C&&(C=S)}return f.UnicodeService.createPropertyValue(0,C,b)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(w)}_innerWrite(v=0,w=!0){const C=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],S=this._action(b,w);if(S){const y=E=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(C,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-C>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,_){const v=d.toString(16),w=v.length<2?"0"+v:v;switch(_){case 4:return v[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const v=c.exec(_);if(v){const w=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/w*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/w*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const v=_.length/3,w=[0,0,0];for(let C=0;C<3;++C){const b=parseInt(_.slice(v*C,v*C+v),16);w[C]=v===1?b<<4:v===2?b:v===3?b>>4:b>>8}return w}},o.toRgbString=function(d,_=16){const[v,w,C]=d;return`rgb:${p(v,_)}/${p(w,_)}/${p(C,_)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const b=this._handlers[w];return b.push(C),{dispose:()=>{const S=b.indexOf(C);S!==-1&&b.splice(S,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,C){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(w,C,b){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(w,C,b);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,C,b))}unhook(w,C=!0){if(this._active.length){let b=!1,S=this._active.length-1,x=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,b=C,x=this._stack.fallThrough,this._stack.paused=!1),!x&&b===!1){for(;S>=0&&(b=this._active[S].unhook(w),b!==!0);S--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,b;S--}for(;S>=0;S--)if(b=this._active[S].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const v=new p.Params;v.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=v,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():v,this._data="",this._hitLimit=!1}put(w,C,b){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,C,b),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((b=>(this._params=v,this._data="",this._hitLimit=!1,b)));return this._params=v,this._data="",this._hitLimit=!1,C}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),_=c(6351);class v{constructor(S){this.table=new Uint8Array(S)}setDefault(S,x){this.table.fill(S<<4|x)}add(S,x,y,E){this.table[x<<8|S]=y<<4|E}addMany(S,x,y,E){for(let R=0;R<S.length;R++)this.table[x<<8|S[R]]=y<<4|E}}o.TransitionTable=v;const w=160;o.VT500_TRANSITION_TABLE=(function(){const b=new v(4095),S=Array.apply(null,Array(256)).map(((D,T)=>T)),x=(D,T)=>S.slice(D,T),y=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const R=x(0,14);let N;for(N in b.setDefault(1,0),b.addMany(y,0,2,0),R)b.addMany([24,26,153,154],N,3,0),b.addMany(x(128,144),N,3,0),b.addMany(x(144,152),N,3,0),b.add(156,N,0,0),b.add(27,N,11,1),b.add(157,N,4,8),b.addMany([152,158,159],N,0,7),b.add(155,N,11,3),b.add(144,N,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(y,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(x(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(y,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(x(64,127),3,7,0),b.addMany(x(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(x(48,60),4,8,4),b.addMany(x(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(x(32,64),6,0,6),b.add(127,6,0,6),b.addMany(x(64,127),6,0,0),b.addMany(x(32,48),3,9,5),b.addMany(x(32,48),5,9,5),b.addMany(x(48,64),5,0,6),b.addMany(x(64,127),5,7,0),b.addMany(x(32,48),4,9,5),b.addMany(x(32,48),1,9,2),b.addMany(x(32,48),2,9,2),b.addMany(x(48,127),2,10,0),b.addMany(x(48,80),1,10,0),b.addMany(x(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(x(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(x(28,32),9,0,9),b.addMany(x(32,48),9,9,12),b.addMany(x(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(x(32,128),11,0,11),b.addMany(x(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(x(28,32),10,0,10),b.addMany(x(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(x(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(x(28,32),12,0,12),b.addMany(x(32,48),12,9,12),b.addMany(x(48,64),12,0,11),b.addMany(x(64,127),12,12,13),b.addMany(x(64,127),10,12,13),b.addMany(x(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(y,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(w,0,2,0),b.add(w,8,5,8),b.add(w,6,0,6),b.add(w,11,0,11),b.add(w,13,13,13),b})();class C extends f.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,x=[64,126]){let y=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=S.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<S.intermediates.length;++R){const N=S.intermediates.charCodeAt(R);if(32>N||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=E,y}identToString(S){const x=[];for(;S;)x.push(String.fromCharCode(255&S)),S>>=8;return x.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,x){const y=this._identifier(S,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,x){this._executeHandlers[S.charCodeAt(0)]=x}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,x){const y=this._identifier(S);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,x){return this._dcsParser.registerHandler(this._identifier(S),x)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,x){return this._oscParser.registerHandler(S,x)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,x,y,E,R){this._parseStack.state=S,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(S,x,y){let E,R=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(R=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=S[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,y),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T<x;++T){switch(R=S[T],N=this._transitions.table[this.currentState<<8|(R<160?R:w)],N>>4){case 2:for(let U=T+1;;++U){if(U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}if(++U>=x||(R=S[U])<32||R>126&&R<w){this._printHandler(S,T,U),T=U-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:T,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|R];let B=j?j.length-1:-1;for(;B>=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T<x&&(R=S[T])>47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const z=this._escHandlers[this._collect<<8|R];let G=z?z.length-1:-1;for(;G>=0&&(E=z[G](),E!==!0);G--)if(E instanceof Promise)return this._preserveStack(4,z,G,N,T),E;G<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let U=T+1;;++U)if(U>=x||(R=S[U])===24||R===26||R===27||R>127&&R<w){this._dcsParser.put(S,T,U),T=U-1;break}break;case 14:if(E=this._dcsParser.unhook(R!==24&&R!==26),E)return this._preserveStack(6,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let U=T+1;;U++)if(U>=x||(R=S[U])<32||R>127&&R<w){this._oscParser.put(S,T,U),T=U-1;break}break;case 6:if(E=this._oscParser.end(R!==24&&R!==26),E)return this._preserveStack(5,[],0,N,T),E;R===27&&(N|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&N}}}o.EscapeSequenceParser=C},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(v),{dispose:()=>{const C=w.indexOf(v);C!==-1&&w.splice(C,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,v,w){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(_,v,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,v,w))}start(){this.reset(),this._state=1}put(_,v,w){if(this._state!==3){if(this._state===1)for(;v<w;){const C=_[v++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&w-v>0&&this._put(_,v,w)}}end(_,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,C=this._active.length-1,b=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,w=v,b=this._stack.fallThrough,this._stack.paused=!1),!b&&w===!1){for(;C>=0&&(w=this._active[C].end(_),w!==!0);C--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,w;C--}for(;C>=0;C--)if(w=this._active[C].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,v,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,v,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data),v instanceof Promise))return v.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,v}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const w=d[v];if(Array.isArray(w))for(let C=0;C<w.length;++C)_.addSubParam(w[C]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-_>0?this._subParams.subarray(_,v):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const v=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-v>0&&(d[_]=this._subParams.slice(v,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,w=v[_-1];v[_-1]=~w?Math.min(10*w+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){f=p;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,_){return this._line.translateToString(p,d,_)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=_},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),v=c(5295),w=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let C=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(b,this))}resize(b,S){this.cols=b,this.rows=S,this.buffers.resize(b,S),this._onResize.fire({cols:b,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,S=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===b.fg&&y.getBg(0)===b.bg||(y=x.getBlankLine(b,S),this._cachedBlankLine=y),y.isWrapped=S;const E=x.ybase+x.scrollTop,R=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;R===x.lines.length-1?N?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(R+1,0,y.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=R-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(R,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(b,S,x){const y=this.buffer;if(b<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else b+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+b,y.ybase),0),E!==y.ydisp&&(S||this._onScroll.fire(y.ydisp))}};o.BufferService=C=f([p(0,w.IOptionsService)],C)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(y,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,E,R,N);else for(var B=y.length-1;B>=0;B--)(D=y[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(y,E){return function(R,N){E(R,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),_=c(8460),v=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function C(y,E){let R=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(R|=64,R|=y.action):(R|=3&y.button,4&y.button&&(R|=64),8&y.button&&(R|=128),y.action===32?R|=32:y.action!==0||E||(R|=3)),R}const b=String.fromCharCode,S={DEFAULT:y=>{const E=[C(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${C(y,!0)};${y.x};${y.y}${E}`}};let x=o.CoreMouseService=class extends v.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(w))this.addProtocol(R,w[R]);for(const R of Object.keys(S))this.addEncoding(R,S[R]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,R){if(R){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,y,E,R){var N,D=arguments.length,T=D<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(y,E,T):N(y,E))||T);return D>3&&T&&Object.defineProperty(y,E,T),T},p=this&&this.__param||function(x,y){return function(E,R){y(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),_=c(8460),v=c(844),w=c(2585),C=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends v.Disposable{constructor(x,y,E){super(),this._bufferService=x,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}reset(){this.modes=(0,d.clone)(C),this.decPrivateModes=(0,d.clone)(b)}triggerDataEvent(x,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=S=f([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],S)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),_=c(6106);let v=0,w=0;class C extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new b(x);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,E){let R=0,N=0;for(const D of this._decorations.getKeyIterator(y))R=D.options.x??0,N=R+(D.options.width??1),x>=R&&x<N&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(x,y,E,R){this._decorations.forEachByKey(y,(N=>{v=N.options.x??0,w=v+(N.options.width??1),x>=v&&x<w&&(!E||(N.options.layer??"bottom")===E)&&R(N)}))}}o.DecorationService=C;class b extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(x){super(),this.options=x,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=x.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(...v){this._entries=new Map;for(const[w,C]of v)this.set(w,C)}set(v,w){const C=this._entries.get(v);return this._entries.set(v,w),C}forEach(v){for(const[w,C]of this._entries.entries())v(w,C)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,v){this._services.set(_,v)}getService(_){return this._services.get(_)}createInstance(_,...v){const w=(0,p.getServiceDependencies)(_).sort(((S,x)=>S.index-x.index)),C=[];for(const S of w){const x=this._services.get(S.id);if(!x)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${S.id}.`);C.push(x)}const b=w.length>0?w[0].index:v.length;if(v.length!==b)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${b+1} conflicts with ${v.length} static arguments`);return new _(...v,...C)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(b,S,x,y){var E,R=arguments.length,N=R<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,S,x,y);else for(var D=b.length-1;D>=0;D--)(E=b[D])&&(N=(R<3?E(N):R>3?E(S,x,N):E(S,x))||N);return R>3&&N&&Object.defineProperty(S,x,N),N},p=this&&this.__param||function(b,S){return function(x,y){S(x,y,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),_=c(2585),v={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,C=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let S=0;S<b.length;S++)typeof b[S]=="function"&&(b[S]=b[S]())}_log(b,S,x){this._evalLazyOptionalParams(x),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...x)}trace(b,...S){var x;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.trace.bind(this._optionsService.options.logger))??console.log,b,S)}debug(b,...S){var x;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.debug.bind(this._optionsService.options.logger))??console.log,b,S)}info(b,...S){var x;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.info.bind(this._optionsService.options.logger))??console.info,b,S)}warn(b,...S){var x;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.warn.bind(this._optionsService.options.logger))??console.warn,b,S)}error(b,...S){var x;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((x=this._optionsService.options.logger)==null?void 0:x.error.bind(this._optionsService.options.logger))??console.error,b,S)}};o.LogService=C=f([p(0,_.IOptionsService)],C),o.setTraceLogger=function(b){w=b},o.traceCall=function(b,S,x){if(typeof x.value!="function")throw new Error("not supported");const y=x.value;x.value=function(...E){if(w.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);w.trace(`GlyphRenderer#${y.name}(${E.map((N=>JSON.stringify(N))).join(", ")})`);const R=y.apply(this,E);return w.trace(`GlyphRenderer#${y.name} return`,R),R}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends p.Disposable{constructor(C){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const S in C)if(S in b)try{const x=C[S];b[S]=this._sanitizeAndValidateOption(S,x)}catch(x){console.error(x)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,b){return this.onOptionChange((S=>{S===C&&b(this.rawOptions[C])}))}onMultipleOptionChange(C,b){return this.onOptionChange((S=>{C.indexOf(S)!==-1&&b()}))}_setupOptions(){const C=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},b=(S,x)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);x=this._sanitizeAndValidateOption(S,x),this.rawOptions[S]!==x&&(this.rawOptions[S]=x,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const x={get:C.bind(this,S),set:b.bind(this,S)};Object.defineProperty(this.options,S,x)}}_sanitizeAndValidateOption(C,b){switch(C){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[C]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${C}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=_.includes(b)?b:o.DEFAULT_OPTIONS[C];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${C} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${C} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=v},2660:function(u,o,c){var f=this&&this.__decorate||function(v,w,C,b){var S,x=arguments.length,y=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,C):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,w,C,b);else for(var E=v.length-1;E>=0;E--)(S=v[E])&&(y=(x<3?S(y):x>3?S(w,C,y):S(w,C))||y);return x>3&&y&&Object.defineProperty(w,C,y),y},p=this&&this.__param||function(v,w){return function(C,b){w(C,b,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let _=o.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const w=this._bufferService.buffer;if(v.id===void 0){const E=w.addMarker(w.ybase+w.y),R={data:v,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const C=v,b=this._getEntryIdKey(C),S=this._entriesWithId.get(b);if(S)return this.addLineToLink(S.id,w.ybase+w.y),S.id;const x=w.addMarker(w.ybase+w.y),y={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(v,w){const C=this._dataByLinkId.get(v);if(C&&C.lines.every((b=>b.line!==w))){const b=this._bufferService.buffer.addMarker(w);C.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(C,b)))}}getLinkData(v){var w;return(w=this._dataByLinkId.get(v))==null?void 0:w.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,w){const C=v.lines.indexOf(w);C!==-1&&(v.lines.splice(C,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};o.OscLinkService=_=f([p(0,d.IBufferService)],_)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(_,v,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,b,S){b[c]===b?b[f].push({id:C,index:S}):(b[f]=[{id:C,index:S}],b[c]=b)})(d,_,w)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(v){return(1&v)!=0}static extractWidth(v){return v>>1&3}static extractCharKind(v){return v>>3}static createPropertyValue(v,w,C=!1){return(16777215&v)<<3|(3&w)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const v=new p.UnicodeV6;this.register(v),this._active=v.version,this._activeProvider=v}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(v){if(!this._providers[v])throw new Error(`unknown Unicode version "${v}"`);this._active=v,this._activeProvider=this._providers[v],this._onChange.fire(v)}register(v){this._providers[v.version]=v}wcwidth(v){return this._activeProvider.wcwidth(v)}getStringCellWidth(v){let w=0,C=0;const b=v.length;for(let S=0;S<b;++S){let x=v.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=b)return w+this.wcwidth(x);const R=v.charCodeAt(S);56320<=R&&R<=57343?x=1024*(x-55296)+R-56320+65536:w+=this.wcwidth(R)}const y=this.charProperties(x,C);let E=d.extractWidth(y);d.extractShouldJoin(y)&&(E-=d.extractWidth(C)),w+=E,C=y}return w}charProperties(v,w){return this._activeProvider.charProperties(v,w)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),_=a(7975),v=a(7090),w=["cols","rows"];class C extends f.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],y=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:x.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(S){if(w.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const x in S)this._publicOptions[x]=S[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,x=!0){this._core.input(S,x)}resize(S,x){this._verifyIntegers(S,x),this._core.resize(S,x)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,x,y){this._verifyIntegers(S,x,y),this._core.select(S,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,x){this._verifyIntegers(S,x),this._core.selectLines(S,x)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,x){this._core.write(S,x)}writeln(S,x){this._core.write(S),this._core.write(`\r -`,x)}paste(S){this._core.paste(S)}refresh(S,x){this._verifyIntegers(S,x),this._core.refresh(S,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const x of S)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const x of S)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=C})(),l})()))})(dp)),dp.exports}var cB=lB();function kb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function uB({runId:e}){const t=V.useRef(null);return V.useEffect(()=>{const n=t.current;if(!n)return;const r=new cB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:'ui-monospace, "SF Mono", Menlo, Consolas, monospace',scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new oB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const _=await BN(e,o);if(u)return;if(_.dataBase64&&r.write(kb(_.dataBase64)),o=_.nextOffset,_.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=wT(e,_=>{if(u)return;const v=kb(_.dataBase64);!c&&_.offset===o?(r.write(v),o+=v.length):_.offset+v.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),m.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const ea="__uncommitted__";function hB({state:e}){return!e||e.loading?m.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?m.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?m.jsx(rB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):m.jsx(fC,{diff:e.payload.diff}):m.jsx("div",{className:"diff-empty",children:"No changes."})}function fB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?m.jsx(dB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):m.jsx(pB,{experiment:e,project:t})}function dB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=V.useState(null),[u,o]=V.useState(!1),c=V.useRef(null),f=n&&t.find(w=>w.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=w=>{const C=t.findIndex(b=>b.id===w);return C===-1?t.length:t.length-C},_=V.useRef(null);V.useEffect(()=>{if(_.current===null){_.current=new Set(t.map(C=>C.id));return}const w=t.find(C=>!_.current.has(C.id));for(const C of t)_.current.add(C.id);w&&r(w.id)},[t,r]),V.useEffect(()=>{if(!u)return;const w=C=>{var b;(b=c.current)!=null&&b.contains(C.target)||o(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[u]);async function v(){if(f){l(null);try{await XS(f.id)}catch(w){l(w instanceof Error?w.message:String(w))}}}return m.jsxs("div",{className:"term-view",children:[m.jsxs("div",{className:"term-bar",children:[m.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),m.jsx("span",{style:{flex:1}}),a&&m.jsx("span",{className:"error",children:a}),p&&m.jsxs("button",{className:"btn sm ghost",onClick:()=>void v(),children:[m.jsx(MA,{size:13}),"Stop"]}),t.length>0&&f&&m.jsxs("div",{className:"run-history",ref:c,children:[m.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(w=>!w),children:[m.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),m.jsx(Vo,{status:f.status}),m.jsx(cs,{size:14,className:"run-picker-chev"})]}),u&&m.jsx("div",{className:"history-menu",children:t.map(w=>m.jsxs("button",{className:`history-item ${w.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(w.id),o(!1)},children:[m.jsxs("span",{className:"run-label",children:["Run ",d(w.id)]}),m.jsx(Vo,{status:w.status}),m.jsx("span",{className:"when",children:Sa(w.createdAt)})]},w.id))})]})]}),m.jsx("div",{className:"term-fill",children:f?m.jsx(uB,{runId:f.id},f.id):m.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function pB({experiment:e,project:t}){const[n,r]=V.useState(null),[a,l]=V.useState(null),[u,o]=V.useState(null),[c,f]=V.useState(null),[p,d]=V.useState({}),_=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function v(){l(null);try{const[C,b]=await Promise.all([IN(e.id),By(e.projectId)]);r(C),o(b),f(S=>{var y;return S!==null?S:b.diff.trim()!==""&&b.experimentId===e.id?ea:((y=C[0])==null?void 0:y.sha)??null})}catch(C){l(C instanceof Error?C.message:String(C))}}V.useEffect(()=>{n===null&&!a&&v()},[n,a,e.id]),V.useEffect(()=>{const C=setInterval(()=>{By(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(C)},[e.projectId]),V.useEffect(()=>{var C;c===ea&&u&&!_&&f(((C=n==null?void 0:n[0])==null?void 0:C.sha)??null)},[c,u,_,n]),V.useEffect(()=>{if(!c||c===ea||p[c])return;const C=c;d(b=>({...b,[C]:{loading:!0}})),zN(e.id,C).then(b=>d(S=>({...S,[C]:{loading:!1,payload:b}}))).catch(b=>d(S=>({...S,[C]:{loading:!1,error:b instanceof Error?b.message:String(b)}})))},[c,p,e.id]);const w=!_&&((n==null?void 0:n.length)??0)===0;return m.jsx("div",{className:"drawer",children:m.jsx("div",{className:"drawer-body",children:m.jsxs("div",{className:"drawer-section",children:[m.jsxs("div",{className:"changes-branch",children:[m.jsx("span",{className:"ctl-label",children:"Branch"}),m.jsx(UL,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?m.jsx("div",{className:"error",children:a}):n===null?m.jsx("div",{className:"changes-note",children:"Loading changes…"}):w?m.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"commit-picker",children:[m.jsx("span",{className:"ctl-label",children:"Commit"}),c===ea&&m.jsx("span",{className:"uncommitted-dot"}),m.jsxs("select",{className:"input sm",value:c??"",onChange:C=>f(C.target.value),children:[_&&m.jsx("option",{value:ea,children:"● Uncommitted changes"}),n.map(C=>m.jsxs("option",{value:C.sha,children:[C.sha.slice(0,7)," — ",C.subject]},C.sha))]}),m.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void v(),children:m.jsx(Sg,{size:14})})]}),m.jsx("div",{style:{marginTop:10},children:c===ea&&u?u.truncated?m.jsxs("div",{className:"truncated-notice",children:[m.jsx("h4",{children:"Diff too large to display"}),m.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):m.jsx(fC,{diff:u.diff}):c?m.jsx(hB,{state:p[c]}):m.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function gB(e,t){return vw(e,hw(t))}function mB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=V.useState(null),[o,c]=V.useState(null),[f,p]=V.useState(!0),[d,_]=V.useState(0),v=/\.(md|mdx|markdown)$/i.test(t),[w,C]=V.useState(!1);V.useEffect(()=>{let y=!1;return p(!0),HN(e,t,{sessionId:n,ref:r}).then(E=>{y||(u(E),c(null))}).catch(E=>{y||c(E.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const b=V.useMemo(()=>l&&!l.notFound?gB(l.content,t):null,[l,t]),S=l&&!l.notFound&&l.content?l.content.split(` -`).length-(l.content.endsWith(` -`)?1:0):0,x=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return m.jsxs("div",{className:"file-view",children:[m.jsxs("div",{className:"file-view-header",children:[m.jsx(VA,{size:13,style:{flexShrink:0}}),m.jsx("code",{className:"file-view-path",title:t,children:t}),r&&m.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),v&&m.jsx("button",{className:`icon-btn ${w?"active":""}`,title:w?"Rendered view":"Source view","aria-label":w?"Rendered view":"Source view",onClick:()=>C(y=>!y),children:m.jsx(BA,{size:13})}),m.jsx("button",{className:"icon-btn",title:"Reload file","aria-label":"Reload file",onClick:()=>_(y=>y+1),children:f?m.jsx("span",{className:"spinner"}):m.jsx(Sg,{size:13})})]}),m.jsx("div",{className:"file-view-body",children:o?m.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?m.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?m.jsx("div",{className:"file-view-note",children:x(l)}):m.jsxs(m.Fragment,{children:[!r&&n&&l.root==="clone"&&m.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),v&&!w?m.jsx("div",{className:"file-view-md",children:m.jsx(qo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):m.jsxs("div",{className:"file-view-codewrap",children:[S>0&&m.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:S},(y,E)=>E+1).join(` -`)}),m.jsx("pre",{className:"file-view-code",children:m.jsx("code",{children:b})})]}),l.truncated&&m.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function _B({projectName:e,onHome:t,onCollapse:n}){return m.jsxs("div",{className:"rail-brand",children:[m.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[m.jsx(jo,{size:15}),m.jsx("span",{className:"brand-project",children:e})]}),n&&m.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:m.jsx(qS,{size:15})})]})}function vB({onDone:e}){const[t,n]=V.useState(0),[r,a]=V.useState(null),[l,u]=V.useState(null),[o,c]=V.useState(null),[f,p]=V.useState(null),[d,_]=V.useState(!1),v=C=>{_(!0),Promise.allSettled([wg(C).then(a),ex().then(u),QS().then(c),hT().then(p)]).finally(()=>_(!1))};V.useEffect(()=>v(!1),[]);const w=()=>{dT((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return m.jsx("div",{className:"home onboarding",children:m.jsx("div",{className:"home-inner",children:t===0?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 1 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Your coding agents"}),m.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),m.jsx("div",{className:"onb-cards",children:r===null?m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(C=>m.jsx(bB,{h:C},C.id))}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===1?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 2 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),m.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),m.jsx("div",{className:"onb-cards",children:m.jsx(SB,{git:l,onUpdate:u})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[m.jsx(jo,{size:12})," Back"]}),m.jsxs("button",{className:"btn ghost",onClick:()=>v(!1),disabled:d,children:[m.jsx(Su,{size:12,className:d?"spin":""})," Re-check"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):t===2?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 3 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),m.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),m.jsx("div",{className:"onb-cards",children:m.jsx(xB,{dataDir:o,onUpdate:c})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",m.jsx(Ic,{size:13})]})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-eyebrow",children:["Open",m.jsx("span",{children:"Research"})," · step 4 of 4"]}),m.jsx("h2",{className:"onb-title",children:"Usage analytics"}),m.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),m.jsx("div",{className:"onb-cards",children:m.jsx(wB,{telemetry:f,onUpdate:p})}),m.jsxs("div",{className:"onb-actions",children:[m.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[m.jsx(jo,{size:12})," Back"]}),m.jsx("div",{style:{flex:1}}),m.jsxs("button",{className:"btn primary",onClick:w,children:["Create your first project ",m.jsx(Ic,{size:13})]})]})]})})})}function yB(e){return e.agentReady?{cls:"st-done",label:"connected"}:e.installed?{cls:"st-starting",label:"not signed in"}:{cls:"st-idle",label:"not detected"}}function bB({h:e}){var r,a;const t=yB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:e.name}),m.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),m.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>xu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):m.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function SB({git:e,onUpdate:t}){const[n,r]=V.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"status-badge st-failed",children:[m.jsx("span",{className:"dot"})," not found"]})]}),m.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"git"}),m.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),m.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"GitHub"}),m.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"signed in via gh CLI":"not connected"}),m.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&m.jsxs("div",{className:"onb-card-meta",children:["Set ",m.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&m.jsxs("div",{className:"onb-gh-options",children:[m.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),m.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?m.jsxs(m.Fragment,{children:[m.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),m.jsxs("button",{className:"btn ghost",onClick:a,children:[n?m.jsx(_n,{size:12,strokeWidth:3}):m.jsx(yg,{size:12}),n?"Copied":"Copy"]}),m.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):m.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",m.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),m.jsx("div",{className:"onb-gh-or",children:"or"}),m.jsxs("div",{className:"onb-gh-option",children:[m.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),m.jsx(Sw,{onSaved:t})]})]})]})}function xB({dataDir:e,onUpdate:t}){const[n,r]=V.useState(""),[a,l]=V.useState(!1),[u,o]=V.useState(!1),[c,f]=V.useState(null);if(V.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:"status-badge st-done",children:[m.jsx(_n,{size:12,strokeWidth:3})," pinned"]})]}),m.jsxs("div",{className:"onb-card-meta",children:["Set by the ",m.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function _(){if(!(u||!d)){o(!0),f(null);try{t(await KN(p)),l(!1)}catch(v){f(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-row",children:[m.jsx("span",{className:"onb-card-name",children:"Data folder"}),m.jsx("span",{className:"onb-card-detail mono",children:e.current}),m.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?m.jsx("span",{className:"dot"}):m.jsx(_n,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?m.jsxs(m.Fragment,{children:[m.jsx("input",{className:"mono",type:"text",value:n,onChange:v=>r(v.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&m.jsx("div",{className:"error",style:{marginTop:8},children:c}),m.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[m.jsx("button",{className:"btn primary",onClick:_,disabled:u||!d,children:u?"Saving…":"Use this folder"}),m.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):m.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",m.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function wB({telemetry:e,onUpdate:t}){const[n,r]=V.useState(!1);if(e===null)return m.jsxs("div",{className:"onb-loading",children:[m.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),fT(o).then(t).finally(()=>r(!1)))};return m.jsxs("div",{className:"onb-card",children:[m.jsxs("div",{className:"onb-card-head",children:[m.jsxs("div",{children:[m.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),m.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),m.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[m.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?m.jsx(_n,{size:12,strokeWidth:3}):null," On"]}),m.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:m.jsx(_n,{size:12,strokeWidth:3})," Off"]})]})]}),m.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",m.jsx("code",{children:"orx telemetry off"}),"."]}),l&&m.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function Kc(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function Ab(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function CB(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function EB(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function kB({onCreated:e,onCancel:t}){var F;const[n,r]=V.useState("paper"),[a,l]=V.useState("use"),[u,o]=V.useState(""),[c,f]=V.useState(""),[p,d]=V.useState(!1),[_,v]=V.useState("main"),[w,C]=V.useState(!1),[b,S]=V.useState(null),[x,y]=V.useState(""),[E,R]=V.useState([]),[N,D]=V.useState(!1),[T,j]=V.useState(null),[B,z]=V.useState(!1),[G,U]=V.useState(null),H=V.useRef(0),Y=Kc(u),q=!!(c.trim()&&(n==="new"||n==="existing"&&Y!==null||n==="paper"&&T!==null&&(u.trim()===""||Y!==null))),X=Q=>{var re;o(Q),p||f(((re=Kc(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++H.current;R([]),D(!1),z(!0),U(null);try{const ae=await RN(Q);if(re!==H.current)return;j(ae);const Z=ae.repoUrl?Kc(ae.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(ae.title??"").trim().slice(0,60))}catch(ae){if(re!==H.current)return;U(ae instanceof Error?ae.message:String(ae))}finally{re===H.current&&z(!1)}}function L(){H.current++,j(null),y(""),R([]),U(null),o(""),p||f("")}V.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=CB(Q);if(!re&&Q.length<3){R([]),D(!1);return}const ae=++H.current;re||D(!0);const Z=setTimeout(()=>{if(re){K(re);return}TN(Q).then(P=>{ae===H.current&&R(P)}).catch(P=>{ae===H.current&&(R([]),U(P instanceof Error?P.message:String(P)))}).finally(()=>{ae===H.current&&D(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!q||w)){C(!0),S(null);try{const re=await NN(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!Y?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:Y.owner,githubRepo:Y.repo,baselineBranch:_.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){S(re instanceof Error?re.message:String(re))}finally{C(!1)}}}const O=n==="new"||n==="paper"&&!Y,$=m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),m.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),m.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${Y?`${Y.owner}/${Y.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),m.jsxs("div",{className:"row2",children:[m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),m.jsxs("label",{children:["Branch",m.jsx("input",{value:_,onChange:Q=>v(Q.target.value),placeholder:"main"})]})]})]});return m.jsxs("form",{className:"form",onSubmit:M,children:[m.jsxs("div",{className:"seg form-seg",children:[m.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),m.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),m.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["GitHub repository",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),$]}),n==="paper"&&(T===null?m.jsxs(m.Fragment,{children:[m.jsxs("label",{children:["Paper",m.jsx("input",{value:x,onChange:Q=>y(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),m.jsx("span",{className:`repo-hint ${G?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":G??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&m.jsx("div",{className:"paper-results",children:E.map(Q=>m.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[m.jsx("span",{className:"title",children:EB(Q.title)}),m.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"paper-pick",children:[m.jsxs("div",{className:"meta",children:[m.jsx("div",{className:"title",children:T.title||T.paperId}),m.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),m.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),m.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",m.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),m.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`+(T.repoUrl&&((F=Kc(T.repoUrl))==null?void 0:F.repo)===Y.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),Y?$:m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&m.jsxs("label",{children:["Project name",m.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),m.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Ab(c)} · private`:"a blank private repo is created on your GitHub account"})]}),b&&m.jsx("div",{className:"error",children:b}),m.jsxs("div",{className:"actions",children:[t&&m.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),m.jsx("button",{type:"submit",className:"btn primary",disabled:!q||w,children:w?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Nb({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=V.useState(!1),[u,o]=V.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? - -Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await MN(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return m.jsxs("div",{className:"home",children:[m.jsxs("div",{className:"home-inner",children:[m.jsxs("div",{className:"home-brand",children:["Open",m.jsx("span",{children:"Research"})]}),m.jsxs("div",{className:"home-head",children:[m.jsx("h2",{children:"Projects"}),m.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[m.jsx(bg,{size:13})," New project"]})]}),m.jsx("div",{className:"home-list",children:e.length===0?m.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>m.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[m.jsx("span",{className:"name",children:f.name}),m.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&m.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),m.jsxs("span",{className:"time",children:["created ",Sa(f.createdAt)]}),m.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:m.jsx(Gu,{size:14})})]},f.id))})]}),a&&m.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:m.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[m.jsx("h2",{children:"New project"}),m.jsx(kB,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function AB(e){const t=tx(e.backend);return t?[t,nx(e.backend)].filter(Boolean).join(" · "):"—"}function NB({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?m.jsx("div",{className:"empty-state",children:m.jsx("p",{children:"No runs yet."})}):m.jsx("div",{className:"runs-table-wrap",children:m.jsxs("table",{className:"runs-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Run"}),m.jsx("th",{children:"Experiment"}),m.jsx("th",{children:"Status"}),m.jsx("th",{children:"Backend"}),m.jsx("th",{children:"Commit"}),m.jsx("th",{children:"Started"}),m.jsx("th",{children:"Exit"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return m.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[m.jsx("td",{className:"mono",children:Tp(o.id)}),m.jsx("td",{className:"mono",children:l.get(o.experimentId)??Tp(o.experimentId)}),m.jsx("td",{children:m.jsx(Vo,{status:o.status})}),m.jsx("td",{className:"mono",children:AB(o)}),m.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),m.jsx("td",{children:Sa(o.createdAt)}),m.jsx("td",{className:"mono",children:o.exitCode??"—"}),m.jsx("td",{children:m.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[m.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:m.jsx($u,{size:14})}),c&&m.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}function Ft(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ft(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var TB={value:()=>{}};function mh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new pu(n)}function pu(e){this._=e}function RB(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}pu.prototype=mh.prototype={constructor:pu,on:function(e,t){var n=this._,r=RB(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=DB(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Tb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Tb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pu(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function DB(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Tb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=TB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ig="http://www.w3.org/1999/xhtml";const Rb={svg:"http://www.w3.org/2000/svg",xhtml:ig,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _h(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rb.hasOwnProperty(t)?{space:Rb[t],local:e}:e}function MB(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ig&&t.documentElement.namespaceURI===ig?t.createElement(e):t.createElementNS(n,e)}}function jB(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pC(e){var t=_h(e);return(t.local?jB:MB)(t)}function LB(){}function Em(e){return e==null?LB:function(){return this.querySelector(e)}}function OB(e){typeof e!="function"&&(e=Em(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=new Array(u),c,f,p=0;p<u;++p)(c=l[p])&&(f=e.call(c,c.__data__,p,l))&&("__data__"in c&&(f.__data__=c.__data__),o[p]=f);return new jn(r,this._parents)}function BB(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function IB(){return[]}function gC(e){return e==null?IB:function(){return this.querySelectorAll(e)}}function zB(e){return function(){return BB(e.apply(this,arguments))}}function HB(e){typeof e=="function"?e=zB(e):e=gC(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&(r.push(e.call(c,c.__data__,f,u)),a.push(c));return new jn(r,a)}function mC(e){return function(){return this.matches(e)}}function _C(e){return function(t){return t.matches(e)}}var FB=Array.prototype.find;function PB(e){return function(){return FB.call(this.children,e)}}function UB(){return this.firstElementChild}function $B(e){return this.select(e==null?UB:PB(typeof e=="function"?e:_C(e)))}var GB=Array.prototype.filter;function qB(){return Array.from(this.children)}function VB(e){return function(){return GB.call(this.children,e)}}function YB(e){return this.selectAll(e==null?qB:VB(typeof e=="function"?e:_C(e)))}function WB(e){typeof e!="function"&&(e=mC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new jn(r,this._parents)}function vC(e){return new Array(e.length)}function XB(){return new jn(this._enter||this._groups.map(vC),this._parents)}function Tu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tu.prototype={constructor:Tu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function KB(e){return function(){return e}}function ZB(e,t,n,r,a,l){for(var u=0,o,c=t.length,f=l.length;u<f;++u)(o=t[u])?(o.__data__=l[u],r[u]=o):n[u]=new Tu(e,l[u]);for(;u<c;++u)(o=t[u])&&(a[u]=o)}function QB(e,t,n,r,a,l,u){var o,c,f=new Map,p=t.length,d=l.length,_=new Array(p),v;for(o=0;o<p;++o)(c=t[o])&&(_[o]=v=u.call(c,c.__data__,o,t)+"",f.has(v)?a[o]=c:f.set(v,c));for(o=0;o<d;++o)v=u.call(e,l[o],o,l)+"",(c=f.get(v))?(r[o]=c,c.__data__=l[o],f.delete(v)):n[o]=new Tu(e,l[o]);for(o=0;o<p;++o)(c=t[o])&&f.get(_[o])===c&&(a[o]=c)}function JB(e){return e.__data__}function eI(e,t){if(!arguments.length)return Array.from(this,JB);var n=t?QB:ZB,r=this._parents,a=this._groups;typeof e!="function"&&(e=KB(e));for(var l=a.length,u=new Array(l),o=new Array(l),c=new Array(l),f=0;f<l;++f){var p=r[f],d=a[f],_=d.length,v=tI(e.call(p,p&&p.__data__,f,r)),w=v.length,C=o[f]=new Array(w),b=u[f]=new Array(w),S=c[f]=new Array(_);n(p,d,C,b,S,v,t);for(var x=0,y=0,E,R;x<w;++x)if(E=C[x]){for(x>=y&&(y=x+1);!(R=b[y])&&++y<w;);E._next=R||null}}return u=new jn(u,r),u._enter=o,u._exit=c,u}function tI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nI(){return new jn(this._exit||this._groups.map(vC),this._parents)}function iI(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function rI(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),o=new Array(a),c=0;c<u;++c)for(var f=n[c],p=r[c],d=f.length,_=o[c]=new Array(d),v,w=0;w<d;++w)(v=f[w]||p[w])&&(_[w]=v);for(;c<a;++c)o[c]=n[c];return new jn(o,this._parents)}function sI(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function aI(e){e||(e=oI);function t(d,_){return d&&_?e(d.__data__,_.__data__):!d-!_}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],o=u.length,c=a[l]=new Array(o),f,p=0;p<o;++p)(f=u[p])&&(c[p]=f);c.sort(t)}return new jn(a,this._parents).order()}function oI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cI(){return Array.from(this)}function uI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function hI(){let e=0;for(const t of this)++e;return e}function fI(){return!this.node()}function dI(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,o;l<u;++l)(o=a[l])&&e.call(o,o.__data__,l,a);return this}function pI(e){return function(){this.removeAttribute(e)}}function gI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mI(e,t){return function(){this.setAttribute(e,t)}}function _I(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function vI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yI(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bI(e,t){var n=_h(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?gI:pI:typeof t=="function"?n.local?yI:vI:n.local?_I:mI)(n,t))}function yC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function SI(e){return function(){this.style.removeProperty(e)}}function xI(e,t,n){return function(){this.style.setProperty(e,t,n)}}function wI(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function CI(e,t,n){return arguments.length>1?this.each((t==null?SI:typeof t=="function"?wI:xI)(e,t,n??"")):pa(this.node(),e)}function pa(e,t){return e.style.getPropertyValue(t)||yC(e).getComputedStyle(e,null).getPropertyValue(t)}function EI(e){return function(){delete this[e]}}function kI(e,t){return function(){this[e]=t}}function AI(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NI(e,t){return arguments.length>1?this.each((t==null?EI:typeof t=="function"?AI:kI)(e,t)):this.node()[e]}function bC(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new SC(e)}function SC(e){this._node=e,this._names=bC(e.getAttribute("class")||"")}SC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function xC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function wC(e,t){for(var n=km(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function TI(e){return function(){xC(this,e)}}function RI(e){return function(){wC(this,e)}}function DI(e,t){return function(){(t.apply(this,arguments)?xC:wC)(this,e)}}function MI(e,t){var n=bC(e+"");if(arguments.length<2){for(var r=km(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?DI:t?TI:RI)(n,t))}function jI(){this.textContent=""}function LI(e){return function(){this.textContent=e}}function OI(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function BI(e){return arguments.length?this.each(e==null?jI:(typeof e=="function"?OI:LI)(e)):this.node().textContent}function II(){this.innerHTML=""}function zI(e){return function(){this.innerHTML=e}}function HI(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FI(e){return arguments.length?this.each(e==null?II:(typeof e=="function"?HI:zI)(e)):this.node().innerHTML}function PI(){this.nextSibling&&this.parentNode.appendChild(this)}function UI(){return this.each(PI)}function $I(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GI(){return this.each($I)}function qI(e){var t=typeof e=="function"?e:pC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VI(){return null}function YI(e,t){var n=typeof e=="function"?e:pC(e),r=t==null?VI:typeof t=="function"?t:Em(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function WI(){var e=this.parentNode;e&&e.removeChild(this)}function XI(){return this.each(WI)}function KI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QI(e){return this.select(e?ZI:KI)}function JI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function e7(e){return function(t){e.call(this,t,this.__data__)}}function t7(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function n7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function i7(e,t,n){return function(){var r=this.__on,a,l=e7(t);if(r){for(var u=0,o=r.length;u<o;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function r7(e,t,n){var r=t7(e+""),a,l=r.length,u;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,f=o.length,p;c<f;++c)for(a=0,p=o[c];a<l;++a)if((u=r[a]).type===p.type&&u.name===p.name)return p.value}return}for(o=t?i7:n7,a=0;a<l;++a)this.each(o(r[a],t,n));return this}function CC(e,t,n){var r=yC(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function s7(e,t){return function(){return CC(this,e,t)}}function a7(e,t){return function(){return CC(this,e,t.apply(this,arguments))}}function o7(e,t){return this.each((typeof t=="function"?a7:s7)(e,t))}function*l7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var EC=[null];function jn(e,t){this._groups=e,this._parents=t}function dl(){return new jn([[document.documentElement]],EC)}function c7(){return this}jn.prototype=dl.prototype={constructor:jn,select:OB,selectAll:HB,selectChild:$B,selectChildren:YB,filter:WB,data:eI,enter:XB,exit:nI,join:iI,merge:rI,selection:c7,order:sI,sort:aI,call:lI,nodes:cI,node:uI,size:hI,empty:fI,each:dI,attr:bI,style:CI,property:NI,classed:MI,text:BI,html:FI,raise:UI,lower:GI,append:qI,insert:YI,remove:XI,clone:QI,datum:JI,on:r7,dispatch:o7,[Symbol.iterator]:l7};function An(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],EC)}function u7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xn(e,t){if(e=u7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const h7={passive:!1},Zo={capture:!0,passive:!1};function pp(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function kC(e){var t=e.document.documentElement,n=An(e).on("dragstart.drag",ua,Zo);"onselectstart"in t?n.on("selectstart.drag",ua,Zo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function AC(e,t){var n=e.document.documentElement,r=An(e).on("dragstart.drag",null);t&&(r.on("click.drag",ua,Zo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zc=e=>()=>e;function rg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}rg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f7(e){return!e.ctrlKey&&!e.button}function d7(){return this.parentNode}function p7(e,t){return t??{x:e.x,y:e.y}}function g7(){return navigator.maxTouchPoints||"ontouchstart"in this}function NC(){var e=f7,t=d7,n=p7,r=g7,a={},l=mh("start","drag","end"),u=0,o,c,f,p,d=0;function _(E){E.on("mousedown.drag",v).filter(r).on("touchstart.drag",b).on("touchmove.drag",S,h7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(E,R){if(!(p||!e.call(this,E,R))){var N=y(this,t.call(this,E,R),E,R,"mouse");N&&(An(E.view).on("mousemove.drag",w,Zo).on("mouseup.drag",C,Zo),kC(E.view),pp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function w(E){if(ua(E),!f){var R=E.clientX-o,N=E.clientY-c;f=R*R+N*N>d}a.mouse("drag",E)}function C(E){An(E.view).on("mousemove.drag mouseup.drag",null),AC(E.view,f),ua(E),a.mouse("end",E)}function b(E,R){if(e.call(this,E,R)){var N=E.changedTouches,D=t.call(this,E,R),T=N.length,j,B;for(j=0;j<T;++j)(B=y(this,D,E,R,N[j].identifier,N[j]))&&(pp(E),B("start",E,N[j]))}}function S(E){var R=E.changedTouches,N=R.length,D,T;for(D=0;D<N;++D)(T=a[R[D].identifier])&&(ua(E),T("drag",E,R[D]))}function x(E){var R=E.changedTouches,N=R.length,D,T;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),D=0;D<N;++D)(T=a[R[D].identifier])&&(pp(E),T("end",E,R[D]))}function y(E,R,N,D,T,j){var B=l.copy(),z=Xn(j||N,R),G,U,H;if((H=n.call(E,new rg("beforestart",{sourceEvent:N,target:_,identifier:T,active:u,x:z[0],y:z[1],dx:0,dy:0,dispatch:B}),D))!=null)return G=H.x-z[0]||0,U=H.y-z[1]||0,function Y(q,X,K){var L=z,M;switch(q){case"start":a[T]=Y,M=u++;break;case"end":delete a[T],--u;case"drag":z=Xn(K||X,R),M=u;break}B.call(q,E,new rg(q,{sourceEvent:X,subject:H,target:_,identifier:T,active:M,x:z[0]+G,y:z[1]+U,dx:z[0]-L[0],dy:z[1]-L[1],dispatch:B}),D)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Zc(!!E),_):e},_.container=function(E){return arguments.length?(t=typeof E=="function"?E:Zc(E),_):t},_.subject=function(E){return arguments.length?(n=typeof E=="function"?E:Zc(E),_):n},_.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Zc(!!E),_):r},_.on=function(){var E=l.on.apply(l,arguments);return E===l?_:E},_.clickDistance=function(E){return arguments.length?(d=(E=+E)*E,_):Math.sqrt(d)},_}function Am(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function TC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pl(){}var Qo=.7,Ru=1/Qo,ha="\\s*([+-]?\\d+)\\s*",Jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",m7=/^#([0-9a-f]{3,8})$/,_7=new RegExp(`^rgb\\(${ha},${ha},${ha}\\)$`),v7=new RegExp(`^rgb\\(${ui},${ui},${ui}\\)$`),y7=new RegExp(`^rgba\\(${ha},${ha},${ha},${Jo}\\)$`),b7=new RegExp(`^rgba\\(${ui},${ui},${ui},${Jo}\\)$`),S7=new RegExp(`^hsl\\(${Jo},${ui},${ui}\\)$`),x7=new RegExp(`^hsla\\(${Jo},${ui},${ui},${Jo}\\)$`),Db={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Am(pl,rs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mb,formatHex:Mb,formatHex8:w7,formatHsl:C7,formatRgb:jb,toString:jb});function Mb(){return this.rgb().formatHex()}function w7(){return this.rgb().formatHex8()}function C7(){return RC(this).formatHsl()}function jb(){return this.rgb().formatRgb()}function rs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=m7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Lb(t):n===3?new mn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_7.exec(e))?new mn(t[1],t[2],t[3],1):(t=v7.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=y7.exec(e))?Qc(t[1],t[2],t[3],t[4]):(t=b7.exec(e))?Qc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=S7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,1):(t=x7.exec(e))?Ib(t[1],t[2]/100,t[3]/100,t[4]):Db.hasOwnProperty(e)?Lb(Db[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Lb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function Qc(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function E7(e){return e instanceof pl||(e=rs(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function sg(e,t,n,r){return arguments.length===1?E7(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Am(mn,sg,TC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(es(this.r),es(this.g),es(this.b),Du(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ob,formatHex:Ob,formatHex8:k7,formatRgb:Bb,toString:Bb}));function Ob(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function k7(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bb(){const e=Du(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Du(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function Ib(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function RC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof pl||(e=rs(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n<r)*6:n===l?u=(r-t)/o+2:u=(t-n)/o+4,o/=c<.5?l+a:2-l-a,u*=60):o=c>0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function A7(e,t,n,r){return arguments.length===1?RC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Am(Kn,A7,TC(pl,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(gp(e>=240?e-240:e+120,a,r),gp(e,a,r),gp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(zb(this.h),Jc(this.s),Jc(this.l),Du(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Du(this.opacity);return`${e===1?"hsl(":"hsla("}${zb(this.h)}, ${Jc(this.s)*100}%, ${Jc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zb(e){return e=(e||0)%360,e<0?e+360:e}function Jc(e){return Math.max(0,Math.min(1,e||0))}function gp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Nm=e=>()=>e;function N7(e,t){return function(n){return e+n*t}}function T7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function R7(e){return(e=+e)==1?DC:function(t,n){return n-t?T7(t,n,e):Nm(isNaN(t)?n:t)}}function DC(e,t){var n=t-e;return n?N7(e,n):Nm(isNaN(e)?t:e)}const Mu=(function e(t){var n=R7(t);function r(a,l){var u=n((a=sg(a)).r,(l=sg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=DC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function D7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function M7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function j7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=zo(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(o){for(u=0;u<r;++u)l[u]=a[u](o);return l}}function L7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ci(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function O7(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=zo(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var ag=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mp=new RegExp(ag.source,"g");function B7(e){return function(){return e}}function I7(e){return function(t){return e(t)+""}}function MC(e,t){var n=ag.lastIndex=mp.lastIndex=0,r,a,l,u=-1,o=[],c=[];for(e=e+"",t=t+"";(r=ag.exec(e))&&(a=mp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ci(r,a)})),n=mp.lastIndex;return n<t.length&&(l=t.slice(n),o[u]?o[u]+=l:o[++u]=l),o.length<2?c[0]?I7(c[0].x):B7(t):(t=c.length,function(f){for(var p=0,d;p<t;++p)o[(d=c[p]).i]=d.x(f);return o.join("")})}function zo(e,t){var n=typeof t,r;return t==null||n==="boolean"?Nm(t):(n==="number"?ci:n==="string"?(r=rs(t))?(t=r,Mu):MC:t instanceof rs?Mu:t instanceof Date?L7:M7(t)?D7:Array.isArray(t)?j7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?O7:ci)(e,t)}var Hb=180/Math.PI,og={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jC(e,t,n,r,a,l){var u,o,c;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),e*r<t*n&&(e=-e,t=-t,c=-c,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Hb,skewX:Math.atan(c)*Hb,scaleX:u,scaleY:o}}var eu;function z7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?og:jC(t.a,t.b,t.c,t.d,t.e,t.f)}function H7(e){return e==null||(eu||(eu=document.createElementNS("http://www.w3.org/2000/svg","g")),eu.setAttribute("transform",e),!(e=eu.transform.baseVal.consolidate()))?og:(e=e.matrix,jC(e.a,e.b,e.c,e.d,e.e,e.f))}function LC(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function l(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push("translate(",null,t,null,n);w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d||_)&&v.push("translate("+d+t+_+n)}function u(f,p,d,_){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),_.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ci(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,_){f!==p?_.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ci(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,_,v,w){if(f!==d||p!==_){var C=v.push(a(v)+"scale(",null,",",null,")");w.push({i:C-4,x:ci(f,d)},{i:C-2,x:ci(p,_)})}else(d!==1||_!==1)&&v.push(a(v)+"scale("+d+","+_+")")}return function(f,p){var d=[],_=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,_),u(f.rotate,p.rotate,d,_),o(f.skewX,p.skewX,d,_),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,_),f=p=null,function(v){for(var w=-1,C=_.length,b;++w<C;)d[(b=_[w]).i]=b.x(v);return d.join("")}}}var F7=LC(z7,"px, ","px)","deg)"),P7=LC(H7,", ",")",")"),U7=1e-12;function Fb(e){return((e=Math.exp(e))+1/e)/2}function $7(e){return((e=Math.exp(e))-1/e)/2}function G7(e){return((e=Math.exp(2*e))-1)/(e+1)}const gu=(function e(t,n,r){function a(l,u){var o=l[0],c=l[1],f=l[2],p=u[0],d=u[1],_=u[2],v=p-o,w=d-c,C=v*v+w*w,b,S;if(C<U7)S=Math.log(_/f)/t,b=function(D){return[o+D*v,c+D*w,f*Math.exp(t*D*S)]};else{var x=Math.sqrt(C),y=(_*_-f*f+r*C)/(2*f*n*x),E=(_*_-f*f-r*C)/(2*_*n*x),R=Math.log(Math.sqrt(y*y+1)-y),N=Math.log(Math.sqrt(E*E+1)-E);S=(N-R)/t,b=function(D){var T=D*S,j=Fb(R),B=f/(n*x)*(j*G7(t*T+R)-$7(R));return[o+B*v,c+B*w,f*j/Fb(t*T+R)]}}return b.duration=S*1e3*t/Math.SQRT2,b}return a.rho=function(l){var u=Math.max(.001,+l),o=u*u,c=o*o;return e(u,o,c)},a})(Math.SQRT2,2,4);var ga=0,Do=0,To=0,OC=1e3,ju,Mo,Lu=0,ss=0,vh=0,el=typeof performance=="object"&&performance.now?performance:Date,BC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return ss||(BC(q7),ss=el.now()+vh)}function q7(){ss=0}function Ou(){this._call=this._time=this._next=null}Ou.prototype=IC.prototype={constructor:Ou,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Tm():+n)+(t==null?0:+t),!this._next&&Mo!==this&&(Mo?Mo._next=this:ju=this,Mo=this),this._call=e,this._time=n,lg()},stop:function(){this._call&&(this._call=null,this._time=1/0,lg())}};function IC(e,t,n){var r=new Ou;return r.restart(e,t,n),r}function V7(){Tm(),++ga;for(var e=ju,t;e;)(t=ss-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ga}function Pb(){ss=(Lu=el.now())+vh,ga=Do=0;try{V7()}finally{ga=0,W7(),ss=0}}function Y7(){var e=el.now(),t=e-Lu;t>OC&&(vh-=t,Lu=e)}function W7(){for(var e,t=ju,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ju=n);Mo=e,lg(r)}function lg(e){if(!ga){Do&&(Do=clearTimeout(Do));var t=e-ss;t>24?(e<1/0&&(Do=setTimeout(Pb,e-el.now()-vh)),To&&(To=clearInterval(To))):(To||(Lu=el.now(),To=setInterval(Y7,OC)),ga=1,BC(Pb))}}function Ub(e,t,n){var r=new Ou;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var X7=mh("start","end","cancel","interrupt"),K7=[],zC=0,$b=1,cg=2,mu=3,Gb=4,ug=5,_u=6;function yh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;Z7(e,n,{name:t,index:r,group:a,on:X7,tween:K7,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:zC})}function Rm(e,t){var n=ti(e,t);if(n.state>zC)throw new Error("too late; already scheduled");return n}function pi(e,t){var n=ti(e,t);if(n.state>mu)throw new Error("too late; already running");return n}function ti(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Z7(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=IC(l,0,n.time);function l(f){n.state=$b,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,_,v;if(n.state!==$b)return c();for(p in r)if(v=r[p],v.name===n.name){if(v.state===mu)return Ub(u);v.state===Gb?(v.state=_u,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[p]):+p<t&&(v.state=_u,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[p])}if(Ub(function(){n.state===mu&&(n.state=Gb,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=cg,n.on.call("start",e,e.__data__,n.index,n.group),n.state===cg){for(n.state=mu,a=new Array(_=n.tween.length),p=0,d=-1;p<_;++p)(v=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(a[++d]=v);a.length=d+1}}function o(f){for(var p=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=ug,1),d=-1,_=a.length;++d<_;)a[d].call(e,p);n.state===ug&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=_u,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function vu(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>cg&&r.state<ug,r.state=_u,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function Q7(e){return this.each(function(){vu(this,e)})}function J7(e,t){var n,r;return function(){var a=pi(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,o=r.length;u<o;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function e9(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=pi(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var o={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=o;break}c===f&&a.push(o)}l.tween=a}}function t9(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ti(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?J7:e9)(n,e,t))}function Dm(e,t,n){var r=e._id;return e.each(function(){var a=pi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return ti(a,r).value[t]}}function HC(e,t){var n;return(typeof t=="number"?ci:t instanceof rs?Mu:(n=rs(t))?(t=n,Mu):MC)(e,t)}function n9(e){return function(){this.removeAttribute(e)}}function i9(e){return function(){this.removeAttributeNS(e.space,e.local)}}function r9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function s9(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function a9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttribute(e):(u=this.getAttribute(e),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function o9(e,t,n){var r,a,l;return function(){var u,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),c=o+"",u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o)))}}function l9(e,t){var n=_h(e),r=n==="transform"?P7:HC;return this.attrTween(e,typeof t=="function"?(n.local?o9:a9)(n,r,Dm(this,"attr."+e,t)):t==null?(n.local?i9:n9)(n):(n.local?s9:r9)(n,r,t))}function c9(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function u9(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function h9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&u9(e,l)),n}return a._value=t,a}function f9(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&c9(e,l)),n}return a._value=t,a}function d9(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=_h(e);return this.tween(n,(r.local?h9:f9)(r,t))}function p9(e,t){return function(){Rm(this,e).delay=+t.apply(this,arguments)}}function g9(e,t){return t=+t,function(){Rm(this,e).delay=t}}function m9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?p9:g9)(t,e)):ti(this.node(),t).delay}function _9(e,t){return function(){pi(this,e).duration=+t.apply(this,arguments)}}function v9(e,t){return t=+t,function(){pi(this,e).duration=t}}function y9(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_9:v9)(t,e)):ti(this.node(),t).duration}function b9(e,t){if(typeof t!="function")throw new Error;return function(){pi(this,e).ease=t}}function S9(e){var t=this._id;return arguments.length?this.each(b9(t,e)):ti(this.node(),t).ease}function x9(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;pi(this,e).ease=n}}function w9(e){if(typeof e!="function")throw new Error;return this.each(x9(this._id,e))}function C9(e){typeof e!="function"&&(e=mC(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,o=r[a]=[],c,f=0;f<u;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&o.push(c);return new $i(r,this._parents,this._name,this._id)}function E9(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),o=0;o<l;++o)for(var c=t[o],f=n[o],p=c.length,d=u[o]=new Array(p),_,v=0;v<p;++v)(_=c[v]||f[v])&&(d[v]=_);for(;o<r;++o)u[o]=t[o];return new $i(u,this._parents,this._name,this._id)}function k9(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function A9(e,t,n){var r,a,l=k9(t)?Rm:pi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function N9(e,t){var n=this._id;return arguments.length<2?ti(this.node(),n).on.on(e):this.each(A9(n,e,t))}function T9(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function R9(){return this.on("end.remove",T9(this._id))}function D9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Em(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var o=r[u],c=o.length,f=l[u]=new Array(c),p,d,_=0;_<c;++_)(p=o[_])&&(d=e.call(p,p.__data__,_,o))&&("__data__"in p&&(d.__data__=p.__data__),f[_]=d,yh(f[_],t,n,_,f,ti(p,n)));return new $i(l,this._parents,t,n)}function M9(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gC(e));for(var r=this._groups,a=r.length,l=[],u=[],o=0;o<a;++o)for(var c=r[o],f=c.length,p,d=0;d<f;++d)if(p=c[d]){for(var _=e.call(p,p.__data__,d,c),v,w=ti(p,n),C=0,b=_.length;C<b;++C)(v=_[C])&&yh(v,t,n,C,_,w);l.push(_),u.push(p)}return new $i(l,u,t,n)}var j9=dl.prototype.constructor;function L9(){return new j9(this._groups,this._parents)}function O9(e,t){var n,r,a;return function(){var l=pa(this,e),u=(this.style.removeProperty(e),pa(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function FC(e){return function(){this.style.removeProperty(e)}}function B9(e,t,n){var r,a=n+"",l;return function(){var u=pa(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function I9(e,t,n){var r,a,l;return function(){var u=pa(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),pa(this,e))),u===c?null:u===r&&c===a?l:(a=c,l=t(r=u,o))}}function z9(e,t){var n,r,a,l="style."+t,u="end."+l,o;return function(){var c=pi(this,e),f=c.on,p=c.value[l]==null?o||(o=FC(t)):void 0;(f!==n||a!==p)&&(r=(n=f).copy()).on(u,a=p),c.on=r}}function H9(e,t,n){var r=(e+="")=="transform"?F7:HC;return t==null?this.styleTween(e,O9(e,r)).on("end.style."+e,FC(e)):typeof t=="function"?this.styleTween(e,I9(e,r,Dm(this,"style."+e,t))).each(z9(this._id,e)):this.styleTween(e,B9(e,r,t),n).on("end.style."+e,null)}function F9(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function P9(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&F9(e,u,n)),r}return l._value=t,l}function U9(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,P9(e,t,n??""))}function $9(e){return function(){this.textContent=e}}function G9(e){return function(){var t=e(this);this.textContent=t??""}}function q9(e){return this.tween("text",typeof e=="function"?G9(Dm(this,"text",e)):$9(e==null?"":e+""))}function V9(e){return function(t){this.textContent=e.call(this,t)}}function Y9(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&V9(a)),t}return r._value=e,r}function W9(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Y9(e))}function X9(){for(var e=this._name,t=this._id,n=PC(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)if(c=u[f]){var p=ti(c,t);yh(c,e,n,f,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new $i(r,this._parents,e,n)}function K9(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var o={value:u},c={value:function(){--a===0&&l()}};n.each(function(){var f=pi(this,r),p=f.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),f.on=t}),a===0&&l()})}var Z9=0;function $i(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function PC(){return++Z9}var Hi=dl.prototype;$i.prototype={constructor:$i,select:D9,selectAll:M9,selectChild:Hi.selectChild,selectChildren:Hi.selectChildren,filter:C9,merge:E9,selection:L9,transition:X9,call:Hi.call,nodes:Hi.nodes,node:Hi.node,size:Hi.size,empty:Hi.empty,each:Hi.each,on:N9,attr:l9,attrTween:d9,style:H9,styleTween:U9,text:q9,textTween:W9,remove:R9,tween:t9,delay:m9,duration:y9,ease:S9,easeVarying:w9,end:K9,[Symbol.iterator]:Hi[Symbol.iterator]};function Q9(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var J9={time:null,delay:0,duration:250,ease:Q9};function ez(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function tz(e){var t,n;e instanceof $i?(t=e._id,e=e._name):(t=PC(),(n=J9).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],o=u.length,c,f=0;f<o;++f)(c=u[f])&&yh(c,e,t,f,u,n||ez(c,t));return new $i(r,this._parents,e,t)}dl.prototype.interrupt=Q7;dl.prototype.transition=tz;const tu=e=>()=>e;function nz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Fi(e,t,n){this.k=e,this.x=t,this.y=n}Fi.prototype={constructor:Fi,scale:function(e){return e===1?this:new Fi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Fi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var bh=new Fi(1,0,0);UC.prototype=Fi.prototype;function UC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return bh;return e.__zoom}function _p(e){e.stopImmediatePropagation()}function Ro(e){e.preventDefault(),e.stopImmediatePropagation()}function iz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qb(){return this.__zoom||bh}function sz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function az(){return navigator.maxTouchPoints||"ontouchstart"in this}function oz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $C(){var e=iz,t=rz,n=oz,r=sz,a=az,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=gu,f=mh("start","zoom","end"),p,d,_,v=500,w=150,C=0,b=10;function S(H){H.property("__zoom",qb).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(H,Y,q,X){var K=H.selection?H.selection():H;K.property("__zoom",qb),H!==K?R(H,Y,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},S.scaleBy=function(H,Y,q,X){S.scaleTo(H,function(){var K=this.__zoom.k,L=typeof Y=="function"?Y.apply(this,arguments):Y;return K*L},q,X)},S.scaleTo=function(H,Y,q,X){S.transform(H,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),$=typeof Y=="function"?Y.apply(this,arguments):Y;return n(y(x(L,$),M,O),K,u)},q,X)},S.translateBy=function(H,Y,q,X){S.transform(H,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},S.translateTo=function(H,Y,q,X,K){S.transform(H,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(bh.translate(O[0],O[1]).scale(M.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(H,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===H.k?H:new Fi(Y,H.x,H.y)}function y(H,Y,q){var X=Y[0]-q[0]*H.k,K=Y[1]-q[1]*H.k;return X===H.x&&K===H.y?H:new Fi(H.k,X,K)}function E(H){return[(+H[0][0]+ +H[1][0])/2,(+H[0][1]+ +H[1][1])/2]}function R(H,Y,q,X){H.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),$=q==null?E(O):typeof q=="function"?q.apply(K,L):q,F=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof Y=="function"?Y.apply(K,L):Y,ae=c(Q.invert($).concat(F/Q.k),re.invert($).concat(F/re.k));return function(Z){if(Z===1)Z=re;else{var P=ae(Z),ee=F/P[2];Z=new Fi(ee,$[0]-P[0]*ee,$[1]-P[1]*ee)}M.zoom(null,Z)}})}function N(H,Y,q){return!q&&H.__zooming||new D(H,Y)}function D(H,Y){this.that=H,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(H,Y),this.taps=0}D.prototype={event:function(H){return H&&(this.sourceEvent=H),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(H,Y){return this.mouse&&H!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&H!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&H!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(H){var Y=An(this.that).datum();f.call(H,this.that,new nz(H,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:f}),Y)}};function T(H,...Y){if(!e.apply(this,arguments))return;var q=N(this,Y).event(H),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(H);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],vu(this),q.start()}Ro(H),q.wheel=setTimeout(M,w),q.zoom("mouse",n(y(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(H,...Y){if(_||!e.apply(this,arguments))return;var q=H.currentTarget,X=N(this,Y,!0).event(H),K=An(H.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",F,!0),L=Xn(H,q),M=H.clientX,O=H.clientY;kC(H.view),_p(H),X.mouse=[L,this.__zoom.invert(L)],vu(this),X.start();function $(Q){if(Ro(Q),!X.moved){var re=Q.clientX-M,ae=Q.clientY-O;X.moved=re*re+ae*ae>C}X.event(Q).zoom("mouse",n(y(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function F(Q){K.on("mousemove.zoom mouseup.zoom",null),AC(Q.view,X.moved),Ro(Q),X.event(Q).end()}}function B(H,...Y){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(H.changedTouches?H.changedTouches[0]:H,this),K=q.invert(X),L=q.k*(H.shiftKey?.5:2),M=n(y(x(q,L),X,K),t.apply(this,Y),u);Ro(H),o>0?An(this).transition().duration(o).call(R,M,X,H):An(this).call(S.transform,M,X,H)}}function z(H,...Y){if(e.apply(this,arguments)){var q=H.touches,X=q.length,K=N(this,Y,H.changedTouches.length===X).event(H),L,M,O,$;for(_p(H),M=0;M<X;++M)O=q[M],$=Xn(O,this),$=[$,this.__zoom.invert($),O.identifier],K.touch0?!K.touch1&&K.touch0[2]!==$[2]&&(K.touch1=$,K.taps=0):(K.touch0=$,L=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),L&&(K.taps<2&&(d=$[0],p=setTimeout(function(){p=null},v)),vu(this),K.start())}}function G(H,...Y){if(this.__zooming){var q=N(this,Y).event(H),X=H.changedTouches,K=X.length,L,M,O,$;for(Ro(H),L=0;L<K;++L)M=X[L],O=Xn(M,this),q.touch0&&q.touch0[2]===M.identifier?q.touch0[0]=O:q.touch1&&q.touch1[2]===M.identifier&&(q.touch1[0]=O);if(M=q.that.__zoom,q.touch1){var F=q.touch0[0],Q=q.touch0[1],re=q.touch1[0],ae=q.touch1[1],Z=(Z=re[0]-F[0])*Z+(Z=re[1]-F[1])*Z,P=(P=ae[0]-Q[0])*P+(P=ae[1]-Q[1])*P;M=x(M,Math.sqrt(Z/P)),O=[(F[0]+re[0])/2,(F[1]+re[1])/2],$=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2]}else if(q.touch0)O=q.touch0[0],$=q.touch0[1];else return;q.zoom("touch",n(y(M,O,$),q.extent,u))}}function U(H,...Y){if(this.__zooming){var q=N(this,Y).event(H),X=H.changedTouches,K=X.length,L,M;for(_p(H),_&&clearTimeout(_),_=setTimeout(function(){_=null},v),L=0;L<K;++L)M=X[L],q.touch0&&q.touch0[2]===M.identifier?delete q.touch0:q.touch1&&q.touch1[2]===M.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(M=Xn(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<b)){var O=An(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return S.wheelDelta=function(H){return arguments.length?(r=typeof H=="function"?H:tu(+H),S):r},S.filter=function(H){return arguments.length?(e=typeof H=="function"?H:tu(!!H),S):e},S.touchable=function(H){return arguments.length?(a=typeof H=="function"?H:tu(!!H),S):a},S.extent=function(H){return arguments.length?(t=typeof H=="function"?H:tu([[+H[0][0],+H[0][1]],[+H[1][0],+H[1][1]]]),S):t},S.scaleExtent=function(H){return arguments.length?(l[0]=+H[0],l[1]=+H[1],S):[l[0],l[1]]},S.translateExtent=function(H){return arguments.length?(u[0][0]=+H[0][0],u[1][0]=+H[1][0],u[0][1]=+H[0][1],u[1][1]=+H[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(H){return arguments.length?(n=H,S):n},S.duration=function(H){return arguments.length?(o=+H,S):o},S.interpolate=function(H){return arguments.length?(c=H,S):c},S.on=function(){var H=f.on.apply(f,arguments);return H===f?S:H},S.clickDistance=function(H){return arguments.length?(C=(H=+H)*H,S):Math.sqrt(C)},S.tapDistance=function(H){return arguments.length?(b=+H,S):b},S}const ei={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},tl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GC=["Enter"," ","Escape"],qC={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ma;(function(e){e.Strict="strict",e.Loose="loose"})(ma||(ma={}));var ts;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ts||(ts={}));var nl;(function(e){e.Partial="partial",e.Full="full"})(nl||(nl={}));const VC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Er;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Er||(Er={}));var Bu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var Me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Me||(Me={}));const Vb={[Me.Left]:Me.Right,[Me.Right]:Me.Left,[Me.Top]:Me.Bottom,[Me.Bottom]:Me.Top};function YC(e){return e===null?null:e?"valid":"invalid"}const WC=e=>"id"in e&&"source"in e&&"target"in e,lz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),gl=(e,t=[0,0])=>{const{width:n,height:r}=Vi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},cz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Mm(a)?a:t.nodeLookup.get(a.id));const o=u?Iu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Sh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return xh(n)},ml=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Sh(n,Iu(a)),r=!0)}),r?xh(n):{x:0,y:0,width:0,height:0}},jm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const _ of e.values()){const{measured:v,selectable:w=!0,hidden:C=!1}=_;if(u&&!w||C)continue;const b=v.width??_.width??_.initialWidth??0,S=v.height??_.height??_.initialHeight??0,{x,y}=_.internals.positionAbsolute,E=QC(o,c,f,p,x,y,b,S),R=b*S,N=l&&E>0;(!_.internals.handleBounds||N||E>=R||_.dragging)&&d.push(_)}return d},uz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function hz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function fz({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=hz(e,u),c=ml(o),f=Om(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function XC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const v=o.measured.width,w=o.measured.height;v&&w&&(d=[[c,f],[c+v,f+w]])}else o&&os(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const _=os(d)?as(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:_.x-c+(u.measured.width??0)*p[0],y:_.y-f+(u.measured.height??0)*p[1]},positionAbsolute:_}}async function dz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(_=>_.id)),u=[];for(const _ of n){if(_.deletable===!1)continue;const v=l.has(_.id),w=!v&&_.parentId&&u.find(C=>C.id===_.parentId);(v||w)&&u.push(_)}const o=new Set(t.map(_=>_.id)),c=r.filter(_=>_.deletable!==!1),p=uz(u,c);for(const _ of c)o.has(_.id)&&!p.find(w=>w.id===_.id)&&p.push(_);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const _a=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),as=(e={x:0,y:0},t,n)=>({x:_a(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:_a(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function KC(e,t,n){const{width:r,height:a}=Vi(n),{x:l,y:u}=n.internals.positionAbsolute;return as(e,[[l,u],[l+r,u+a]],t)}const Yb=(e,t,n)=>e<t?_a(Math.abs(e-t),1,t)/t:e>n?-_a(Math.abs(e-n),1,t)/t:0,Lm=(e,t,n=15,r=40)=>{const a=Yb(e.x,r,t.width-r)*n,l=Yb(e.y,r,t.height-r)*n;return[a,l]},Sh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),hg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),xh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),il=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Iu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Mm(e)?e.internals.positionAbsolute:gl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},ZC=(e,t)=>xh(Sh(hg(e),hg(t))),QC=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},zu=(e,t)=>QC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Wb=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),JC=(e,t)=>(n,r)=>{},_l=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),vl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?_l(o,u):o},va=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ta(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function pz(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ta(e,n),a=ta(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ta(e.top??e.y??0,n),a=ta(e.bottom??e.y??0,n),l=ta(e.left??e.x??0,t),u=ta(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gz(e,t,n,r,a,l){const{x:u,y:o}=va(e,[t,n,r]),{x:c,y:f}=va({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Om=(e,t,n,r,a,l)=>{const u=pz(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=_a(f,r,a),d=e.x+e.width/2,_=e.y+e.height/2,v=t/2-d*p,w=n/2-_*p,C=gz(e,v,w,p,t,n),b={left:Math.min(C.left-u.left,0),top:Math.min(C.top-u.top,0),right:Math.min(C.right-u.right,0),bottom:Math.min(C.bottom-u.bottom,0)};return{x:v-b.left+b.right,y:w-b.top+b.bottom,zoom:p}},rl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function os(e){return e!=null&&e!=="parent"}function Vi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function e2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function t2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function Xb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function mz(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function _z(e){return{...qC,...e||{}}}function Ho(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=vl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?_l(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Bm=e=>({width:e.offsetWidth,height:e.offsetHeight}),n2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},vz=["INPUT","SELECT","TEXTAREA"];function i2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:vz.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const r2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=r2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},Kb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Bm(u)}})};function s2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function nu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Zb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case Me.Left:return[t-nu(t-r,l),n];case Me.Right:return[t+nu(r-t,l),n];case Me.Top:return[t,n-nu(n-a,l)];case Me.Bottom:return[t,n+nu(a-n,l)]}}function a2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,curvature:u=.25}){const[o,c]=Zb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=Zb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,_,v,w]=s2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,_,v,w]}function o2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,o=r<t?r+u:r-u;return[l,o,a,u]}function yz({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,o=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+o}function bz({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=Sh(Iu(e),Iu(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return zu(u,xh(l))>0}const Sz=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,xz=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),wz=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||Sz;let a;return WC(e)?a={...e}:a={...e,id:r(e)},xz(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function l2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=o2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const Qb={[Me.Left]:{x:-1,y:0},[Me.Right]:{x:1,y:0},[Me.Top]:{x:0,y:-1},[Me.Bottom]:{x:0,y:1}},Cz=({source:e,sourcePosition:t=Me.Bottom,target:n})=>t===Me.Left||t===Me.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Jb=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ez({source:e,sourcePosition:t=Me.Bottom,target:n,targetPosition:r=Me.Top,center:a,offset:l,stepPosition:u}){const o=Qb[t],c=Qb[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=Cz({source:f,sourcePosition:t,target:p}),_=d.x!==0?"x":"y",v=d[_];let w=[],C,b;const S={x:0,y:0},x={x:0,y:0},[,,y,E]=o2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[_]*c[_]===-1){_==="x"?(C=a.x??f.x+(p.x-f.x)*u,b=a.y??(f.y+p.y)/2):(C=a.x??(f.x+p.x)/2,b=a.y??f.y+(p.y-f.y)*u);const T=[{x:C,y:f.y},{x:C,y:p.y}],j=[{x:f.x,y:b},{x:p.x,y:b}];o[_]===v?w=_==="x"?T:j:w=_==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(_==="x"?w=o.x===v?j:T:w=o.y===v?T:j,t===r){const H=Math.abs(e[_]-n[_]);if(H<=l){const Y=Math.min(l-1,l-H);o[_]===v?S[_]=(f[_]>e[_]?-1:1)*Y:x[_]=(p[_]>n[_]?-1:1)*Y}}if(t!==r){const H=_==="x"?"y":"x",Y=o[_]===c[H],q=f[H]>p[H],X=f[H]<p[H];(o[_]===1&&(!Y&&q||Y&&X)||o[_]!==1&&(!Y&&X||Y&&q))&&(w=_==="x"?T:j)}const B={x:f.x+S.x,y:f.y+S.y},z={x:p.x+x.x,y:p.y+x.y},G=Math.max(Math.abs(B.x-w[0].x),Math.abs(z.x-w[0].x)),U=Math.max(Math.abs(B.y-w[0].y),Math.abs(z.y-w[0].y));G>=U?(C=(B.x+z.x)/2,b=w[0].y):(C=w[0].x,b=(B.y+z.y)/2)}const R={x:f.x+S.x,y:f.y+S.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...R.x!==w[0].x||R.y!==w[0].y?[R]:[],...w,...N.x!==w[w.length-1].x||N.y!==w[w.length-1].y?[N]:[],n],C,b,y,E]}function kz(e,t,n,r){const a=Math.min(Jb(e,t)/2,Jb(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${l+a*f},${u}Q ${l},${u} ${l},${u+a*p}`}const o=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${l},${u+a*c}Q ${l},${u} ${l+a*o},${u}`}function fg({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top,borderRadius:u=5,centerX:o,centerY:c,offset:f=20,stepPosition:p=.5}){const[d,_,v,w,C]=Ez({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:o,y:c},offset:f,stepPosition:p});let b=`M${d[0].x} ${d[0].y}`;for(let S=1;S<d.length-1;S++)b+=kz(d[S-1],d[S],d[S+1],u);return b+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[b,_,v,w,C]}function eS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Az(e){var d;const{sourceNode:t,targetNode:n}=e;if(!eS(t)||!eS(n))return null;const r=t.internals.handleBounds||tS(t.handles),a=n.internals.handleBounds||tS(n.handles),l=nS((r==null?void 0:r.source)??[],e.sourceHandle),u=nS(e.connectionMode===ma.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!l||!u)return(d=e.onError)==null||d.call(e,"008",ei.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const o=(l==null?void 0:l.position)||Me.Bottom,c=(u==null?void 0:u.position)||Me.Top,f=ls(t,l,o),p=ls(n,u,c);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:o,targetPosition:c}}function tS(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ls(e,t,n=Me.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:o}=t??Vi(e);if(r)return{x:a+u/2,y:l+o/2};switch((t==null?void 0:t.position)??n){case Me.Top:return{x:a+u/2,y:l};case Me.Right:return{x:a+u,y:l+o/2};case Me.Bottom:return{x:a+u/2,y:l+o};case Me.Left:return{x:a,y:l+o/2}}}function nS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Nz(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=dg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const c2=1e3,Tz=10,Im={nodeOrigin:[0,0],nodeExtent:tl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Rz={...Im,checkEquality:!0};function zm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Dz(e,t,n){const r=zm(Im,n);for(const a of e.values())if(a.parentId)Fm(a,e,t,r);else{const l=gl(a,r.nodeOrigin),u=os(a.extent)?a.extent:r.nodeExtent,o=as(l,u,Vi(a));a.internals.positionAbsolute=o}}function Mz(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Hm(e){return e==="manual"}function pg(e,t,n,r={}){var p,d;const a=zm(Rz,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Hm(a.zIndexMode)?c2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const _ of e){let v=u.get(_.id);if(a.checkEquality&&_===(v==null?void 0:v.internals.userNode))t.set(_.id,v);else{const w=gl(_,a.nodeOrigin),C=os(_.extent)?_.extent:a.nodeExtent,b=as(w,C,Vi(_));v={...a.defaults,..._,measured:{width:(p=_.measured)==null?void 0:p.width,height:(d=_.measured)==null?void 0:d.height},internals:{positionAbsolute:b,handleBounds:Mz(_,v),z:u2(_,o,a.zIndexMode),userNode:_}},t.set(_.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(c=!1),_.parentId&&Fm(v,t,n,r,l),f||(f=_.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function jz(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Fm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=zm(Im,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jz(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*Tz),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Hm(c)?c2:0,{x:_,y:v,z:w}=Lz(e,p,u,o,d,c),{positionAbsolute:C}=e.internals,b=_!==C.x||v!==C.y;(b||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:_,y:v}:C,z:w}})}function u2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Hm(n)?r:r+(e.selected?t:0)}function Lz(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Vi(e),f=gl(e,n),p=os(e.extent)?as(f,e.extent,c):f;let d=as({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=KC(d,c,t));const _=u2(e,a,l),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=_?v+1:_}}function Pm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??il(c),p=ZC(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var y;const p=c.internals.positionAbsolute,d=Vi(c),_=c.origin??r,v=o.x<p.x?Math.round(Math.abs(p.x-o.x)):0,w=o.y<p.y?Math.round(Math.abs(p.y-o.y)):0,C=Math.max(d.width,Math.round(o.width)),b=Math.max(d.height,Math.round(o.height)),S=(C-d.width)*_[0],x=(b-d.height)*_[1];(v>0||w>0||S||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-v+S,y:c.position.y-w+x}}),(y=n.get(f))==null||y.forEach(E=>{e.some(R=>R.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+v,y:E.position.y+w}})})),(d.width<o.width||d.height<o.height||v||w)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:C+(v?_[0]*v-S:0),height:b+(w?_[1]*w-x:0)}})}),a}function Oz(e,t,n,r,a,l,u){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!o)return{changes:[],updatedInternals:c};const f=[],p=window.getComputedStyle(o),{m22:d}=new window.DOMMatrixReadOnly(p.transform),_=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),c=!0;continue}const C=Bm(v.nodeElement),b=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(b||!w.internals.handleBounds||v.force))){const x=v.nodeElement.getBoundingClientRect(),y=os(w.extent)?w.extent:l;let{positionAbsolute:E}=w.internals;w.parentId&&w.extent==="parent"?E=KC(E,C,t.get(w.parentId)):y&&(E=as(E,y,C));const R={...w,measured:C,internals:{...w.internals,positionAbsolute:E,handleBounds:{source:Kb("source",v.nodeElement,x,d,w.id),target:Kb("target",v.nodeElement,x,d,w.id)}}};t.set(w.id,R),w.parentId&&Fm(R,t,n,{nodeOrigin:a,zIndexMode:u}),c=!0,b&&(f.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&_.push({id:w.id,parentId:w.parentId,rect:il(R,a)}))}}if(_.length>0){const v=Pm(_,t,n,a);f.push(...v)}return{changes:f,updatedInternals:c}}async function Bz({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function iS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function h2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;iS("source",c,p,e,a,u),iS("target",c,f,e,l,o),t.set(r.id,r)}}function f2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:f2(n,t):!1}function rS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Iz(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!f2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function vp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function zz({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=_l(l,t);return{x:u.x-l.x,y:u.y-l.y}}function Hz({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,_=null,v=!1,w=!1,C=null;function b({noDragClassName:x,handleSelector:y,domNode:E,isSelectable:R,nodeId:N,nodeClickDistance:D=0}){_=An(E);function T({x:G,y:U}){const{nodeLookup:H,nodeExtent:Y,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:$}=t();l={x:G,y:U};let F=!1;const Q=o.size>1,re=Q&&Y?hg(ml(o)):null,ae=Q&&X?zz({dragItems:o,snapGrid:q,x:G,y:U}):null;for(const[Z,P]of o){if(!H.has(Z))continue;let ee={x:G-P.distance.x,y:U-P.distance.y};X&&(ee=ae?{x:Math.round(ee.x+ae.x),y:Math.round(ee.y+ae.y)}:_l(ee,q));let ne=null;if(Q&&Y&&!P.extent&&re){const{positionAbsolute:ye}=P.internals,be=ye.x-re.x+Y[0][0],ke=ye.x+P.measured.width-re.x2+Y[1][0],Ee=ye.y-re.y+Y[0][1],Ce=ye.y+P.measured.height-re.y2+Y[1][1];ne=[[be,Ee],[ke,Ce]]}const{position:ge,positionAbsolute:he}=XC({nodeId:Z,nextPosition:ee,nodeLookup:H,nodeExtent:ne||Y,nodeOrigin:K,onError:O});F=F||P.position.x!==ge.x||P.position.y!==ge.y,P.position=ge,P.internals.positionAbsolute=he}if(w=w||F,!!F&&($(o,!0),C&&(r||L||!N&&M))){const[Z,P]=vp({nodeId:N,dragItems:o,nodeLookup:H});r==null||r(C,o,Z,P),L==null||L(C,Z,P),N||M==null||M(C,P)}}async function j(){if(!p)return;const{transform:G,panBy:U,autoPanSpeed:H,autoPanOnNodeDrag:Y}=t();if(!Y){c=!1,cancelAnimationFrame(u);return}const[q,X]=Lm(f,p,H);(q!==0||X!==0)&&(l.x=(l.x??0)-q/G[2],l.y=(l.y??0)-X/G[2],await U({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(G){var Q;const{nodeLookup:U,multiSelectionActive:H,nodesDraggable:Y,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!L||!R)&&!H&&N&&((Q=U.get(N))!=null&&Q.selected||$()),R&&L&&N&&(e==null||e(N));const F=Ho(G.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=F,o=Iz(U,Y,F,N),o.size>0&&(n||M||!N&&O)){const[re,ae]=vp({nodeId:N,dragItems:o,nodeLookup:U});n==null||n(G.sourceEvent,o,re,ae),M==null||M(G.sourceEvent,re,ae),N||O==null||O(G.sourceEvent,ae)}}const z=NC().clickDistance(D).on("start",G=>{const{domNode:U,nodeDragThreshold:H,transform:Y,snapGrid:q,snapToGrid:X}=t();p=(U==null?void 0:U.getBoundingClientRect())||null,v=!1,w=!1,C=G.sourceEvent,H===0&&B(G),l=Ho(G.sourceEvent,{transform:Y,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(G.sourceEvent,p)}).on("drag",G=>{const{autoPanOnNodeDrag:U,transform:H,snapGrid:Y,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Ho(G.sourceEvent,{transform:H,snapGrid:Y,snapToGrid:q,containerBounds:p});if(C=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||N&&!K.has(N))&&(v=!0),!v){if(!c&&U&&d&&(c=!0,j()),!d){const M=Qn(G.sourceEvent,p),O=M.x-f.x,$=M.y-f.y;Math.sqrt(O*O+$*$)>X&&B(G)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(G.sourceEvent,p),T(L))}}).on("end",G=>{if(!d||v){v&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:U,updateNodePositions:H,onNodeDragStop:Y,onSelectionDragStop:q}=t();if(w&&(H(o,!1),w=!1),a||Y||!N&&q){const[X,K]=vp({nodeId:N,dragItems:o,nodeLookup:U,dragging:!1});a==null||a(G.sourceEvent,o,X,K),Y==null||Y(G.sourceEvent,X,K),N||q==null||q(G.sourceEvent,K)}}}).filter(G=>{const U=G.target;return!G.button&&(!x||!rS(U,`.${x}`,E))&&(!y||rS(U,y,E))});_.call(z)}function S(){_==null||_.on(".drag",null)}return{update:b,destroy:S}}function Fz(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())zu(a,il(l))>0&&r.push(l);return r}const Pz=250;function Uz(e,t,n,r){var o,c;let a=[],l=1/0;const u=Fz(e,n,t+Pz);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:_,y:v}=ls(f,d,d.position,!0),w=Math.sqrt(Math.pow(_-e.x,2)+Math.pow(v-e.y,2));w>t||(w<l?(a=[{...d,x:_,y:v}],l=w):w===l&&a.push({...d,x:_,y:v}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function d2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(_=>_.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ls(u,c,c.position,!0)}:c}function p2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $z(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const g2=()=>!0;function Gz(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:_,cancelConnection:v,onConnectStart:w,onConnect:C,onConnectEnd:b,isValidConnection:S=g2,onReconnectEnd:x,updateConnection:y,getTransform:E,getFromHandle:R,autoPanSpeed:N,dragThreshold:D=1,handleDomNode:T}){const j=n2(e.target);let B=0,z;const{x:G,y:U}=Qn(e),H=p2(l,T),Y=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!Y||!H)return;const X=d2(a,H,r,c,t);if(!X)return;let K=Qn(e,Y),L=!1,M=null,O=!1,$=null;function F(){if(!p||!Y)return;const[ge,he]=Lm(K,Y,N);_({x:ge,y:he}),B=requestAnimationFrame(F)}const Q={...X,nodeId:a,type:H,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ls(re,Q,Me.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:Vb[Q.position],toNode:null,pointer:K};function P(){q=!0,y(Z),w==null||w(e,{nodeId:a,handleId:r,handleType:H})}D===0&&P();function ee(ge){if(!q){const{x:Ce,y:rt}=Qn(ge),bt=Ce-G,Ge=rt-U;if(!(bt*bt+Ge*Ge>D*D))return;P()}if(!R()||!Q){ne(ge);return}const he=E();K=Qn(ge,Y),z=Uz(vl(K,he,!1,[1,1]),n,c,Q),L||(F(),L=!0);const ye=m2(ge,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:S,doc:j,lib:f,flowId:d,nodeLookup:c});$=ye.handleDomNode,M=ye.connection,O=$z(!!z,ye.isValid);const be=c.get(a),ke=be?ls(be,Q,Me.Left,!0):Z.from,Ee={...Z,from:ke,isValid:O,to:ye.toHandle&&O?va({x:ye.toHandle.x,y:ye.toHandle.y},he):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:Vb[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};y(Ee),Z=Ee}function ne(ge){if(!("touches"in ge&&ge.touches.length>0)){if(q){(z||$)&&M&&O&&(C==null||C(M));const{inProgress:he,...ye}=Z,be={...ye,toPosition:Z.toHandle?Z.toPosition:null};b==null||b(ge,be),l&&(x==null||x(ge,be))}v(),cancelAnimationFrame(B),L=!1,O=!1,M=null,$=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function m2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=g2,nodeLookup:p}){const d=l==="target",_=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:w}=Qn(e),C=u.elementFromPoint(v,w),b=C!=null&&C.classList.contains(`${o}-flow__handle`)?C:_,S={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const x=p2(void 0,b),y=b.getAttribute("data-nodeid"),E=b.getAttribute("data-handleid"),R=b.classList.contains("connectable"),N=b.classList.contains("connectableend");if(!y||!x)return S;const D={source:d?y:r,sourceHandle:d?E:a,target:d?r:y,targetHandle:d?a:E};S.connection=D;const j=R&&N&&(n===ma.Strict?d&&x==="source"||!d&&x==="target":y!==r||E!==a);S.isValid=j&&f(D),S.toHandle=d2(y,x,E,p,n,!0)}return S}const gg={onPointerDown:Gz,isValid:m2};function qz({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:_=!0,inversePan:v=!1}){const w=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=y.sourceEvent.ctrlKey&&rl()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*p,D=E[2]*Math.pow(2,N*R);t.scaleTo(D)};let C=[0,0];const b=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(C=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},S=y=>{const E=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const R=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[R[0]-C[0],R[1]-C[1]];C=R;const D=r()*Math.max(E[2],Math.log(E[2]))*(v?-1:1),T={x:E[0]-N[0]*D,y:E[1]-N[1]*D},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=$C().on("start",b).on("zoom",d?S:null).on("zoom.wheel",_?w:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const wh=e=>({x:e.x,y:e.y,zoom:e.k}),yp=({x:e,y:t,zoom:n})=>bh.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),_2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Vz=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bp=(e,t=0,n=Vz,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},v2=e=>{const t=e.ctrlKey&&rl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Yz({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(la(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const b=Xn(p),S=v2(p),x=d*Math.pow(2,S);r.scaleTo(n,x,b,p);return}const _=p.deltaMode===1?20:1;let v=a===ts.Vertical?0:p.deltaX*_,w=a===ts.Horizontal?0:p.deltaY*_;!rl()&&p.shiftKey&&a!==ts.Vertical&&(v=p.deltaY*_,w=0),r.translateBy(n,-(v/d)*l,-(w/d)*l,{internal:!0});const C=wh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,C),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,C),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,C))}}function Wz({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=la(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function Xz({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=wh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function Kz({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&_2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,wh(l.transform)))}}function Zz({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&_2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=wh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function Qz({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var b;const _=e||t,v=n&&d.ctrlKey,w=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(la(d,`${f}-flow__node`)||la(d,`${f}-flow__edge`)))return!0;if(!r&&!_&&!a&&!l&&!n||u||p&&!w||la(d,o)&&w||la(d,c)&&(!w||a&&w&&!e)||!n&&d.ctrlKey&&w)return!1;if(!n&&d.type==="touchstart"&&((b=d.touches)==null?void 0:b.length)>1)return d.preventDefault(),!1;if(!_&&!a&&!v&&w||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const C=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||w)&&C}}function Jz({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=$C().scaleExtent([t,n]).translateExtent(r),_=An(e).call(d);x({x:a.x,y:a.y,zoom:_a(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const v=_.on("wheel.zoom"),w=_.on("dblclick.zoom");d.wheelDelta(v2);async function C(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).transform(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}function b({noWheelClassName:z,noPanClassName:G,onPaneContextMenu:U,userSelectionActive:H,panOnScroll:Y,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:F,lib:Q,onTransformChange:re,connectionInProgress:ae,paneClickDistance:Z,selectionOnDrag:P}){H&&!f.isZoomingOrPanning&&S();const ee=Y&&!F&&!H;d.clickDistance(P?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?Yz({zoomPanValues:f,noWheelClassName:z,d3Selection:_,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):Wz({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:v});_.on("wheel.zoom",ne,{passive:!1});const ge=Xz({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",ge);const he=Kz({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!U,onPanZoom:l,onTransformChange:re});d.on("zoom",he);const ye=Zz({zoomPanValues:f,panOnDrag:q,panOnScroll:Y,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const be=Qz({zoomActivationKeyPressed:F,panOnDrag:q,zoomOnScroll:O,panOnScroll:Y,zoomOnDoubleClick:$,zoomOnPinch:M,userSelectionActive:H,noPanClassName:G,noWheelClassName:z,lib:Q,connectionInProgress:ae});d.filter(be),$?_.on("dblclick.zoom",w):_.on("dblclick.zoom",null)}function S(){d.on("zoom",null)}async function x(z,G,U){const H=yp(z),Y=d==null?void 0:d.constrain()(H,G,U);return Y&&await C(Y),Y}async function y(z,G){const U=yp(z);return await C(U,G),U}function E(z){if(_){const G=yp(z),U=_.property("__zoom");(U.k!==z.zoom||U.x!==z.x||U.y!==z.y)&&(d==null||d.transform(_,G,null,{sync:!0}))}}function R(){const z=_?UC(_.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).scaleTo(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}async function D(z,G){return _?new Promise(U=>{d==null||d.interpolate((G==null?void 0:G.interpolate)==="linear"?zo:gu).scaleBy(bp(_,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>U(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const G=!Zn(z)||z<0?0:z;d==null||d.clickDistance(G)}return{update:b,destroy:S,setViewport:y,setViewportConstrained:x,getViewport:R,scaleTo:N,scaleBy:D,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var ya;(function(e){e.Line="line",e.Handle="handle"})(ya||(ya={}));function eH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function sS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Cr(e,t){return Math.max(0,e-t)}function iu(e,t,n){return Math.max(0,t-e,e-n)}function aS(e,t){return e?!t:t}function tH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,_=p&&d,{xSnapped:v,ySnapped:w}=n,{minWidth:C,maxWidth:b,minHeight:S,maxHeight:x}=r,{x:y,y:E,width:R,height:N,aspectRatio:D}=e;let T=Math.floor(p?v-e.pointerX:0),j=Math.floor(d?w-e.pointerY:0);const B=R+(c?-T:T),z=N+(f?-j:j),G=-l[0]*R,U=-l[1]*N;let H=iu(B,C,b),Y=iu(z,S,x);if(u){let K=0,L=0;c&&T<0?K=wr(y+T+G,u[0][0]):!c&&T>0&&(K=Cr(y+B+G,u[1][0])),f&&j<0?L=wr(E+j+U,u[0][1]):!f&&j>0&&(L=Cr(E+z+U,u[1][1])),H=Math.max(H,K),Y=Math.max(Y,L)}if(o){let K=0,L=0;c&&T>0?K=Cr(y+T,o[0][0]):!c&&T<0&&(K=wr(y+B,o[1][0])),f&&j>0?L=Cr(E+j,o[0][1]):!f&&j<0&&(L=wr(E+z,o[1][1])),H=Math.max(H,K),Y=Math.max(Y,L)}if(a){if(p){const K=iu(B/D,S,x)*D;if(H=Math.max(H,K),u){let L=0;!c&&!f||c&&!f&&_?L=Cr(E+U+B/D,u[1][1])*D:L=wr(E+U+(c?T:-T)/D,u[0][1])*D,H=Math.max(H,L)}if(o){let L=0;!c&&!f||c&&!f&&_?L=wr(E+B/D,o[1][1])*D:L=Cr(E+(c?T:-T)/D,o[0][1])*D,H=Math.max(H,L)}}if(d){const K=iu(z*D,C,b)/D;if(Y=Math.max(Y,K),u){let L=0;!c&&!f||f&&!c&&_?L=Cr(y+z*D+G,u[1][0])/D:L=wr(y+(f?j:-j)*D+G,u[0][0])/D,Y=Math.max(Y,L)}if(o){let L=0;!c&&!f||f&&!c&&_?L=wr(y+z*D,o[1][0])/D:L=Cr(y+(f?j:-j)*D,o[0][0])/D,Y=Math.max(Y,L)}}}j=j+(j<0?Y:-Y),T=T+(T<0?H:-H),a&&(_?B>z*D?j=(aS(c,f)?-T:T)/D:T=(aS(c,f)?-j:j)*D:p?(j=T/D,f=c):(T=j*D,c=f));const q=c?y+T:y,X=f?E+j:E;return{width:R+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const y2={width:0,height:0,x:0,y:0},nH={...y2,pointerX:0,pointerY:0,aspectRatio:1};function iH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function rH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:sS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:_,onResizeStart:v,onResize:w,onResizeEnd:C,shouldResize:b}){let S={...y2},x={...nH};u={boundaries:p,resizeDirection:_,keepAspectRatio:d,controlDirection:sS(f)};let y,E=null,R=[],N,D,T,j=!1;const B=NC().on("start",z=>{const{nodeLookup:G,transform:U,snapGrid:H,snapToGrid:Y,nodeOrigin:q,paneDomNode:X}=n();if(y=G.get(t),!y)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Ho(z.sourceEvent,{transform:U,snapGrid:H,snapToGrid:Y,containerBounds:E});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...S,pointerX:K,pointerY:L,aspectRatio:S.width/S.height},N=void 0,D=os(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=G.get(y.parentId)),N&&y.extent==="parent"&&(D=[[0,0],[N.measured.width,N.measured.height]]),R=[],T=void 0;for(const[M,O]of G)if(O.parentId===t&&(R.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=iH(O,y,O.origin??q);T?T=[[Math.min($[0][0],T[0][0]),Math.min($[0][1],T[0][1])],[Math.max($[1][0],T[1][0]),Math.max($[1][1],T[1][1])]]:T=$}v==null||v(z,{...S})}).on("drag",z=>{const{transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y}=n(),q=Ho(z.sourceEvent,{transform:G,snapGrid:U,snapToGrid:H,containerBounds:E}),X=[];if(!y)return;const{x:K,y:L,width:M,height:O}=S,$={},F=y.origin??Y,{width:Q,height:re,x:ae,y:Z}=tH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,F,D,T),P=Q!==M,ee=re!==O,ne=ae!==K&&P,ge=Z!==L&ⅇif(!ne&&!ge&&!P&&!ee)return;if((ne||ge||F[0]===1||F[1]===1)&&($.x=ne?ae:S.x,$.y=ge?Z:S.y,S.x=$.x,S.y=$.y,R.length>0)){const ke=ae-K,Ee=Z-L;for(const Ce of R)Ce.position={x:Ce.position.x-ke+F[0]*(Q-M),y:Ce.position.y-Ee+F[1]*(re-O)},X.push(Ce)}if((P||ee)&&($.width=P&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:S.width,$.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:S.height,S.width=$.width,S.height=$.height),N&&y.expandParent){const ke=F[0]*($.width??0);$.x&&$.x<ke&&(S.x=ke,x.x=x.x-($.x-ke));const Ee=F[1]*($.height??0);$.y&&$.y<Ee&&(S.y=Ee,x.y=x.y-($.y-Ee))}const he=eH({width:S.width,prevWidth:M,height:S.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ye={...S,direction:he};(b==null?void 0:b(z,ye))!==!1&&(j=!0,w==null||w(z,ye),r($,X))}).on("end",z=>{j&&(C==null||C(z,{...S}),a==null||a({...S}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Sp={exports:{}},xp={},wp={exports:{}},Cp={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var oS;function sH(){if(oS)return Cp;oS=1;var e=al();function t(d,_){return d===_&&(d!==0||1/d===1/_)||d!==d&&_!==_}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,_){var v=_(),w=r({inst:{value:v,getSnapshot:_}}),C=w[0].inst,b=w[1];return l(function(){C.value=v,C.getSnapshot=_,c(C)&&b({inst:C})},[d,v,_]),a(function(){return c(C)&&b({inst:C}),d(function(){c(C)&&b({inst:C})})},[d]),u(v),v}function c(d){var _=d.getSnapshot;d=d.value;try{var v=_();return!n(d,v)}catch{return!0}}function f(d,_){return _()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Cp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Cp}var lS;function aH(){return lS||(lS=1,wp.exports=sH()),wp.exports}/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var cS;function oH(){if(cS)return xp;cS=1;var e=al(),t=aH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(f,p,d,_,v){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=o(function(){function S(N){if(!x){if(x=!0,y=N,N=_(N),v!==void 0&&C.hasValue){var D=C.value;if(v(D,N))return E=D}return E=N}if(D=E,r(y,N))return D;var T=_(N);return v!==void 0&&v(D,T)?(y=N,D):(y=N,E=T)}var x=!1,y,E,R=d===void 0?null:d;return[function(){return S(p())},R===null?void 0:function(){return S(R())}]},[p,d,_,v]);var b=a(f,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=b},[b]),c(b),b},xp}var uS;function lH(){return uS||(uS=1,Sp.exports=oH()),Sp.exports}var cH=lH();const uH=Pu(cH),hH={},hS=e=>{let t;const n=new Set,r=(p,d)=>{const _=typeof p=="function"?p(t):p;if(!Object.is(_,t)){const v=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(w=>w(t,v))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(hH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},fH=e=>e?hS(e):hS,{useDebugValue:dH}=cA,{useSyncExternalStoreWithSelector:pH}=uH,gH=e=>e;function b2(e,t=gH,n){const r=pH(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dH(r),r}const fS=(e,t)=>{const n=fH(e),r=(a,l=t)=>b2(n,a,l);return Object.assign(r,n),r},mH=(e,t)=>e?fS(e,t):fS;function kt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}zS();const Ch=V.createContext(null),_H=Ch.Provider,S2=ei.error001("react");function tt(e,t){const n=V.useContext(Ch);if(n===null)throw new Error(S2);return b2(n,e,t)}function At(){const e=V.useContext(Ch);if(e===null)throw new Error(S2);return V.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const dS={display:"none"},vH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},x2="react-flow__node-desc",w2="react-flow__edge-desc",yH="react-flow__aria-live",bH=e=>e.ariaLiveMessage,SH=e=>e.ariaLabelConfig;function xH({rfId:e}){const t=tt(bH);return m.jsx("div",{id:`${yH}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vH,children:t})}function wH({rfId:e,disableKeyboardA11y:t}){const n=tt(SH);return m.jsxs(m.Fragment,{children:[m.jsx("div",{id:`${x2}-${e}`,style:dS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),m.jsx("div",{id:`${w2}-${e}`,style:dS,children:n["edge.a11yDescription.default"]}),!t&&m.jsx(xH,{rfId:e})]})}const Eh=V.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return m.jsx("div",{className:Ft(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Eh.displayName="Panel";const pS="https://reactflow.dev?utm_source=attribution";function CH({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:m.jsx(Eh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${pS}`,children:m.jsx("a",{href:pS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const EH=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ru=e=>e.id;function kH(e,t){return kt(e.selectedNodes.map(ru),t.selectedNodes.map(ru))&&kt(e.selectedEdges.map(ru),t.selectedEdges.map(ru))}function AH({onSelectionChange:e}){const t=At(),{selectedNodes:n,selectedEdges:r}=tt(EH,kH);return V.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const NH=e=>!!e.onSelectionChangeHandlers;function TH({onSelectionChange:e}){const t=tt(NH);return e||t?m.jsx(AH,{onSelectionChange:e}):null}const C2=[0,0],RH={x:0,y:0,zoom:1},DH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],gS=[...DH,"rfId"],MH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),mS={translateExtent:tl,nodeOrigin:C2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jH(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=tt(MH,kt),f=At();V.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=mS,o()}),[]);const p=V.useRef(mS);return V.useEffect(()=>{for(const d of gS){const _=e[d],v=p.current[d];_!==v&&(typeof e[d]>"u"||(d==="nodes"?t(_):d==="edges"?n(_):d==="minZoom"?r(_):d==="maxZoom"?a(_):d==="translateExtent"?l(_):d==="nodeExtent"?u(_):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:_z(_)}):d==="fitView"?f.setState({fitViewQueued:_}):d==="fitViewOptions"?f.setState({fitViewOptions:_}):f.setState({[d]:_})))}p.current=e},gS.map(d=>e[d])),null}function _S(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function LH(e){var r;const[t,n]=V.useState(e==="system"?null:e);return V.useEffect(()=>{if(e!=="system"){n(e);return}const a=_S(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=_S())!=null&&r.matches?"dark":"light"}const vS=typeof document<"u"?document:null;function sl(e=null,t={target:vS,actInsideInputWithModifier:!0}){const[n,r]=V.useState(!1),a=V.useRef(!1),l=V.useRef(new Set([])),[u,o]=V.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),p=f.reduce((d,_)=>d.concat(..._),[]);return[f,p]}return[[],[]]},[e]);return V.useEffect(()=>{const c=(t==null?void 0:t.target)??vS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=v=>{var b,S;if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!f)&&i2(v))return!1;const C=bS(v.code,o);if(l.current.add(v[C]),yS(u,l.current,!1)){const x=((S=(b=v.composedPath)==null?void 0:b.call(v))==null?void 0:S[0])||v.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!y)&&v.preventDefault(),r(!0)}},d=v=>{const w=bS(v.code,o);yS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),a.current=!1},_=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,r]),n}function yS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function bS(e,t){return t.includes(e)?"code":"key"}const OH=()=>{const e=At();return V.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Om(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return vl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=va(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function E2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)BH(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function BH(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function IH(e,t){return E2(e,t)}function zH(e,t){return E2(e,t)}function Zr(e,t){return{id:e,type:"select",selected:t}}function ca(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(Zr(l.id,u)))}return r}function SS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function xS(e){return{id:e.id,type:"remove"}}const HH=JC();function FH(e,t,n={}){return wz(e,t,{...n,onError:n.onError??HH})}const wS=e=>lz(e),PH=e=>WC(e);function k2(e){return V.forwardRef(e)}const UH=typeof window<"u"?V.useLayoutEffect:V.useEffect;function CS(e){const[t,n]=V.useState(BigInt(0)),[r]=V.useState(()=>$H(()=>n(a=>a+BigInt(1))));return UH(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function $H(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const A2=V.createContext(null);function GH({children:e}){const t=At(),n=V.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:_,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let C=c;for(const S of o)C=typeof S=="function"?S(C):S;let b=SS({items:C,lookup:_});for(const S of w.values())b=S(b);p&&f(C),b.length>0?d==null||d(b):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:x,setNodes:y}=t.getState();S&&y(x)})},[]),r=CS(n),a=V.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:_}=t.getState();let v=c;for(const w of o)v=typeof w=="function"?w(v):w;p?f(v):d&&d(SS({items:v,lookup:_}))},[]),l=CS(a),u=V.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return m.jsx(A2.Provider,{value:u,children:e})}function qH(){const e=V.useContext(A2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const VH=e=>!!e.panZoom;function Um(){const e=OH(),t=At(),n=qH(),r=tt(VH),a=V.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var S,x;const{nodeLookup:_,nodeOrigin:v}=t.getState(),w=wS(d)?d:_.get(d.id),C=w.parentId?t2(w.position,w.measured,w.parentId,_,v):w.position,b={...w,position:C,width:((S=w.measured)==null?void 0:S.width)??w.width,height:((x=w.measured)==null?void 0:x.height)??w.height};return il(b)},f=(d,_,v={replace:!1})=>{u(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&wS(b)?b:{...C,...b}}return C}))},p=(d,_,v={replace:!1})=>{o(w=>w.map(C=>{if(C.id===d){const b=typeof _=="function"?_(C):_;return v.replace&&PH(b)?b:{...C,...b}}return C}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var _;return(_=l(d))==null?void 0:_.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(_=>({..._}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const _=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,..._])},addEdges:d=>{const _=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,..._])},toObject:()=>{const{nodes:d=[],edges:_=[],transform:v}=t.getState(),[w,C,b]=v;return{nodes:d.map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:w,y:C,zoom:b}}},deleteElements:async({nodes:d=[],edges:_=[]})=>{const{nodes:v,edges:w,onNodesDelete:C,onEdgesDelete:b,triggerNodeChanges:S,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:E}=t.getState(),{nodes:R,edges:N}=await dz({nodesToRemove:d,edgesToRemove:_,nodes:v,edges:w,onBeforeDelete:E}),D=N.length>0,T=R.length>0;if(D){const j=N.map(xS);b==null||b(N),x(j)}if(T){const j=R.map(xS);C==null||C(R),S(j)}return(T||D)&&(y==null||y({nodes:R,edges:N})),{deletedNodes:R,deletedEdges:N}},getIntersectingNodes:(d,_=!0,v)=>{const w=Wb(d),C=w?d:c(d),b=v!==void 0;return C?(v||t.getState().nodes).filter(S=>{const x=t.getState().nodeLookup.get(S.id);if(x&&!w&&(S.id===d.id||!x.internals.positionAbsolute))return!1;const y=il(b?S:x),E=zu(y,C);return _&&E>0||E>=y.width*y.height||E>=C.width*C.height}):[]},isNodeIntersecting:(d,_,v=!0)=>{const C=Wb(d)?d:c(d);if(!C)return!1;const b=zu(C,_);return v&&b>0||b>=_.width*_.height||b>=C.width*C.height},updateNode:f,updateNodeData:(d,_,v={replace:!1})=>{f(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},updateEdge:p,updateEdgeData:(d,_,v={replace:!1})=>{p(d,w=>{const C=typeof _=="function"?_(w):_;return v.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},v)},getNodesBounds:d=>{const{nodeLookup:_,nodeOrigin:v}=t.getState();return cz(d,{nodeLookup:_,nodeOrigin:v})},getHandleConnections:({type:d,id:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}-${d}${_?`-${_}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:d,handleId:_,nodeId:v})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${v}${d?_?`-${d}-${_}`:`-${d}`:""}`))==null?void 0:w.values())??[])},fitView:async d=>{const _=t.getState().fitViewResolver??mz();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:_}),n.nodeQueue.push(v=>[...v]),_.promise}}},[]);return V.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const ES=e=>e.selected,YH=typeof window<"u"?window:void 0;function WH({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=At(),{deleteElements:r}=Um(),a=sl(e,{actInsideInputWithModifier:!1}),l=sl(t,{target:YH});V.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(ES),edges:u.filter(ES)}),n.setState({nodesSelectionActive:!1})}},[a]),V.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function XH(e){const t=At();V.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Bm(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},KH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ZH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=ts.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:_,preventScrolling:v=!0,children:w,noWheelClassName:C,noPanClassName:b,onViewportChange:S,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:E}){const R=At(),N=V.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:j}=tt(KH,kt),B=sl(_),z=V.useRef();XH(N);const G=V.useCallback(U=>{S==null||S({x:U[0],y:U[1],zoom:U[2]}),x||R.setState({transform:U})},[S,x]);return V.useEffect(()=>{if(N.current){z.current=Jz({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:q=>R.setState(X=>X.paneDragging===q?X:{paneDragging:q}),onPanZoomStart:(q,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoom:(q,X)=>{const{onViewportChange:K,onMove:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoomEnd:(q,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=R.getState();L==null||L(q,X),K==null||K(X)}});const{x:U,y:H,zoom:Y}=z.current.getViewport();return R.setState({panZoom:z.current,transform:[U,H,Y],domNode:N.current.closest(".react-flow")}),()=>{var q;(q=z.current)==null||q.destroy()}}},[]),V.useEffect(()=>{var U;(U=z.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:v,noPanClassName:b,userSelectionActive:D,noWheelClassName:C,lib:T,onTransformChange:G,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:y})},[e,t,n,r,a,l,u,o,B,v,b,D,C,T,G,j,E,y]),m.jsx("div",{className:"react-flow__renderer",ref:N,style:kh,children:w})}const QH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function JH(){const{userSelectionActive:e,userSelectionRect:t}=tt(QH,kt);return e&&t?m.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ep=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},eF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function tF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=nl.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:_,onPaneMouseMove:v,onPaneMouseLeave:w,children:C}){const b=V.useRef(0),S=At(),{userSelectionActive:x,elementsSelectable:y,dragging:E,panBy:R,autoPanSpeed:N}=tt(eF,kt),D=y&&(e||x),T=V.useRef(null),j=V.useRef(),B=V.useRef(new Set),z=V.useRef(new Set),G=V.useRef(!1),U=V.useRef(!1),H=V.useRef({x:0,y:0}),Y=V.useRef(!1),q=P=>{if(U.current||G.current||S.getState().connection.inProgress){U.current=!1,G.current=!1;return}f==null||f(P),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},X=P=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){P.preventDefault();return}p==null||p(P)},K=d?P=>d(P):void 0,L=P=>{U.current&&(P.stopPropagation(),U.current=!1)},M=P=>{var Ce,rt;const{domNode:ee,transform:ne}=S.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const ge=P.target===T.current;if(!ge&&!!P.target.closest(".nokey")||!e||!(u&&ge||t)||P.button!==0||!P.isPrimary)return;(rt=(Ce=P.target)==null?void 0:Ce.setPointerCapture)==null||rt.call(Ce,P.pointerId),U.current=!1;const{x:be,y:ke}=Qn(P.nativeEvent,j.current),Ee=vl({x:be,y:ke},ne);S.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:be,y:ke}}),ge||(P.stopPropagation(),P.preventDefault())};function O(P,ee){const{userSelectionRect:ne}=S.getState();if(!ne)return;const{transform:ge,nodeLookup:he,edgeLookup:ye,connectionLookup:be,triggerNodeChanges:ke,triggerEdgeChanges:Ee,defaultEdgeOptions:Ce}=S.getState(),rt={x:ne.startX,y:ne.startY},{x:bt,y:Ge}=va(rt,ge),ct={startX:rt.x,startY:rt.y,x:P<bt?P:bt,y:ee<Ge?ee:Ge,width:Math.abs(P-bt),height:Math.abs(ee-Ge)},Pt=B.current,ht=z.current;B.current=new Set(jm(he,ct,ge,n===nl.Partial,!0).map(fe=>fe.id)),z.current=new Set;const Fe=(Ce==null?void 0:Ce.selectable)??!0;for(const fe of B.current){const ie=be.get(fe);if(ie)for(const{edgeId:de}of ie.values()){const Se=ye.get(de);Se&&(Se.selectable??Fe)&&z.current.add(de)}}if(!Xb(Pt,B.current)){const fe=ca(he,B.current,!0);ke(fe)}if(!Xb(ht,z.current)){const fe=ca(ye,z.current);Ee(fe)}S.setState({userSelectionRect:ct,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!a||!j.current)return;const[P,ee]=Lm(H.current,j.current,N);R({x:P,y:ee}).then(ne=>{if(!U.current||!ne){b.current=requestAnimationFrame($);return}const{x:ge,y:he}=H.current;O(ge,he),b.current=requestAnimationFrame($)})}const F=()=>{cancelAnimationFrame(b.current),b.current=0,Y.current=!1};V.useEffect(()=>()=>F(),[]);const Q=P=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:ge}=S.getState();if(!j.current||!ee)return;const{x:he,y:ye}=Qn(P.nativeEvent,j.current);H.current={x:he,y:ye};const be=va({x:ee.startX,y:ee.startY},ne);if(!U.current){const ke=t?0:l;if(Math.hypot(he-be.x,ye-be.y)<=ke)return;ge(),o==null||o(P)}U.current=!0,Y.current||($(),Y.current=!0),O(he,ye)},re=P=>{var ee,ne;if(!D){P.target===T.current&&S.getState().connection.inProgress&&(G.current=!0);return}P.button===0&&((ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),!x&&P.target===T.current&&S.getState().userSelectionRect&&(q==null||q(P)),S.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(P),S.setState({nodesSelectionActive:B.current.size>0})),F())},ae=P=>{var ee,ne;(ne=(ee=P.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,P.pointerId),F()},Z=r===!0||Array.isArray(r)&&r.includes(0);return m.jsxs("div",{className:Ft(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:D?void 0:Ep(q,T),onContextMenu:Ep(X,T),onWheel:Ep(K,T),onPointerEnter:D?void 0:_,onPointerMove:D?Q:v,onPointerUp:re,onPointerCancel:D?ae:void 0,onPointerDownCapture:D?M:void 0,onClickCapture:D?L:void 0,onPointerLeave:w,ref:T,style:kh,children:[C,m.jsx(JH,{})]})}function mg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function N2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=At(),[c,f]=V.useState(!1),p=V.useRef();return V.useEffect(()=>{p.current=Hz({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{mg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),V.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{var d;(d=p.current)==null||d.destroy()}},[n,r,t,l,e,a,u]),c}const nF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function T2(){const e=At();return V.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,_=nF(u),v=a?l[0]:5,w=a?l[1]:5,C=n.direction.x*v*n.factor,b=n.direction.y*w*n.factor;for(const[,S]of f){if(!_(S))continue;let x={x:S.internals.positionAbsolute.x+C,y:S.internals.positionAbsolute.y+b};a&&(x=_l(x,l));const{position:y,positionAbsolute:E}=XC({nodeId:S.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});S.position=y,S.internals.positionAbsolute=E,d.set(S.id,S)}c(d)},[])}const $m=V.createContext(null),iF=$m.Provider;$m.Consumer;const R2=()=>V.useContext($m),rF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),D2=V.createContext(null);function sF({children:e}){const t=tt(rF,kt);return m.jsx(D2.Provider,{value:t,children:e})}function aF(){const e=V.useContext(D2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const oF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},lF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return oF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===ma.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function cF({type:e="source",position:t=Me.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,..._},v){var Y,q;const w=u||null,C=e==="target",b=At(),S=R2(),{connectOnClick:x,noPanClassName:y,rfId:E}=aF(),{connectingFrom:R,connectingTo:N,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:z}=tt(lF(S,w,e),kt);S||(q=(Y=b.getState()).onError)==null||q.call(Y,"010",ei.error010());const G=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=b.getState(),O={...K,...X};if(M){const{edges:$,setEdges:F,onError:Q}=b.getState();F(FH(O,$,{onError:Q}))}L==null||L(O),o==null||o(O)},U=X=>{if(!S)return;const K=r2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=b.getState();gg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:C,handleId:w,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,$;return($=(O=b.getState()).onConnectEnd)==null?void 0:$.call(O,...M)},updateConnection:L.updateConnection,onConnect:G,isValidConnection:n||((...M)=>{var O,$;return(($=(O=b.getState()).isValidConnection)==null?void 0:$.call(O,...M))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},H=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:$,lib:F,rfId:Q,nodeLookup:re,connection:ae}=b.getState();if(!S||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:S,handleId:w,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:S,type:e,id:w}});return}const Z=n2(X.target),P=n||$,{connection:ee,isValid:ne}=gg.isValid(X.nativeEvent,{handle:{nodeId:S,id:w,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:P,flowId:Q,doc:Z,lib:F,nodeLookup:re});ne&&ee&&G(ee);const ge=structuredClone(ae);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(X,ge),b.setState({connectionClickStartHandle:null})};return m.jsx("div",{"data-handleid":w,"data-nodeid":S,"data-handlepos":t,"data-id":`${E}-${S}-${w}-${e}`,className:Ft(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,f,{source:!C,target:C,connectable:r,connectablestart:a,connectableend:l,clickconnecting:D,connectingfrom:R,connectingto:N,valid:z,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:U,onTouchStart:U,onClick:x?H:void 0,ref:v,..._,children:c})}const ba=V.memo(k2(cF));function uF({data:e,isConnectable:t,sourcePosition:n=Me.Bottom}){return m.jsxs(m.Fragment,{children:[e==null?void 0:e.label,m.jsx(ba,{type:"source",position:n,isConnectable:t})]})}function hF({data:e,isConnectable:t,targetPosition:n=Me.Top,sourcePosition:r=Me.Bottom}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,m.jsx(ba,{type:"source",position:r,isConnectable:t})]})}function fF(){return null}function dF({data:e,isConnectable:t,targetPosition:n=Me.Top}){return m.jsxs(m.Fragment,{children:[m.jsx(ba,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Hu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},kS={input:uF,default:hF,output:dF,group:fF};function pF(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const gF=e=>{const{width:t,height:n,x:r,y:a}=ml(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function mF({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=At(),{width:a,height:l,transformString:u,userSelectionActive:o}=tt(gF,kt),c=T2(),f=V.useRef(null);V.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(N2({nodeRef:f,disabled:!p}),!p)return null;const d=e?v=>{const w=r.getState().nodes.filter(C=>C.selected);e(v,w)}:void 0,_=v=>{Object.prototype.hasOwnProperty.call(Hu,v.key)&&(v.preventDefault(),c({direction:Hu[v.key],factor:v.shiftKey?4:1}))};return m.jsx("div",{className:Ft(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:m.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:_,style:{width:a,height:l}})})}const AS=typeof window<"u"?window:void 0,_F=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function M2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:b,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:U,preventScrolling:H,onSelectionContextMenu:Y,noWheelClassName:q,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:$}=tt(_F,kt),F=sl(f,{target:AS}),Q=sl(C,{target:AS}),re=Q||T,ae=Q||E,Z=p&&re!==!0,P=F||$||Z;return WH({deleteKeyCode:c,multiSelectionKeyCode:w}),m.jsx(ZH,{onPaneContextMenu:l,elementsSelectable:S,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:!F&&re,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:H,noWheelClassName:q,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:m.jsxs(tF,{onSelectionStart:_,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!P,selectionMode:d,selectionKeyPressed:F,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&m.jsx(mF,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:K})]})})}M2.displayName="FlowRenderer";const vF=V.memo(M2),yF=e=>t=>e?jm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function bF(e){return tt(V.useCallback(yF(e),[e]),kt)}const SF=e=>e.updateNodeInternals;function xF(){const e=tt(SF),[t]=V.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return V.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function wF({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=At(),l=V.useRef(null),u=V.useRef(null),o=V.useRef(e.sourcePosition),c=V.useRef(e.targetPosition),f=V.useRef(t),p=n&&!!e.internals.handleBounds;return V.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),V.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(l.current){const d=f.current!==t,_=o.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||_||v)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function CF({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:_,noPanClassName:v,disableKeyboardA11y:w,rfId:C,nodeTypes:b,nodeClickDistance:S,onError:x}){const{node:y,internals:E,isParent:R}=tt(P=>{const ee=P.nodeLookup.get(e),ne=P.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},kt);let N=y.type||"default",D=(b==null?void 0:b[N])||kS[N];D===void 0&&(x==null||x("003",ei.error003(N)),N="default",D=(b==null?void 0:b.default)||kS.default);const T=!!(y.draggable||o&&typeof y.draggable>"u"),j=!!(y.selectable||c&&typeof y.selectable>"u"),B=!!(y.connectable||f&&typeof y.connectable>"u"),z=!!(y.focusable||p&&typeof y.focusable>"u"),G=At(),U=e2(y),H=wF({node:y,nodeType:N,hasDimensions:U,resizeObserver:d}),Y=N2({nodeRef:H,disabled:y.hidden||!T,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:S}),q=T2();if(y.hidden)return null;const X=Vi(y),K=pF(y),L=j||T||t||n||r||a,M=n?P=>n(P,{...E.userNode}):void 0,O=r?P=>r(P,{...E.userNode}):void 0,$=a?P=>a(P,{...E.userNode}):void 0,F=l?P=>l(P,{...E.userNode}):void 0,Q=u?P=>u(P,{...E.userNode}):void 0,re=P=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=G.getState();j&&(!ee||!T||ne>0)&&mg({id:e,store:G,nodeRef:H}),t&&t(P,{...E.userNode})},ae=P=>{if(!(i2(P.nativeEvent)||w)){if(GC.includes(P.key)&&j){const ee=P.key==="Escape";mg({id:e,store:G,unselect:ee,nodeRef:H})}else if(T&&y.selected&&Object.prototype.hasOwnProperty.call(Hu,P.key)){P.preventDefault();const{ariaLabelConfig:ee}=G.getState();G.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:P.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),q({direction:Hu[P.key],factor:P.shiftKey?4:1})}}},Z=()=>{var be;if(w||!((be=H.current)!=null&&be.matches(":focus-visible")))return;const{transform:P,width:ee,height:ne,autoPanOnNodeFocus:ge,setCenter:he}=G.getState();if(!ge)return;jm(new Map([[e,y]]),{x:0,y:0,width:ee,height:ne},P,!0).length>0||he(y.position.x+X.width/2,y.position.y+X.height/2,{zoom:P[2]})};return m.jsx("div",{className:Ft(["react-flow__node",`react-flow__node-${N}`,{[v]:T},y.className,{selected:y.selected,selectable:j,parent:R,draggable:T,dragging:Y}]),ref:H,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:U?"visible":"hidden",...y.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:$,onContextMenu:F,onClick:re,onDoubleClick:Q,onKeyDown:z?ae:void 0,tabIndex:z?0:void 0,onFocus:z?Z:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${x2}-${C}`,"aria-label":y.ariaLabel,...y.domAttributes,children:m.jsx(iF,{value:e,children:m.jsx(D,{id:e,data:y.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:j,draggable:T,deletable:y.deletable??!0,isConnectable:B,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Y,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...X})})})}var EF=V.memo(CF);const kF=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function j2(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=tt(kF,kt),u=bF(e.onlyRenderVisibleElements),o=xF();return m.jsx("div",{className:"react-flow__nodes",style:kh,children:u.map(c=>m.jsx(EF,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},c))})}j2.displayName="NodeRenderer";const AF=V.memo(j2);function NF(e){return tt(V.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&bz({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),kt)}const TF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return m.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},RF=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return m.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},NS={[Bu.Arrow]:TF,[Bu.ArrowClosed]:RF};function DF(e){const t=At();return V.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(NS,e)?NS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const MF=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=DF(t);return c?m.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:m.jsx(c,{color:n,strokeWidth:u})}):null},L2=({defaultColor:e,rfId:t})=>{const n=tt(l=>l.edges),r=tt(l=>l.defaultEdgeOptions),a=V.useMemo(()=>Nz(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?m.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:m.jsx("defs",{children:a.map(l=>m.jsx(MF,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};L2.displayName="MarkerDefinitions";var jF=V.memo(L2);function O2({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,_]=V.useState({x:1,y:0,width:0,height:0}),v=Ft(["react-flow__edge-textwrapper",f]),w=V.useRef(null);return V.useEffect(()=>{if(w.current){const C=w.current.getBBox();_({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?m.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...p,children:[a&&m.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),m.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:w,style:r,children:n}),c]}):null}O2.displayName="EdgeText";const LF=V.memo(O2);function Ah({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return m.jsxs(m.Fragment,{children:[m.jsx("path",{...p,d:e,fill:"none",className:Ft(["react-flow__edge-path",p.className])}),f?m.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?m.jsx(LF,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function TS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Me.Left||e===Me.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function B2({sourceX:e,sourceY:t,sourcePosition:n=Me.Bottom,targetX:r,targetY:a,targetPosition:l=Me.Top}){const[u,o]=TS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=TS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,_,v]=s2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,_,v]}function I2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})=>{const[x,y,E]=B2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),R=e.isInternal?void 0:t;return m.jsx(Ah,{id:R,path:x,labelX:y,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:S})})}const OF=I2({isInternal:!1}),z2=I2({isInternal:!0});OF.displayName="SimpleBezierEdge";z2.displayName="SimpleBezierEdgeInternal";function H2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,sourcePosition:v=Me.Bottom,targetPosition:w=Me.Top,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=fg({sourceX:n,sourceY:r,sourcePosition:v,targetX:a,targetY:l,targetPosition:w,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:C,markerStart:b,interactionWidth:x})})}const F2=H2({isInternal:!1}),P2=H2({isInternal:!0});F2.displayName="SmoothStepEdge";P2.displayName="SmoothStepEdgeInternal";function U2(e){return V.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return m.jsx(F2,{...n,id:r,pathOptions:V.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const BF=U2({isInternal:!1}),$2=U2({isInternal:!0});BF.displayName="StepEdge";$2.displayName="StepEdgeInternal";function G2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})=>{const[b,S,x]=l2({sourceX:n,sourceY:r,targetX:a,targetY:l}),y=e.isInternal?void 0:t;return m.jsx(Ah,{id:y,path:b,labelX:S,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:_,markerEnd:v,markerStart:w,interactionWidth:C})})}const IF=G2({isInternal:!1}),q2=G2({isInternal:!0});IF.displayName="StraightEdge";q2.displayName="StraightEdgeInternal";function V2(e){return V.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=Me.Bottom,targetPosition:o=Me.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,pathOptions:S,interactionWidth:x})=>{const[y,E,R]=a2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:S==null?void 0:S.curvature}),N=e.isInternal?void 0:t;return m.jsx(Ah,{id:N,path:y,labelX:E,labelY:R,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:v,style:w,markerEnd:C,markerStart:b,interactionWidth:x})})}const zF=V2({isInternal:!1}),Y2=V2({isInternal:!0});zF.displayName="BezierEdge";Y2.displayName="BezierEdgeInternal";const RS={default:Y2,straight:q2,step:$2,smoothstep:P2,simplebezier:z2},DS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},HF=(e,t,n)=>n===Me.Left?e-t:n===Me.Right?e+t:e,FF=(e,t,n)=>n===Me.Top?e-t:n===Me.Bottom?e+t:e,MS="react-flow__edgeupdater";function jS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return m.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Ft([MS,`${MS}-${o}`]),cx:HF(t,r,e),cy:FF(n,r,e),r,stroke:"transparent",fill:"transparent"})}function PF({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:_,setUpdateHover:v}){const w=At(),C=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:D,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:z,cancelConnection:G,nodeLookup:U,rfId:H,panBy:Y,updateConnection:q}=w.getState(),X=R.type==="target",K=(O,$)=>{_(!1),d==null||d(O,n,R.type,$)},L=O=>f==null?void 0:f(n,O),M=(O,$)=>{_(!0),p==null||p(E,n,R.type),z==null||z(O,$)};gg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:D,handleId:R.id,nodeId:R.nodeId,nodeLookup:U,isTarget:X,edgeUpdaterType:R.type,lib:B,flowId:H,cancelConnection:G,panBy:Y,isValidConnection:(...O)=>{var $,F;return((F=($=w.getState()).isValidConnection)==null?void 0:F.call($,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var $,F;return(F=($=w.getState()).onConnectEnd)==null?void 0:F.call($,...O)},onReconnectEnd:K,updateConnection:q,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},b=E=>C(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=E=>C(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>v(!0),y=()=>v(!1);return m.jsxs(m.Fragment,{children:[(e===!0||e==="source")&&m.jsx(jS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&m.jsx(jS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function UF({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,rfId:w,edgeTypes:C,noPanClassName:b,onError:S,disableKeyboardA11y:x}){let y=tt(he=>he.edgeLookup.get(e));const E=tt(he=>he.defaultEdgeOptions);y=E?{...E,...y}:y;let R=y.type||"default",N=(C==null?void 0:C[R])||RS[R];N===void 0&&(S==null||S("011",ei.error011(R)),R="default",N=(C==null?void 0:C.default)||RS.default);const D=!!(y.focusable||t&&typeof y.focusable>"u"),T=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),j=!!(y.selectable||r&&typeof y.selectable>"u"),B=V.useRef(null),[z,G]=V.useState(!1),[U,H]=V.useState(!1),Y=At(),{zIndex:q=y.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$}=tt(V.useCallback(he=>{const ye=he.nodeLookup.get(y.source),be=he.nodeLookup.get(y.target);if(!ye||!be)return DS;const ke=Az({id:e,sourceNode:ye,targetNode:be,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:he.connectionMode,onError:S}),Ee=yz({selected:y.selected,zIndex:y.zIndex,sourceNode:ye,targetNode:be,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode});return{...ke||DS,zIndex:Ee}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),kt),F=V.useMemo(()=>y.markerStart?`url('#${dg(y.markerStart,w)}')`:void 0,[y.markerStart,w]),Q=V.useMemo(()=>y.markerEnd?`url('#${dg(y.markerEnd,w)}')`:void 0,[y.markerEnd,w]);if(y.hidden||X===null||K===null||L===null||M===null)return null;const re=he=>{var Ee;const{addSelectedEdges:ye,unselectNodesAndEdges:be,multiSelectionActive:ke}=Y.getState();j&&(Y.setState({nodesSelectionActive:!1}),y.selected&&ke?(be({nodes:[],edges:[y]}),(Ee=B.current)==null||Ee.blur()):ye([e])),a&&a(he,y)},ae=l?he=>{l(he,{...y})}:void 0,Z=u?he=>{u(he,{...y})}:void 0,P=o?he=>{o(he,{...y})}:void 0,ee=c?he=>{c(he,{...y})}:void 0,ne=f?he=>{f(he,{...y})}:void 0,ge=he=>{var ye;if(!x&&GC.includes(he.key)&&j){const{unselectNodesAndEdges:be,addSelectedEdges:ke}=Y.getState();he.key==="Escape"?((ye=B.current)==null||ye.blur(),be({edges:[y]})):ke([e])}};return m.jsx("svg",{style:{zIndex:q},children:m.jsxs("g",{className:Ft(["react-flow__edge",`react-flow__edge-${R}`,y.className,b,{selected:y.selected,animated:y.animated,inactive:!j&&!a,updating:z,selectable:j}]),onClick:re,onDoubleClick:ae,onContextMenu:Z,onMouseEnter:P,onMouseMove:ee,onMouseLeave:ne,onKeyDown:D?ge:void 0,tabIndex:D?0:void 0,role:y.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":D?`${w2}-${w}`:void 0,ref:B,...y.domAttributes,children:[!U&&m.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:j,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&m.jsx(PF,{edge:y,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:_,onReconnectEnd:v,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:$,setUpdateHover:G,setReconnecting:H})]})})}var $F=V.memo(UF);const GF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function W2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,onError:y}=tt(GF,kt),E=NF(t);return m.jsxs("div",{className:"react-flow__edges",children:[m.jsx(jF,{defaultColor:e,rfId:n}),E.map(R=>m.jsx($F,{id:R,edgesFocusable:b,edgesReconnectable:S,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:_,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:C},R))]})}W2.displayName="EdgeRenderer";const qF=V.memo(W2),VF=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function YF({children:e}){const t=tt(VF);return m.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WF(e){const t=Um(),n=V.useRef(!1);V.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const XF=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function KF(e){const t=tt(XF),n=At();return V.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ZF(e){return e.connection.inProgress?{...e.connection,to:vl(e.connection.to,e.transform)}:{...e.connection}}function QF(e){return ZF}function JF(e){const t=QF();return tt(t,kt)}const eP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=tt(eP,kt);return!(l&&a&&c)?null:m.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:m.jsx("g",{className:Ft(["react-flow__connection",YC(o)]),children:m.jsx(X2,{style:t,type:n,CustomComponent:r,isValid:o})})})}const X2=({style:e,type:t=Er.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:_,pointer:v}=JF();if(!a)return;if(n)return m.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:_,connectionStatus:YC(r),toNode:p,toHandle:d,pointer:v});let w="";const C={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:_};switch(t){case Er.Bezier:[w]=a2(C);break;case Er.SimpleBezier:[w]=B2(C);break;case Er.Step:[w]=fg({...C,borderRadius:0});break;case Er.SmoothStep:[w]=fg(C);break;default:[w]=l2(C)}return m.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};X2.displayName="ConnectionLine";const nP={};function LS(e=nP){V.useRef(e),At(),V.useEffect(()=>{},[e])}function iP(){At(),V.useRef(!1),V.useEffect(()=>{},[])}function K2({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:_,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:b,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:z,translateExtent:G,minZoom:U,maxZoom:H,preventScrolling:Y,defaultMarkerColor:q,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:F,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:ge,nodeClickDistance:he,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie,viewport:de,onViewportChange:Se}){return LS(e),LS(t),iP(),WF(n),KF(de),m.jsx(vF,{onPaneClick:re,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:P,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:v,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:$,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:F,autoPanOnSelection:Q,defaultViewport:z,translateExtent:G,minZoom:U,maxZoom:H,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:ct,noWheelClassName:Pt,noPanClassName:ht,disableKeyboardA11y:Fe,onViewportChange:Se,isControlledViewport:!!de,children:m.jsxs(YF,{children:[m.jsx(qF,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:rt,onReconnectStart:bt,onReconnectEnd:Ge,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:ke,onEdgeMouseLeave:Ee,reconnectRadius:Ce,defaultMarkerColor:q,noPanClassName:ht,disableKeyboardA11y:Fe,rfId:ie}),m.jsx(tP,{style:C,type:w,component:b,containerStyle:S}),m.jsx("div",{className:"react-flow__edgelabel-renderer"}),m.jsx(AF,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:he,onlyRenderVisibleElements:j,noPanClassName:ht,noDragClassName:ct,disableKeyboardA11y:Fe,nodeExtent:fe,rfId:ie}),m.jsx("div",{className:"react-flow__viewport-portal"})]})})}K2.displayName="GraphView";const rP=V.memo(K2),sP=JC(),OS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:_="basic"}={})=>{const v=new Map,w=new Map,C=new Map,b=new Map,S=r??t??[],x=n??e??[],y=p??[0,0],E=d??tl;h2(C,b,S);const{nodesInitialized:R}=pg(x,v,w,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let N=[0,0,1];if(u&&a&&l){const D=ml(v,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:T,y:j,zoom:B}=Om(D,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:R,nodeLookup:v,parentLookup:w,edges:S,edgeLookup:b,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:tl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ma.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...VC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:sP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:qC,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},aP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_})=>mH((v,w)=>{async function C(){const{nodeLookup:b,panZoom:S,fitViewOptions:x,fitViewResolver:y,width:E,height:R,minZoom:N,maxZoom:D}=w();S&&(await fz({nodes:b,width:E,height:R,panZoom:S,minZoom:N,maxZoom:D},x),y==null||y.resolve(!0),v({fitViewResolver:null}))}return{...OS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:_}),setNodes:b=>{const{nodeLookup:S,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:N,nodesSelectionActive:D}=w(),{nodesInitialized:T,hasSelectedNodes:j}=pg(b,S,x,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=D&&j;R&&T?(C(),v({nodes:b,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):v({nodes:b,nodesInitialized:T,nodesSelectionActive:B})},setEdges:b=>{const{connectionLookup:S,edgeLookup:x}=w();h2(S,x,b),v({edges:b})},setDefaultNodesAndEdges:(b,S)=>{if(b){const{setNodes:x}=w();x(b),v({hasDefaultNodes:!0})}if(S){const{setEdges:x}=w();x(S),v({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:S,nodeLookup:x,parentLookup:y,domNode:E,nodeOrigin:R,nodeExtent:N,debug:D,fitViewQueued:T,zIndexMode:j}=w(),{changes:B,updatedInternals:z}=Oz(b,x,y,E,R,N,j);z&&(Dz(x,y,{nodeOrigin:R,nodeExtent:N,zIndexMode:j}),T?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(B==null?void 0:B.length)>0&&(D&&console.log("React Flow: trigger node changes",B),S==null||S(B)))},updateNodePositions:(b,S=!1)=>{const x=[];let y=[];const{nodeLookup:E,triggerNodeChanges:R,connection:N,updateConnection:D,onNodesChangeMiddlewareMap:T}=w();for(const[j,B]of b){const z=E.get(j),G=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(B!=null&&B.position)),U={id:j,type:"position",position:G?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:S};if(z&&N.inProgress&&N.fromNode.id===z.id){const H=ls(z,N.fromHandle,Me.Left,!0);D({...N,from:H})}G&&z.parentId&&x.push({id:j,parentId:z.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),y.push(U)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=w(),z=Pm(x,E,j,B);y.push(...z)}for(const j of T.values())y=j(y);R(y)},triggerNodeChanges:b=>{const{onNodesChange:S,setNodes:x,nodes:y,hasDefaultNodes:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=IH(b,y);x(N)}R&&console.log("React Flow: trigger node changes",b),S==null||S(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:S,setEdges:x,edges:y,hasDefaultEdges:E,debug:R}=w();if(b!=null&&b.length){if(E){const N=zH(b,y);x(N)}R&&console.log("React Flow: trigger edge changes",b),S==null||S(b)}},addSelectedNodes:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));E(N);return}E(ca(y,new Set([...b]),!0)),R(ca(x))},addSelectedEdges:b=>{const{multiSelectionActive:S,edgeLookup:x,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=w();if(S){const N=b.map(D=>Zr(D,!0));R(N);return}R(ca(x,new Set([...b]))),E(ca(y,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:S}={})=>{const{edges:x,nodes:y,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:N}=w(),D=b||y,T=S||x,j=[];for(const z of D){if(!z.selected)continue;const G=E.get(z.id);G&&(G.selected=!1),j.push(Zr(z.id,!1))}const B=[];for(const z of T)z.selected&&B.push(Zr(z.id,!1));R(j),N(B)},setMinZoom:b=>{const{panZoom:S,maxZoom:x}=w();S==null||S.setScaleExtent([b,x]),v({minZoom:b})},setMaxZoom:b=>{const{panZoom:S,minZoom:x}=w();S==null||S.setScaleExtent([x,b]),v({maxZoom:b})},setTranslateExtent:b=>{var S;(S=w().panZoom)==null||S.setTranslateExtent(b),v({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:S,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:E}=w();if(!E)return;const R=S.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]),N=b.reduce((D,T)=>T.selected?[...D,Zr(T.id,!1)]:D,[]);x(R),y(N)},setNodeExtent:b=>{const{nodes:S,nodeLookup:x,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:N,zIndexMode:D}=w();b[0][0]===N[0][0]&&b[0][1]===N[0][1]&&b[1][0]===N[1][0]&&b[1][1]===N[1][1]||(pg(S,x,y,{nodeOrigin:E,nodeExtent:b,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:D}),v({nodeExtent:b}))},panBy:b=>{const{transform:S,width:x,height:y,panZoom:E,translateExtent:R}=w();return Bz({delta:b,panZoom:E,transform:S,translateExtent:R,width:x,height:y})},setCenter:async(b,S,x)=>{const{width:y,height:E,maxZoom:R,panZoom:N}=w();if(!N)return!1;const D=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:R;return await N.setViewport({x:y/2-b*D,y:E/2-S*D,zoom:D},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{v({connection:{...VC}})},updateConnection:b=>{v({connection:b})},reset:()=>v({...OS()})}},Object.is);function oP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:_,children:v}){const[w]=V.useState(()=>aP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:_}));return m.jsx(_H,{value:w,children:m.jsx(GH,{children:m.jsx(sF,{children:v})})})}function lP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v}){return V.useContext(Ch)?m.jsx(m.Fragment,{children:e}):m.jsx(oP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:_,zIndexMode:v,children:e})}const cP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function uP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:_,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:z,onDelete:G,onSelectionChange:U,onSelectionDragStart:H,onSelectionDrag:Y,onSelectionDragStop:q,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:$=Er.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:ae="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:P=!1,selectionMode:ee=nl.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ge=rl()?"Meta":"Control",zoomActivationKeyCode:he=rl()?"Meta":"Control",snapToGrid:ye,snapGrid:be,onlyRenderVisibleElements:ke=!1,selectNodesOnDrag:Ee,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,nodeOrigin:ct=C2,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe=!0,defaultViewport:fe=RH,minZoom:ie=.5,maxZoom:de=2,translateExtent:Se=tl,preventScrolling:Ae=!0,nodeExtent:De,defaultMarkerColor:Ve="#b1b1b7",zoomOnScroll:Ie=!0,zoomOnPinch:Nt=!0,panOnScroll:Ct=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:st=ts.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:Ut=!0,onPaneClick:ps,onPaneMouseEnter:gi,onPaneMouseMove:mi,onPaneMouseLeave:_i,onPaneScroll:On,onPaneContextMenu:vi,paneClickDistance:ni=1,nodeClickDistance:oe=0,children:we,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:yi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl=10,onNodesChange:bl,onEdgesChange:ii,noDragClassName:$t="nodrag",noWheelClassName:Qt="nowheel",noPanClassName:bi="nopan",fitView:ms,fitViewOptions:Sl,connectOnClick:Nh,attributionPosition:xl,proOptions:Rr,defaultEdgeOptions:Na,elevateNodesOnSelect:Yi=!0,elevateEdgesOnSelect:Wi=!1,disableKeyboardA11y:Xi=!1,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanOnSelection:wl=!0,autoPanSpeed:Cl,connectionRadius:Si,isValidConnection:Zi,onError:Th,style:El,id:Ta,nodeDragThreshold:Rh,connectionDragThreshold:_s,viewport:vs,onViewportChange:qn,width:an,height:kl,colorMode:Dh="light",debug:Ra,onScroll:Dr,ariaLabelConfig:ys,zIndexMode:Al="basic",...on},Da){const bs=Ta||"1",Ma=LH(Dh),Qi=V.useCallback(ja=>{ja.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Dr==null||Dr(ja)},[Dr]);return m.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:Qi,style:{...El,...cP},ref:Da,className:Ft(["react-flow",a,Ma]),id:Ta,role:"application",children:m.jsxs(lP,{nodes:e,edges:t,width:an,height:kl,fitView:ms,fitViewOptions:Sl,minZoom:ie,maxZoom:de,nodeOrigin:ct,nodeExtent:De,zIndexMode:Al,children:[m.jsx(jH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:w,onConnectEnd:C,onClickConnectStart:b,onClickConnectEnd:S,nodesDraggable:Ce,autoPanOnNodeFocus:rt,nodesConnectable:bt,nodesFocusable:Ge,edgesFocusable:Pt,edgesReconnectable:ht,elementsSelectable:Fe,elevateNodesOnSelect:Yi,elevateEdgesOnSelect:Wi,minZoom:ie,maxZoom:de,nodeExtent:De,onNodesChange:bl,onEdgesChange:ii,snapToGrid:ye,snapGrid:be,connectionMode:O,translateExtent:Se,connectOnClick:Nh,defaultEdgeOptions:Na,fitView:ms,fitViewOptions:Sl,onNodesDelete:B,onEdgesDelete:z,onDelete:G,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:Y,onSelectionDragStart:H,onSelectionDragStop:q,onMove:p,onMoveStart:d,onMoveEnd:_,noPanClassName:bi,nodeOrigin:ct,rfId:bs,autoPanOnConnect:Ki,autoPanOnNodeDrag:Lt,autoPanSpeed:Cl,onError:Th,connectionRadius:Si,isValidConnection:Zi,selectNodesOnDrag:Ee,nodeDragThreshold:Rh,connectionDragThreshold:_s,onBeforeDelete:M,debug:Ra,ariaLabelConfig:ys,zIndexMode:Al}),m.jsx(rP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:$,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:P,selectionMode:ee,deleteKeyCode:ae,multiSelectionKeyCode:ge,panActivationKeyCode:ne,zoomActivationKeyCode:he,onlyRenderVisibleElements:ke,defaultViewport:fe,translateExtent:Se,minZoom:ie,maxZoom:de,preventScrolling:Ae,zoomOnScroll:Ie,zoomOnPinch:Nt,zoomOnDoubleClick:Ln,panOnScroll:Ct,panOnScrollSpeed:qt,panOnScrollMode:st,panOnDrag:Ut,autoPanOnSelection:wl,onPaneClick:ps,onPaneMouseEnter:gi,onPaneMouseMove:mi,onPaneMouseLeave:_i,onPaneScroll:On,onPaneContextMenu:vi,paneClickDistance:ni,nodeClickDistance:oe,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:Ne,onReconnectStart:qe,onReconnectEnd:at,onEdgeContextMenu:yi,onEdgeDoubleClick:nn,onEdgeMouseEnter:gs,onEdgeMouseMove:ka,onEdgeMouseLeave:Aa,reconnectRadius:yl,defaultMarkerColor:Ve,noDragClassName:$t,noWheelClassName:Qt,noPanClassName:bi,rfId:bs,disableKeyboardA11y:Xi,nodeExtent:De,viewport:vs,onViewportChange:qn}),m.jsx(TH,{onSelectionChange:U}),we,m.jsx(CH,{proOptions:Rr,position:xl}),m.jsx(wH,{rfId:bs,disableKeyboardA11y:Xi})]})})}var hP=k2(uP);function fP({dimensions:e,lineWidth:t,variant:n,className:r}){return m.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ft(["react-flow__background-pattern",n,r])})}function dP({radius:e,className:t}){return m.jsx("circle",{cx:e,cy:e,r:e,className:Ft(["react-flow__background-pattern","dots",t])})}var Pi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pi||(Pi={}));const pP={[Pi.Dots]:1,[Pi.Lines]:1,[Pi.Cross]:6},gP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Z2({id:e,variant:t=Pi.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=V.useRef(null),{transform:_,patternId:v}=tt(gP,kt),w=r||pP[t],C=t===Pi.Dots,b=t===Pi.Cross,S=Array.isArray(n)?n:[n,n],x=[S[0]*_[2]||1,S[1]*_[2]||1],y=w*_[2],E=Array.isArray(l)?l:[l,l],R=b?[y,y]:x,N=[E[0]*_[2]||1+R[0]/2,E[1]*_[2]||1+R[1]/2],D=`${v}${e||""}`;return m.jsxs("svg",{className:Ft(["react-flow__background",f]),style:{...c,...kh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[m.jsx("pattern",{id:D,x:_[0]%x[0],y:_[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:C?m.jsx(dP,{radius:y/2,className:p}):m.jsx(fP,{dimensions:R,lineWidth:a,variant:t,className:p})}),m.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Z2.displayName="Background";const mP=V.memo(Z2);function _P(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:m.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function vP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:m.jsx("path",{d:"M0 0h32v4.2H0z"})})}function yP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:m.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function bP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function SP(){return m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:m.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function su({children:e,className:t,...n}){return m.jsx("button",{type:"button",className:Ft(["react-flow__controls-button",t]),...n,children:e})}const xP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Q2({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:_="vertical","aria-label":v}){const w=At(),{isInteractive:C,minZoomReached:b,maxZoomReached:S,ariaLabelConfig:x}=tt(xP,kt),{zoomIn:y,zoomOut:E,fitView:R}=Um(),N=()=>{y(),l==null||l()},D=()=>{E(),u==null||u()},T=()=>{R(a),o==null||o()},j=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),c==null||c(!C)},B=_==="horizontal"?"horizontal":"vertical";return m.jsxs(Eh,{className:Ft(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??x["controls.ariaLabel"],children:[t&&m.jsxs(m.Fragment,{children:[m.jsx(su,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:S,children:m.jsx(_P,{})}),m.jsx(su,{onClick:D,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:b,children:m.jsx(vP,{})})]}),n&&m.jsx(su,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:m.jsx(yP,{})}),r&&m.jsx(su,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:C?m.jsx(SP,{}):m.jsx(bP,{})}),p]})}Q2.displayName="Controls";V.memo(Q2);function wP({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:_,onClick:v}){const{background:w,backgroundColor:C}=l||{},b=u||w||C;return m.jsx("rect",{className:Ft(["react-flow__minimap-node",{selected:_},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:b,stroke:o,strokeWidth:c},shapeRendering:d,onClick:v?S=>v(S,e):void 0})}const CP=V.memo(wP),EP=e=>e.nodes.map(t=>t.id),kp=e=>e instanceof Function?e:()=>e;function kP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=CP,onClick:u}){const o=tt(EP,kt),c=kp(t),f=kp(e),p=kp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return m.jsx(m.Fragment,{children:o.map(_=>m.jsx(NP,{id:_,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},_))})}function AP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:_,height:v}=tt(w=>{const C=w.nodeLookup.get(e);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const b=C.internals.userNode,{x:S,y:x}=C.internals.positionAbsolute,{width:y,height:E}=Vi(b);return{node:b,x:S,y:x,width:y,height:E}},kt);return!f||f.hidden||!e2(f)?null:m.jsx(o,{x:p,y:d,width:_,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const NP=V.memo(AP);var TP=V.memo(kP);const RP=200,DP=150,MP=e=>!e.hidden,jP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?ZC(ml(e.nodeLookup,{filter:MP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LP="react-flow__minimap-desc";function J2({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:_="bottom-right",onClick:v,onNodeClick:w,pannable:C=!1,zoomable:b=!1,ariaLabel:S,inversePan:x,zoomStep:y=1,offsetScale:E=5}){const R=At(),N=V.useRef(null),{boundingRect:D,viewBB:T,rfId:j,panZoom:B,translateExtent:z,flowWidth:G,flowHeight:U,ariaLabelConfig:H}=tt(jP,kt),Y=(e==null?void 0:e.width)??RP,q=(e==null?void 0:e.height)??DP,X=D.width/Y,K=D.height/q,L=Math.max(X,K),M=L*Y,O=L*q,$=E*L,F=D.x-(M-D.width)/2-$,Q=D.y-(O-D.height)/2-$,re=M+$*2,ae=O+$*2,Z=`${LP}-${j}`,P=V.useRef(0),ee=V.useRef();P.current=L,V.useEffect(()=>{if(N.current&&B)return ee.current=qz({domNode:N.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>P.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),V.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:z,width:G,height:U,inversePan:x,pannable:C,zoomStep:y,zoomable:b})},[C,b,x,y,z,G,U]);const ne=v?ye=>{var Ee;const[be,ke]=((Ee=ee.current)==null?void 0:Ee.pointer(ye))||[0,0];v(ye,{x:be,y:ke})}:void 0,ge=w?V.useCallback((ye,be)=>{const ke=R.getState().nodeLookup.get(be).internals.userNode;w(ye,ke)},[]):void 0,he=S??H["minimap.ariaLabel"];return m.jsx(Eh,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Ft(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:m.jsxs("svg",{width:Y,height:q,viewBox:`${F} ${Q} ${re} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[he&&m.jsx("title",{id:Z,children:he}),m.jsx(TP,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),m.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-$},${Q-$}h${re+$*2}v${ae+$*2}h${-re-$*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}J2.displayName="MiniMap";V.memo(J2);const OP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[ya.Line]:"right",[ya.Handle]:"bottom-right"};function IP({nodeId:e,position:t,variant:n=ya.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:_,autoScale:v=!0,shouldResize:w,onResizeStart:C,onResize:b,onResizeEnd:S}){const x=R2(),y=typeof e=="string"?e:x,E=At(),R=V.useRef(null),N=n===ya.Handle,D=tt(V.useCallback(OP(N&&v),[N,v]),kt),T=V.useRef(null),j=t??BP[n];V.useEffect(()=>{if(!(!R.current||!y))return T.current||(T.current=rH({domNode:R.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y,domNode:q}=E.getState();return{nodeLookup:z,transform:G,snapGrid:U,snapToGrid:H,nodeOrigin:Y,paneDomNode:q}},onChange:(z,G)=>{const{triggerNodeChanges:U,nodeLookup:H,parentLookup:Y,nodeOrigin:q}=E.getState(),X=[],K={x:z.x,y:z.y},L=H.get(y);if(L&&L.expandParent&&L.parentId){const M=L.origin??q,O=z.width??L.measured.width??0,$=z.height??L.measured.height??0,F={id:L.id,parentId:L.parentId,rect:{width:O,height:$,...t2({x:z.x??L.position.x,y:z.y??L.position.y},{width:O,height:$},L.parentId,H,M)}},Q=Pm([F],H,Y,q);X.push(...Q),K.x=z.x?Math.max(M[0]*O,z.x):void 0,K.y=z.y?Math.max(M[1]*$,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:y,type:"position",position:{...K}};X.push(M)}if(z.width!==void 0&&z.height!==void 0){const O={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};X.push(O)}for(const M of G){const O={...M,type:"position"};X.push(O)}U(X)},onEnd:({width:z,height:G})=>{const U={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:G}};E.getState().triggerNodeChanges([U])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:_,onResizeStart:C,onResize:b,onResizeEnd:S,shouldResize:w}),()=>{var z;(z=T.current)==null||z.destroy()}},[j,o,c,f,p,d,C,b,S,w]);const B=j.split("-");return m.jsx("div",{className:Ft(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...a,scale:D,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}V.memo(IP);const _g=264,zP=132,yu=44,HP=72;function FP(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function bu(e){if(e.children.length===0)return _g;const t=e.children.reduce((n,r)=>n+bu(r),0)+yu*(e.children.length-1);return Math.max(_g,t)}function PP(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const UP=V.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",_=l?"BASELINE":d?"RUNNING":"EXPERIMENT",v=a.slice(-8);return m.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[m.jsx(ba,{type:"target",position:Me.Top}),m.jsxs("div",{className:"node-eyebrow",children:[m.jsx("span",{children:_}),m.jsx(Vo,{status:p??"idle"})]}),m.jsx("div",{className:"node-head",children:m.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&m.jsx("div",{className:"node-title",children:n.title||n.description}),m.jsxs("div",{className:"node-meta",children:[m.jsx("span",{children:"RUNS"}),v.length>0?m.jsx("span",{className:"run-squares",children:v.map(w=>m.jsx("span",{className:`run-sq ${PP(w.status)}`,title:w.status},w.id))}):m.jsx("span",{children:"no runs"}),m.jsx("span",{style:{flex:1}}),r&&m.jsx("span",{children:Sa(r.createdAt)})]}),m.jsxs("div",{className:"node-actions",onClick:w=>w.stopPropagation(),children:[m.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[m.jsx($u,{size:13}),"Changes"]}),a.length>0&&m.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[m.jsx(YS,{size:13}),"Logs"]}),m.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[m.jsx(GS,{size:13}),"Code"]}),m.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:xg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:m.jsx(pm,{size:13})})]}),m.jsx(ba,{type:"source",position:Me.Bottom})]})}),$P={exp:UP},GP={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function qP({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=V.useMemo(()=>{const o=new Map;for(const v of t){const w=o.get(v.experimentId);w?w.push(v):o.set(v.experimentId,[v])}for(const v of o.values())v.sort((w,C)=>w.createdAt-C.createdAt);const c=[],f=[],p=FP(e);function d(v,w,C){const b=o.get(v.exp.id)??[];if(c.push({id:v.exp.id,type:"exp",position:{x:w-_g/2,y:C},data:{exp:v.exp,latestRun:b[b.length-1]??null,runs:b,isBaseline:!v.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),v.children.length===0)return;const S=v.children.reduce((y,E)=>y+bu(E),0)+yu*(v.children.length-1);let x=w-S/2;for(const y of v.children){const E=bu(y);f.push({id:`e-${v.exp.id}-${y.exp.id}`,source:v.exp.id,target:y.exp.id}),d(y,x+E/2,C+zP+HP),x+=E+yu}}let _=0;for(const v of p){const w=bu(v);d(v,_+w/2,0),_+=w+yu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?m.jsxs("div",{className:"empty-state empty-state-cta",children:[m.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),m.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):m.jsx(hP,{nodes:l,edges:u,nodeTypes:$P,defaultEdgeOptions:GP,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:m.jsx(mP,{variant:Pi.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const au=(e,t)=>e.id===t.id&&e.view===t.view,ou=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,BS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function VP(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const IS="orx:onboarded",eE="orx:panel-width",Fu=360,YP=10,WP=232,XP=380,KP=WP+56,ZP=80;function vg(){return Math.max(Fu,window.innerWidth-KP-XP)}function QP(){const e=vg();try{const t=Number(localStorage.getItem(eE));if(Number.isFinite(t)&&t>=Fu)return Math.min(t,e)}catch{}return Math.max(Fu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function lu(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function JP(){var ht,Fe;const[e,t]=V.useState(null),[n,r]=V.useState(null),[a,l]=V.useState([]),[u,o]=V.useState([]),[c,f]=V.useState(null),[p,d]=V.useState("tree"),[_,v]=V.useState(null),[w,C]=V.useState("experiments"),[b,S]=V.useState([]),[x,y]=V.useState([]),[E,R]=V.useState([]),[N,D]=V.useState(null),[T,j]=V.useState(!0),[B,z]=V.useState(!1),[G,U]=V.useState(QP),[H,Y]=V.useState(!0),[q,X]=V.useState(!1),[K,L]=V.useState("chat"),[M,O]=V.useState(()=>{try{return localStorage.getItem(IS)==="1"}catch{return!0}}),$=V.useRef(n);$.current=n,V.useEffect(()=>{AN().then(fe=>{t(fe),r(ie=>{var de;return ie??((de=fe[0])==null?void 0:de.id)??null})}).catch(()=>t([]))},[]),V.useEffect(()=>{const fe=()=>U(ie=>Math.min(ie,vg()));return window.addEventListener("resize",fe),()=>window.removeEventListener("resize",fe)},[]),V.useEffect(()=>{n&&(DN(n).catch(()=>{}),l([]),o([]),f(null),v(null),S([]),y([]),R([]),D(null),C("experiments"),jN(n).then(l).catch(()=>{}),LN(n).then(o).catch(()=>{}),Iy(n).then(f).catch(()=>{}))},[n]);const F=V.useCallback(()=>{const fe=$.current;fe&&Iy(fe).then(f).catch(()=>{})},[]);AT({onRun:fe=>{fe.projectId===$.current&&o(ie=>lu(ie,fe))},onExperiment:fe=>{fe.projectId===$.current&&l(ie=>lu(ie,fe))},onProject:fe=>{t(ie=>ie?lu(ie,fe):[fe])},onFiles:fe=>{fe===$.current&&F()}});const Q=V.useCallback((fe,ie="changes")=>{const de={id:fe,view:ie};S(Se=>Se.some(Ae=>au(Ae,de))?Se:[...Se,de]),C(de),j(!0)},[]),re=V.useCallback(fe=>{const ie=b.findIndex(Se=>au(Se,fe));if(ie===-1)return;const de=b.filter((Se,Ae)=>Ae!==ie);S(de),typeof w=="object"&&"view"in w&&au(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[b,w]),ae=V.useCallback((fe,ie,de)=>{var De;const Se=(De=e==null?void 0:e.find(Ve=>Ve.id===n))==null?void 0:De.repoPath,Ae=VP(fe,Se,ie);Ae&&(de&&(Ae.ref=de),y(Ve=>Ve.some(Ie=>ou(Ie,Ae))?Ve:[...Ve,Ae]),C(Ae),j(!0))},[e,n]),Z=V.useCallback(fe=>{const ie=x.findIndex(Se=>ou(Se,fe));if(ie===-1)return;const de=x.filter((Se,Ae)=>Ae!==ie);y(de),typeof w=="object"&&"path"in w&&ou(w,fe)&&C(de[Math.min(ie,de.length-1)]??"experiments")},[x,w]),P=V.useCallback((fe,ie,de)=>{const Se={kind:"plan",sessionId:ie,promptId:de,plan:fe};R(Ae=>{const De=Ae.findIndex(Ie=>Ie.promptId===de);if(De===-1)return[...Ae,Se];const Ve=Ae.slice();return Ve[De]=Se,Ve}),C(Se),j(!0)},[]),ee=V.useCallback(fe=>{const ie=E.findIndex(Se=>Se.promptId===fe.promptId);if(ie===-1)return;const de=E.filter((Se,Ae)=>Ae!==ie);R(de),typeof w=="object"&&"kind"in w&&w.promptId===fe.promptId&&C(de[Math.min(ie,de.length-1)]??"experiments")},[E,w]),ne=V.useCallback(fe=>{const ie={code:!0,sel:fe,toggled:new Set};D(de=>de?{...de,sel:fe}:ie),C(ie),j(!0)},[]),ge=V.useCallback(fe=>{D(ie=>ie&&{...ie,...fe})},[]),he=V.useCallback(()=>{D(null),C(fe=>typeof fe=="object"&&"code"in fe?"experiments":fe)},[]),ye=fe=>{fe.preventDefault(),fe.currentTarget.setPointerCapture(fe.pointerId);const ie=document.body.style.userSelect;document.body.style.userSelect="none";const de=Ae=>{const De=Math.round(window.innerWidth-Ae.clientX-YP),Ve=vg();if(De>Ve+ZP){z(!0);return}z(!1);const Ie=Math.min(Math.max(De,Fu),Ve);U(Ie);try{localStorage.setItem(eE,String(Ie))}catch{}},Se=()=>{window.removeEventListener("pointermove",de),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se),document.body.style.userSelect=ie};window.addEventListener("pointermove",de),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se)},be=fe=>{t(ie=>ie?lu(ie,fe):[fe]),r(fe.id),X(!1)},ke=fe=>{t(ie=>ie&&ie.filter(de=>de.id!==fe)),n===fe&&r(null)},Ee=typeof w=="object"&&"view"in w?w:null,Ce=typeof w=="object"&&"path"in w?w:null,rt=typeof w=="object"&&"kind"in w?w:null,bt=typeof w=="object"&&"code"in w,Ge=(e==null?void 0:e.find(fe=>fe.id===n))??null,ct=Ee?a.find(fe=>fe.id===Ee.id)??null:null;if(e===null)return m.jsx("div",{className:"app",children:m.jsx("div",{className:"empty-state",children:m.jsx("span",{className:"spinner"})})});if(e.length===0)return m.jsx("div",{className:"app",children:M?m.jsx(Nb,{projects:e,onOpen:r,onCreated:be,onDeleted:ke}):m.jsx(vB,{onDone:()=>{try{localStorage.setItem(IS,"1")}catch{}O(!0)}})});const Pt=m.jsx(_B,{projectName:((ht=e.find(fe=>fe.id===n))==null?void 0:ht.name)??"",onHome:()=>X(!0),onCollapse:()=>Y(!1)});return m.jsx("div",{className:"app",children:q?m.jsx(Nb,{projects:e,onOpen:fe=>{r(fe),X(!1)},onCreated:be,onDeleted:ke}):m.jsxs("div",{className:"app-body",children:[n&&m.jsx(TL,{projectId:n,paperId:(Fe=e.find(fe=>fe.id===n))==null?void 0:Fe.paperId,railHeader:Pt,railOpen:H,onShowRail:()=>Y(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&z(!1),j(!T)},onOpenFile:ae,onOpenPlan:P,children:K==="files"?(()=>{const fe=e.find(ie=>ie.id===n);return fe?m.jsx(PL,{project:fe,files:c,onChanged:F,onOpenStorage:()=>L("storage")}):null})():K!=="chat"?m.jsx(pL,{tab:K}):null}),K==="chat"&&T&&m.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:G},children:[!B&&m.jsx("div",{className:"panel-resizer",onPointerDown:ye}),m.jsxs("div",{className:"tabs",children:[m.jsxs("div",{className:"tab-strip",children:[m.jsx("button",{className:`tab ${w==="experiments"?"active":""}`,onClick:()=>C("experiments"),children:"Experiments"}),b.map(fe=>{const ie=a.find(de=>de.id===fe.id);return m.jsx(Gc,{active:Ee!==null&&au(Ee,fe),label:ie?ie.title||ie.slug:"…",icon:fe.view==="terminal"?m.jsx(YS,{size:12,style:{flexShrink:0}}):m.jsx($u,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>re(fe)},`${fe.id}:${fe.view}`)}),x.map(fe=>m.jsx(Gc,{active:Ce!==null&&ou(Ce,fe),label:fe.path.split("/").pop()||fe.path,icon:m.jsx(US,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>Z(fe)},`file:${BS(fe)}`)),E.map(fe=>m.jsx(Gc,{active:rt!==null&&rt.promptId===fe.promptId,label:"Plan",icon:m.jsx(VS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(fe),onClose:()=>ee(fe)},`plan:${fe.promptId}`)),N&&m.jsx(Gc,{active:bt,label:"Code",icon:m.jsx(GS,{size:12,style:{flexShrink:0}}),onSelect:()=>C(N),onClose:he},"code")]}),m.jsxs("div",{className:"panel-controls",children:[m.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>z(fe=>!fe),children:B?m.jsx(dN,{size:14}):m.jsx(hN,{size:14})}),m.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),z(!1)},children:m.jsx(Fo,{size:14})})]})]}),w==="experiments"?m.jsxs("div",{className:"tab-body",children:[m.jsx("div",{className:"pane-toolbar",children:m.jsxs("div",{className:"seg",children:[m.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),m.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),m.jsx("div",{className:"pane-content",children:p==="tree"?Ge&&m.jsx(qP,{experiments:a,runs:u,project:Ge,onOpenView:Q,onOpenCodeBranch:ne}):m.jsx(NB,{runs:u,experiments:a,onOpen:fe=>{v(fe.id),Q(fe.experimentId,"terminal")},onOpenChanges:fe=>Q(fe,"changes"),onCancel:fe=>void XS(fe).catch(()=>{})})})]}):Ce?m.jsx("div",{className:"tab-body",children:n&&m.jsx(mB,{projectId:n,path:Ce.path,sessionId:Ce.sessionId,gitRef:Ce.ref,onOpenFile:ae},BS(Ce))}):rt?m.jsx("div",{className:"tab-body",children:m.jsx("div",{className:"pane-content plan-tab-content",children:m.jsx(qo,{text:rt.plan,onOpenFile:fe=>ae(fe,rt.sessionId)})})}):bt?m.jsx("div",{className:"tab-body",children:n&&Ge&&N&&m.jsx(ML,{projectId:n,project:Ge,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:fe=>ge({sel:fe}),onToggledChange:fe=>ge({toggled:fe}),onOpenFile:ae},"code")}):m.jsx("div",{className:"tab-body",children:Ee&&ct&&Ge&&m.jsx(fB,{experiment:ct,project:Ge,view:Ee.view,runs:u,selectedRunId:_,onSelectRun:v},`${Ee.id}:${Ee.view}`)})]})]})})}gA.createRoot(document.getElementById("root")).render(m.jsx(V.StrictMode,{children:m.jsx(JP,{})})); diff --git a/ui/dist/assets/index-Dj5p3Wr0.css b/ui/dist/assets/index-Dj5p3Wr0.css deleted file mode 100644 index da3530d..0000000 --- a/ui/dist/assets/index-Dj5p3Wr0.css +++ /dev/null @@ -1,32 +0,0 @@ -:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:0;padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.home-brand{font-weight:800;font-size:28px;letter-spacing:-.02em;margin-bottom:36px}.home-brand span{color:var(--primary)}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:18px;letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:6px;color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:600;font-size:14px}.project-card .repo{color:var(--subtext)}.project-card .paper,.project-card .time{font-size:11px;color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:4px 6px 4px 0;border-radius:6px}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:12px;font-weight:600;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--subtext)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:11px;border-radius:6px}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--subtext);text-transform:capitalize;white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:10px;box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:12.5px;color:var(--subtext);border-radius:8px;text-align:left}.rail-nav-item:hover{background:var(--surface);color:var(--text)}.rail-nav-item.active{background:var(--panel);color:var(--text);font-weight:600}.rail-section-label{padding:10px 10px 6px;font-size:12px;font-weight:500;color:var(--muted)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:6px}.rail-empty{padding:6px 10px;font-size:12px;color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px;white-space:nowrap;flex-shrink:0}.tab:hover{color:var(--text)}.tab.active{color:var(--text);background:var(--surface)}.tab .tab-count{font-family:var(--mono);font-weight:400;color:var(--muted)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);color:var(--text);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:13px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:8px;font-size:12.5px;color:var(--subtext);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface);color:var(--text)}.session-row.active{color:var(--text);background:var(--surface);font-weight:500}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:10px;font-family:var(--mono);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:5px;color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:5px;outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--subtext);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:34px;font-weight:700;letter-spacing:-.02em;color:var(--text)}.chat-empty h2 span{color:var(--primary)}.chat-empty .chat-empty-hint{font-size:12px;color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:13px;max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:12px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:13px;white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:4px;display:block}.msg-assistant{font-size:14px;line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:12px;margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:600}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:12.5px;text-align:left;border-radius:6px}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:5px}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--subtext)}.tool-open{flex-shrink:0;font-size:11px;color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--text);background:var(--surface);border-radius:5px;white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:5px}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:13px;min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:6px;display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:600}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:8px;padding:8px 12px;overflow-x:auto;font-size:12px;color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--text);background:var(--panel);border:1px solid var(--border-variant);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:400}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:6px;opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:600;margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:13px;margin:10px 0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:500;color:var(--subtext);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:12.5px;transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--subtext);font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);font-family:var(--mono);text-transform:uppercase;letter-spacing:.05em}.exp-node .baseline-chip{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border);padding:0 4px;flex-shrink:0}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:10.5px;font-weight:700;color:var(--subtext);border-radius:6px;text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--base);border:1px solid var(--border);border-radius:10px;overflow:hidden}.runs-table th{text-align:left;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:11.5px}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--canvas);border:1px solid var(--border);font-size:11px;font-weight:500;letter-spacing:0;color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:10px;background:var(--base);color:var(--subtext);font-size:12.5px}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:500}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.status-chip{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-family:var(--mono)}.status-chip .dot{width:8px;height:8px;border-radius:50%}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:12.5px}.kv .k{color:var(--muted)}.kv .v{font-family:var(--mono);font-size:11.5px;word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:11.5px;color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:#1a1a1a;padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:12.5px;color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:12px;font-weight:600}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12px;border-radius:6px}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:600}.history-item .when{margin-left:auto;font-size:11px;color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:11.5px;color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:13px;line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:18px;font-weight:400;color:var(--text)}.empty-state p.empty-state-hint{font-size:15px;color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:14px}.onb-eyebrow span{color:var(--primary)}.onb-title{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}.onb-sub{color:var(--subtext);font-size:13.5px;line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:10px;padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:600;font-size:14px}.onb-card-detail{font-size:12px}.onb-card-meta{font-size:12px;color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:11px}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:13px;padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--subtext)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--border-variant);border-radius:5px;padding:3px 8px}.onb-gh-hint{font-size:12px;color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:11px}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:12px}.onb-token-form a{font-size:12px;color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:12.5px;white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:400;text-transform:none;letter-spacing:normal;font-size:11px;color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:12.5px;font-weight:500}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:11px;color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:13px;font-weight:600}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--subtext);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.report-view .error,.settings-card>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:16px}:is(.modal,.home) :is(input,select,textarea){border-radius:8px}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:4px 0}.settings-note{margin:10px 0 0;font-size:12px;padding:8px 10px;border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:600}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:var(--mono);text-transform:uppercase;letter-spacing:.06em;padding:1px 7px;border:1px solid var(--border);color:var(--muted)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;overflow-y:auto;padding:20px 24px 48px}.files-col{max-width:var(--readable-col);margin:0 auto;display:flex;flex-direction:column;gap:10px}.files-meta{display:flex;gap:8px;flex-wrap:wrap}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.files-pill-dir{flex:1;min-width:240px}.files-pill-dir code{flex:1;color:var(--subtext)}.files-pill-dir .icon-btn{width:22px;height:22px;margin:-4px -6px -4px 0}button.files-pill-link{cursor:pointer;font:inherit;font-size:12px;color:var(--muted);white-space:nowrap}button.files-pill-link:hover{border-color:var(--muted);color:var(--text)}.files-hint{margin:0;font-size:11.5px;line-height:1.5;color:var(--muted)}.files-hint code{font-family:var(--mono);font-size:10.5px}.files-card{border:1px solid var(--border);border-radius:10px;background:var(--base);overflow:hidden;margin-top:4px}.files-card>*+*{border-top:1px solid var(--border-variant)}.ftree-row{display:flex;align-items:center;gap:8px;padding:8px 14px}.ftree-row.clickable{cursor:pointer}.ftree-row:hover{background:var(--surface)}.ftree-children{background:var(--canvas);border-top:1px solid var(--border-variant)}.ftree-children .ftree-row:hover{background:var(--panel)}.ftree-chevron{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ftree-chevron.open{transform:rotate(90deg)}.ftree-chevron.spacer{visibility:hidden}.ftree-dirname{flex:1;min-width:0;font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-title{flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-tag{flex-shrink:0;font-size:11px;color:var(--primary)}.ftree-status{flex-shrink:0;font-family:var(--mono);font-size:10.5px;color:var(--subtext)}.ftree-link{flex:1;min-width:0;display:flex;align-items:center;gap:8px;color:var(--text);text-decoration:none}.ftree-link:hover .ftree-name{text-decoration:underline}.ftree-name{min-width:0;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-thumb{width:22px;height:22px;object-fit:cover;border-radius:4px;border:1px solid var(--border-variant);flex-shrink:0}.ftree-del{width:22px;height:22px;visibility:hidden}.ftree-row:hover .ftree-del{visibility:visible}.ftree-del:hover{color:var(--accent-red)}.ftree-date,.ftree-size{flex-shrink:0}.ftree-size{font-family:var(--mono);font-size:10.5px;color:var(--muted);white-space:nowrap}.ftree-divider{padding:10px 14px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.files-empty{font-size:12.5px;line-height:1.55;color:var(--subtext);border:1px solid var(--border);border-radius:10px;background:var(--base);padding:18px;margin:4px 0 0}.files-empty code{font-family:var(--mono);font-size:11.5px}.files-truncated{margin:0;padding:8px 14px;font-size:11px;color:var(--muted)}.report-date,.ftree-date{font-size:11px;color:var(--muted);white-space:nowrap}.report-view{height:100%;overflow-y:auto;padding:16px 24px 48px}.report-view-col{max-width:var(--readable-col);margin:0 auto}.report-view-head{display:flex;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--border-variant)}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:11.5px;color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:8px;background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:8px 8px 0 0}.diff-file-header .chev{color:var(--muted);font-size:10px;flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.7rem;font-weight:700;color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:.65rem;font-weight:700;font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:12.5px}.truncated-notice{border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);padding:12px 14px;font-size:12.5px}.truncated-notice h4{margin:0 0 4px;font-size:13px;color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:12px;line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.report-back{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--subtext);padding:4px 8px;border-radius:6px}.report-back:hover{color:var(--text);background:var(--surface)}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:22px}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--subtext);font-size:13px}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:12.5px;margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:10px}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:10px}.compute-row.open .compute-row-head:hover{border-radius:10px 10px 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:13px;font-weight:600;color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:6px}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:12px}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:12px;color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:13px;font-weight:600;color:var(--subtext);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{color:var(--text);border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:12.5px}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:500;color:var(--muted)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:11px}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:11.5px;color:var(--subtext);padding:5px 8px;border-radius:6px}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--subtext);padding:5px 4px;border-radius:6px}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:400}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:12.5px;outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12.5px;border-radius:6px}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:10px;color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:11px;color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:6px}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-family:var(--mono);font-size:12px}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:11px;color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--border-variant);border-radius:6px;padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:12px;line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:12px;color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:13.5px}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:6px;background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.prompt-head code{font-family:var(--mono);font-size:11.5px;text-transform:none;color:var(--text)}.prompt-sub{font-family:var(--mono);font-size:12px;color:var(--subtext);word-break:break-word}.prompt-q{font-size:14px;font-weight:600;line-height:1.5;color:var(--text)}.prompt-plan{font-size:13.5px;line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:5px;background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:13px;font-weight:600}.prompt-option-desc{display:block;font-size:12px;font-weight:400;line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:5px;cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:13px;margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:600;word-break:break-word}.prompt-outcome{font-size:12px;color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:13px;color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:600}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:8px;background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:12.5px;cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:8px;padding:9px 11px;font-size:13px;font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:13px;font-weight:600;white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:5px;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:12px;padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:12px}.code-tab-note{padding:8px 16px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:12.5px}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} From c3f7305ed91180bdd8180b5029db9ecf6381c5e7 Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 17:07:38 -0700 Subject: [PATCH 5/7] agent-skills: trigger-rich descriptions with explicit liberal 'Use when' cues Descriptions are the model's trigger surface; err toward false-positive loads. Bound raised 150 -> 400 chars (Codex ambient budget is ~8k across the set). --- agent-skills/orx-compute-k8s/SKILL.md | 2 +- agent-skills/orx-compute/SKILL.md | 2 +- agent-skills/orx-create/SKILL.md | 2 +- agent-skills/orx-evidence/SKILL.local.md | 2 +- agent-skills/orx-evidence/SKILL.md | 2 +- agent-skills/orx-experiment-tree/SKILL.md | 2 +- agent-skills/orx-git/SKILL.md | 2 +- agent-skills/orx-lit/SKILL.md | 2 +- agent-skills/orx-reports/SKILL.local.md | 2 +- agent-skills/orx-reports/SKILL.md | 2 +- src/local/agent_skills.rs | 31 +++++++++++++---------- 11 files changed, 27 insertions(+), 24 deletions(-) diff --git a/agent-skills/orx-compute-k8s/SKILL.md b/agent-skills/orx-compute-k8s/SKILL.md index 3205a5f..49005b0 100644 --- a/agent-skills/orx-compute-k8s/SKILL.md +++ b/agent-skills/orx-compute-k8s/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-compute-k8s -description: "Run an experiment on your Kubernetes cluster (`orx exp run --backend k8s`): the manifest contract orx enforces at submit." +description: "Run an experiment on your own Kubernetes cluster (`orx exp run --backend k8s`): the committed-manifest contract orx enforces at submit. Use when the user names k8s, kubernetes, or a cluster, before writing or editing `.orx/k8s.yaml`, for multi-node or Indexed Jobs, or when a k8s submit is rejected." --- **Use `--backend k8s` ONLY when the user explicitly asks to run on their diff --git a/agent-skills/orx-compute/SKILL.md b/agent-skills/orx-compute/SKILL.md index ae23328..a7640f7 100644 --- a/agent-skills/orx-compute/SKILL.md +++ b/agent-skills/orx-compute/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-compute -description: "Launch experiment runs on compute with `orx exp run`: managed GPU/CPU, hf/modal/ssh/local backends, sizing, and waiting on runs." +description: "Launch experiment runs with `orx exp run`: backends (hf, modal, k8s, ssh, slurm, openresearch, local), flavors, timeouts, images, sizing, and `orx exp wait`. Use before launching or re-launching any run, when choosing or switching a backend or GPU flavor, when a job OOMs, stalls, or times out, or when deciding GPU vs CPU." --- Each experiment node has a **run command** (the shell command that trains/evaluates diff --git a/agent-skills/orx-create/SKILL.md b/agent-skills/orx-create/SKILL.md index 40af59b..df04ccb 100644 --- a/agent-skills/orx-create/SKILL.md +++ b/agent-skills/orx-create/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-create -description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`)." +description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`). Use when starting any new project or experiment, when the tree is empty, or when unsure how to bind a repo or set the run command." --- ## `orx create-project` — start a new project diff --git a/agent-skills/orx-evidence/SKILL.local.md b/agent-skills/orx-evidence/SKILL.local.md index a51e795..54c71c6 100644 --- a/agent-skills/orx-evidence/SKILL.local.md +++ b/agent-skills/orx-evidence/SKILL.local.md @@ -1,6 +1,6 @@ --- name: orx-evidence -description: "Analyze results in local mode: run logs are the only channel (`orx logs`) — make the run print the evidence you'll need." +description: "Analyze run results in local mode: run logs are the only evidence channel (`orx logs`). Use after any run reaches a terminal state, before declaring a run a success or failure, when metrics are missing from output, or when designing what a run command should print." --- In local mode (`orx up`) run **logs are the only evidence channel** — there is no diff --git a/agent-skills/orx-evidence/SKILL.md b/agent-skills/orx-evidence/SKILL.md index 5b61fdc..a745b71 100644 --- a/agent-skills/orx-evidence/SKILL.md +++ b/agent-skills/orx-evidence/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-evidence -description: "Analyze results: run logs, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB." +description: "Analyze run results: `orx logs`, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB. Use after any run finishes, when comparing metrics across runs or experiments, when hunting a failure in logs, or when asked for numbers, tables, or charts." --- ## Reading & searching run logs — `orx logs` / `orx search-logs` diff --git a/agent-skills/orx-experiment-tree/SKILL.md b/agent-skills/orx-experiment-tree/SKILL.md index 89dedc9..e1a36e5 100644 --- a/agent-skills/orx-experiment-tree/SKILL.md +++ b/agent-skills/orx-experiment-tree/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-experiment-tree -description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc`." +description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc` notes. Use before creating, planning, or reorganizing experiments, when deciding what to try next, when a round of runs finishes, or whenever you're unsure how work maps onto the tree." --- A project is a **tree of experiment nodes**. The root (**baseline**) holds the diff --git a/agent-skills/orx-git/SKILL.md b/agent-skills/orx-git/SKILL.md index 0f9091b..682fa90 100644 --- a/agent-skills/orx-git/SKILL.md +++ b/agent-skills/orx-git/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-git -description: "Read, edit, and diff a node's code with plain git in the cache-dir clone (or your session worktree): sync, commit, push before running." +description: "Read, edit, and diff a node's code with plain git: sync, commit, and push before running. Use whenever you touch experiment code — before editing any branch, when a checkout or push fails, when comparing two nodes' code, or when a run seems to have picked up stale code." --- Every experiment node **is a git branch** (`orx/<slug>`) on the project's GitHub diff --git a/agent-skills/orx-lit/SKILL.md b/agent-skills/orx-lit/SKILL.md index d5a0a09..4154eb7 100644 --- a/agent-skills/orx-lit/SKILL.md +++ b/agent-skills/orx-lit/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-lit -description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`) — ground hypotheses and find code to seed a baseline from." +description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`). Use when grounding a hypothesis, hunting related work, baselines, or code to seed from, when the user mentions a paper, author, or arXiv id, or before designing a novel experiment." --- These tap **alphaXiv's public corpus** (2.5M+ arXiv papers: CS, math, physics, diff --git a/agent-skills/orx-reports/SKILL.local.md b/agent-skills/orx-reports/SKILL.local.md index 61849f9..9397184 100644 --- a/agent-skills/orx-reports/SKILL.local.md +++ b/agent-skills/orx-reports/SKILL.local.md @@ -1,6 +1,6 @@ --- name: orx-reports -description: "Write research reports into the local project's files dir (tree-mirroring folder layout) — they appear in the dashboard's Files tab." +description: "Write research reports into the local project's files dir (tree-mirroring folder layout) so they appear in the dashboard's Files tab. Use when a line of work concludes, when the user asks for a write-up, summary, comparison, or figures, or before ending a long task — findings not written down are lost." --- In local mode (`orx up`), reports are written **directly into the project's files diff --git a/agent-skills/orx-reports/SKILL.md b/agent-skills/orx-reports/SKILL.md index dc6a94f..b4d9a21 100644 --- a/agent-skills/orx-reports/SKILL.md +++ b/agent-skills/orx-reports/SKILL.md @@ -1,6 +1,6 @@ --- name: orx-reports -description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page." +description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page. Use when a line of work concludes, when the user asks for a write-up, summary, comparison, or figures, or before ending a long task — findings not written down are lost." --- When a line of work concludes, write up the experiment tree as a local markdown diff --git a/src/local/agent_skills.rs b/src/local/agent_skills.rs index 86e0063..604a240 100644 --- a/src/local/agent_skills.rs +++ b/src/local/agent_skills.rs @@ -63,57 +63,60 @@ const REPORTS_CLOUD: &str = include_str!("../../agent-skills/orx-reports/SKILL.m const EVIDENCE_LOCAL: &str = include_str!("../../agent-skills/orx-evidence/SKILL.local.md"); const EVIDENCE_CLOUD: &str = include_str!("../../agent-skills/orx-evidence/SKILL.md"); -// Descriptions are ≤150 chars (Codex's ambient skill budget is tight): one line, -// no leading `orx-`, phrased so an agent knows when to load the module. +// Descriptions are the *trigger surface*: what the module covers plus explicit, +// liberal "Use when …" cues (false positives beat false negatives — an agent +// that loads a module needlessly wastes a little context; one that misses it +// works blind). Keep each ≤400 chars — Codex's ambient budget is ~8k across +// the whole set. const S_COMPUTE: AgentSkill = AgentSkill { name: "orx-compute", - description: "Launch experiment runs on compute with `orx exp run`: managed GPU/CPU, hf/modal/ssh/local backends, sizing, and waiting on runs.", + description: "Launch experiment runs with `orx exp run`: backends (hf, modal, k8s, ssh, slurm, openresearch, local), flavors, timeouts, images, sizing, and `orx exp wait`. Use before launching or re-launching any run, when choosing or switching a backend or GPU flavor, when a job OOMs, stalls, or times out, or when deciding GPU vs CPU.", content: COMPUTE, }; const S_COMPUTE_K8S: AgentSkill = AgentSkill { name: "orx-compute-k8s", - description: "Run an experiment on your Kubernetes cluster (`orx exp run --backend k8s`): the manifest contract orx enforces at submit.", + description: "Run an experiment on your own Kubernetes cluster (`orx exp run --backend k8s`): the committed-manifest contract orx enforces at submit. Use when the user names k8s, kubernetes, or a cluster, before writing or editing `.orx/k8s.yaml`, for multi-node or Indexed Jobs, or when a k8s submit is rejected.", content: COMPUTE_K8S, }; const S_EXPERIMENT_TREE: AgentSkill = AgentSkill { name: "orx-experiment-tree", - description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc`.", + description: "The experiment-tree model and the auto-research loop: shape the tree (stacked bushes), branch/launch/wait/promote, and `orx exp desc` notes. Use before creating, planning, or reorganizing experiments, when deciding what to try next, when a round of runs finishes, or whenever you're unsure how work maps onto the tree.", content: EXPERIMENT_TREE, }; const S_GIT: AgentSkill = AgentSkill { name: "orx-git", - description: "Read, edit, and diff a node's code with plain git in the cache-dir clone (or your session worktree): sync, commit, push before running.", + description: "Read, edit, and diff a node's code with plain git: sync, commit, and push before running. Use whenever you touch experiment code — before editing any branch, when a checkout or push fails, when comparing two nodes' code, or when a run seems to have picked up stale code.", content: GIT_EDITING, }; const S_LIT: AgentSkill = AgentSkill { name: "orx-lit", - description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`) — ground hypotheses and find code to seed a baseline from.", + description: "Search literature and read papers via alphaXiv (`orx lit` / `orx paper`). Use when grounding a hypothesis, hunting related work, baselines, or code to seed from, when the user mentions a paper, author, or arXiv id, or before designing a novel experiment.", content: LIT, }; const S_CREATE: AgentSkill = AgentSkill { name: "orx-create", - description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`).", + description: "Create a project (`orx create-project`), seed an empty baseline from existing code, and add experiment nodes (`orx create-experiment`). Use when starting any new project or experiment, when the tree is empty, or when unsure how to bind a repo or set the run command.", content: CREATE, }; const S_REPORTS_LOCAL: AgentSkill = AgentSkill { name: "orx-reports", - description: "Write research reports into the local project's files dir (tree-mirroring folder layout) — they appear in the dashboard's Files tab.", + description: "Write research reports into the local project's files dir (tree-mirroring folder layout) so they appear in the dashboard's Files tab. Use when a line of work concludes, when the user asks for a write-up, summary, comparison, or figures, or before ending a long task — findings not written down are lost.", content: REPORTS_LOCAL, }; const S_REPORTS_CLOUD: AgentSkill = AgentSkill { name: "orx-reports", - description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page.", + description: "Write a research report and publish it with `orx report upload` (list/show/download too) so it appears on the project page. Use when a line of work concludes, when the user asks for a write-up, summary, comparison, or figures, or before ending a long task — findings not written down are lost.", content: REPORTS_CLOUD, }; const S_EVIDENCE_LOCAL: AgentSkill = AgentSkill { name: "orx-evidence", - description: "Analyze results in local mode: run logs are the only channel (`orx logs`) — make the run print the evidence you'll need.", + description: "Analyze run results in local mode: run logs are the only evidence channel (`orx logs`). Use after any run reaches a terminal state, before declaring a run a success or failure, when metrics are missing from output, or when designing what a run command should print.", content: EVIDENCE_LOCAL, }; const S_EVIDENCE_CLOUD: AgentSkill = AgentSkill { name: "orx-evidence", - description: "Analyze results: run logs, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB.", + description: "Analyze run results: `orx logs`, `orx search-logs`, text artifacts, W&B charts (`orx chart wandb`), and the `orx query` evidence DB. Use after any run finishes, when comparing metrics across runs or experiments, when hunting a failure in logs, or when asked for numbers, tables, or charts.", content: EVIDENCE_CLOUD, }; @@ -219,8 +222,8 @@ mod tests { for s in skills(set) { let len = s.description.chars().count(); assert!( - (1..=150).contains(&len), - "{:?}: {} description is {} chars (want 1..=150)", + (1..=400).contains(&len), + "{:?}: {} description is {} chars (want 1..=400)", set, s.name, len From adf23a740a95fa25cf939a57bc7123e81c7e6db3 Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 17:20:02 -0700 Subject: [PATCH 6/7] Playbook: dedupe against skills + extract to literal SYSTEM_PROMPT.md The system prompt is now a GitHub-readable template at repo root; playbook_md strips the leading doc comment and substitutes {tokens} (project facts, compute default, skills index). Content duplicated by the installed skills is trimmed to pointers: the five per-backend exp-run table rows collapse to one, the loop keeps only its skeleton, and the sizing/analysis sections fold into one-liners. The prompt now explicitly tells the agent to load the relevant skill before acting in its area (long-horizon staleness guard). Placeholder test extended to all ten tokens + comment-stripping. --- SYSTEM_PROMPT.md | 205 +++++++++++++++++++++++++++++++ src/local/opencode.rs | 272 +++++++----------------------------------- 2 files changed, 247 insertions(+), 230 deletions(-) create mode 100644 SYSTEM_PROMPT.md diff --git a/SYSTEM_PROMPT.md b/SYSTEM_PROMPT.md new file mode 100644 index 0000000..a85f892 --- /dev/null +++ b/SYSTEM_PROMPT.md @@ -0,0 +1,205 @@ +<!-- +This is the system prompt ("playbook") that `orx up` injects into every local +agent session, verbatim except for `{token}` substitution at render time +(project facts, the compute default, and the skills index — see +`playbook_md()` in src/local/opencode.rs). Each harness receives it through +its native channel: Claude Code via --append-system-prompt-file, Codex via +developerInstructions, OpenCode via the config `instructions` list. + +It carries only what must be in context every turn: identity, the cardinal +rules, session-collaboration rules, the command index, and the loop skeleton. +Everything topical lives in the native skills installed into the session +worktree from agent-skills/ — the prompt points at them instead of repeating +them. This leading comment is stripped at render time. +--> + +# OpenResearch local agent — {name} + +You are the OpenResearch research agent for the **local** project **{name}**, +running inside `orx up` on the user's own machine. Your working directory is +**your own git worktree** of the project's repo — private to this chat +session. Other chat sessions (other agents) work in sibling worktrees of the +same clone, sharing its branches and remotes. + +- Project id: `{id}` +- GitHub repo: `{repo}` +- Baseline branch: `{baseline}` +{paper_line}{compute_bullet} +- Files dir: `{files}` — every file in it shows up in the dashboard's + Files tab (reports, figures, CSVs), grouped by experiment + +## Start here + +Drive everything through the `orx` CLI. `orx` is the source of truth for the +experiment tree, runs, and logs — not the filesystem. This is **local mode**: +only the commands listed below exist; use this project id (`{id}`) for every +`orx` command that takes one. + +Orient with `orx projects` and `orx runs {id}`. + +**If the experiment tree is empty** (a fresh project), create the baseline +first: `orx create-experiment {id} --title "Baseline"` (no `--parent`). Give it +the run command, run it once for reference numbers, then branch children off it. + +## Skills + +Focused how-to guides are installed as **native skills for this session** — your +harness auto-loads them, and you can pull one up by name when a task calls for it: + +{skills_list} + +The cardinal rules, command index, and loop below are always in effect; the +skills carry the details (per-backend flags and sizing, the k8s manifest, tree +shaping, git recipes, log analysis, report layout). **Load the relevant skill +before acting in its area** — commands remembered from earlier in a long +session go stale; the skill is always current. If your harness hasn't surfaced +one, `orx skill <name>` prints it. + +## Working alongside other agents + +Several chat sessions may drive this project at once, each in its own worktree +of the same clone. Git state is shared between you: + +- **See their work before starting yours.** Local and remote branches are + shared across worktrees — `git branch -a` lists every experiment branch + (even unpushed ones), `orx runs {id}` shows what is running, and + `orx exp desc <expId>` holds each node's findings. Orient from these so you + extend the tree instead of duplicating a sibling's experiment. +- **Keep your notes current as you go.** Other agents orient from + `orx exp desc` — write findings there when you learn them, not only at the + end of a line of work. +- **One branch, one owner.** Git refuses to check out a branch that another + worktree already has checked out. If `git checkout <branch>` fails that + way, another agent owns that experiment — leave it alone and work on your + own node. +- Your worktree starts **detached on the baseline tip**; check out your + experiment's branch before editing. + +## Cardinal rules + +Breaking any of these silently invalidates results — they are not style +preferences. + +1. **Never edit a baseline (root experiment) once it exists.** A root is the + control its variants are measured against — on a fresh project you create + it (first `orx create-experiment`, no `--parent`), and from then on it is + frozen. To try an idea, **branch a child** + (`orx create-experiment … --parent <expId>`) and edit the child's branch. +2. **The run command and the environment are a fixed contract — identical on + every node.** Children inherit it verbatim. If the project has no run + command, set the default once with `orx project edit {id} --run-command + '<cmd>'` (or pass `--run-command` when creating the first experiment) — + children inherit it from then on. Never vary behavior through env vars or + env-prefixed commands. +3. **Vary code, not knobs-in-the-command.** Encode hyperparameters in committed + code/config and branch a child per variant. Every node runs the *same* + command over *different code*, so results stay comparable. +4. **Grow the tree downward, not sideways.** Fan a few siblings *within* a + round (the options of one decision), then **descend onto the winner** for + the next round. A root with a long flat row of children is the failure mode. +5. **Launch all compute via `orx exp run` — never `hf jobs`, `modal`, `kubectl`, raw `ssh`, or a training command in your own shell.** Direct jobs are unsupervised and invisible to the dashboard. + +## Command index (local mode) + +| Command | What it does | +|---|---| +| `orx projects` | List projects; local ones are tagged `(local)`. | +| `orx create-experiment {id} --title "<t>" [--description "<d>"] [--parent <expId> \| --baseline] [--run-command "<cmd>"]` | New node on its own `orx/<slug>` branch, pushed to GitHub — forked off the parent's tip, or off `{baseline}` for a root. Omit `--parent` to attach under the oldest root (or become the baseline on an empty project). | +| `orx project view {id}` / `orx project edit {id} --run-command "<cmd>"` | Inspect the project / set its default run command. | +| `orx exp status <expId>` | Node's branch, command, and latest run. | +| `orx exp desc <expId> [--set "<text>" \| --stdin]` | Read/overwrite the node's notes. Record findings here. | +| `orx exp run <expId> [--backend <hf\|modal\|k8s\|ssh\|slurm\|openresearch\|local>] [flags]` | Launch the node's run. Backend-specific flags, flavors, and sizing: **`orx-compute` skill** (k8s manifest: **`orx-compute-k8s`**). | +| `orx exp cancel <expId>` | Cancel the in-flight run. | +| `orx exp wait <expId> [--timeout <s>]` / `orx exp wait --project {id}` | Poll until a run reaches a terminal state. Exits **non-zero** after `--timeout` seconds (default 1800) with nothing changed — that means "still running", not an error. | +| `orx runs {id} [--experiment <expId>]` | Run table, newest first. Run ids come from here. | +| `orx logs <runId> [--head] [--bytes <n>] [--range <s>:<e>]` | Read a run's log (tail by default). | + +NOT available in local mode: `experiments`, `artifacts`, `artifact`, `query`, +`chart`, `env`, `search-logs`, `wandb`, `exp cmd`, `report`. Do not reach for +them — analysis happens through `orx logs`. + +`orx lit "<query>"` and `orx paper <id|url>` (literature search) still work — +they hit public hosts and need no login. + +## The auto-research loop + +Carry one goal across many runs (full guidance: **`orx-experiment-tree`** skill): + +0. **Baseline** (empty project only): create it, set the run command, run once + for reference numbers. +1. **Branch**: `orx create-experiment {id} --title "<idea>" --parent <parentId>` + — one child per distinct thing you try. +2. **Edit** in this worktree: `git fetch origin && git checkout <branch>`, change + the code, commit, `git push` — the job clones from GitHub, so **unpushed + work never runs** (recipes: **`orx-git`** skill). +{launch_step} +4. **Wait — hold your turn open**: call `orx exp wait <expId> --timeout 480` + (or `--project` when several are in flight) in a loop. Exit 0 → terminal, go + analyze; non-zero → immediately call it again. +5. **Analyze**: `orx logs <runId>`. Logs are the only evidence channel — make + the run command print every metric you'll need (**`orx-evidence`** skill). +6. **Decide**: refill the round with another sibling, promote the winner and + descend, or stop and report. Write what you learned into `orx exp desc`. + +When a line of work concludes (or the user asks for a write-up), write a report +**directly into the files dir** (`{files}`) — no upload step; anything under it +appears in the dashboard's Files tab immediately. Layout and structure: +**`orx-reports`** skill. + +When the user gives you a research task, see it through this loop — don't stop +after a single step or hand back a half-finished attempt. End your turn only +when the task is achieved, genuinely blocked on a decision only the user can +make, or the approach is exhausted. (For a plain question, just answer it.) + +## Staying online while runs execute + +Nothing re-invokes you when a run finishes, and there are no background +monitors — any process you background dies when your turn ends, so "I'll keep +watching the run" is not something you can do. While a run you launched is in +flight, the wait loop above IS your job: stay in it, and end your turn only +once you've read the result and acted on it. (If your turn does end early, +the dashboard injects an `[orx]` message when a run completes — treat it as +the wake-up to reconcile and continue the loop.) + +## Referencing files + +When you point the reader at a repo source file in chat, wrap it so they can +open it in the dashboard's file viewer: `<file path="relative/path.py" />`, or +with a line target `<file path="relative/path.py" lines="20-40" />`. Use +repo-relative paths (from the worktree root), not absolute paths. Reach for this +whenever you'd otherwise write a bare file path or a markdown link to a file — +the file you edited, the entrypoint you're describing, the config you changed. + +## Where runs execute + +**Never train or evaluate directly in your shell or worktree.** Your worktree +is the edit box: git, reading and writing code, and `orx` orchestration happen +here. The run itself — anything that trains, evaluates, or produces results — +always goes through `orx exp run`: a raw `python train.py` in your shell is +unsupervised, invisible to the dashboard, runs whatever happens to be in your +checkout instead of the branch tip, and blocks your turn. (`--backend local` +runs on this machine but still goes through that contract — supervised and +visible; prefer it only for small or CPU-scale runs.) + +## Compute backends + +{backends_intro} +All backends share one contract — the job clones the experiment branch's GitHub +tip and runs the fixed run command; `orx exp wait` / `orx runs` / `orx logs` / +`orx exp cancel` work identically everywhere, and a detached `orx supervise` +mirrors status and logs (don't kill it). **Before launching on a backend you +haven't used this session, load the `orx-compute` skill** (flavors, flags, +timeouts, GPU-vs-CPU sizing); k8s additionally needs the **`orx-compute-k8s`** +manifest contract. + +## Asking the user + +Interactive prompt tools surface as cards in the chat UI — they do not hang. +If your harness provides a question tool (e.g. AskUserQuestion), use it for +decisions with concrete options; otherwise ask in normal text and **end your +turn**, and the user replies in their next message. + +**Plan mode:** always present your finished plan by calling the ExitPlanMode +tool — never as plain chat text. The plan card is how the user approves the +plan and unlocks execution; a plan left in chat text strands the session in +plan mode. diff --git a/src/local/opencode.rs b/src/local/opencode.rs index fa04803..2c5870b 100644 --- a/src/local/opencode.rs +++ b/src/local/opencode.rs @@ -103,6 +103,12 @@ fn opencode_config_json(model: Option<&str>, instructions: &str) -> String { /// `autoresearchMd()`/`projectContextMd()` prompts, adapted for `orx up` /// (external backends via `--backend`, analysis via `orx logs`, no /// artifacts/query/chart). +/// The playbook template — a literal, GitHub-readable markdown file. Rendered +/// by [`playbook_md`]: the leading HTML comment is stripped and `{token}` +/// placeholders are substituted (project facts, the compute default, the +/// skills index). +const SYSTEM_PROMPT: &str = include_str!("../../SYSTEM_PROMPT.md"); + fn playbook_md(project: &LocalProject) -> String { let id = &project.id; let name = &project.name; @@ -196,232 +202,21 @@ fn playbook_md(project: &LocalProject) -> String { .map(|s| format!("- **{}** — {}", s.name, s.description)) .collect::<Vec<_>>() .join("\n"); - format!( - r#"# OpenResearch local agent — {name} - -You are the OpenResearch research agent for the **local** project **{name}**, -running inside `orx up` on the user's own machine. Your working directory is -**your own git worktree** of the project's repo — private to this chat -session. Other chat sessions (other agents) work in sibling worktrees of the -same clone, sharing its branches and remotes. - -- Project id: `{id}` -- GitHub repo: `{repo}` -- Baseline branch: `{baseline}` -{paper_line}{compute_bullet} -- Files dir: `{files}` — every file in it shows up in the dashboard's - Files tab (reports, figures, CSVs), grouped by experiment - -## Start here - -Drive everything through the `orx` CLI. `orx` is the source of truth for the -experiment tree, runs, and logs — not the filesystem. This is **local mode**: -only the commands listed below exist; use this project id (`{id}`) for every -`orx` command that takes one. - -Orient with `orx projects` and `orx runs {id}`. - -**If the experiment tree is empty** (a fresh project), create the baseline -first: `orx create-experiment {id} --title "Baseline"` (no `--parent`). Give it -the run command, run it once for reference numbers, then branch children off it. - -## Skills - -Focused how-to guides are installed as **native skills for this session** — your -harness auto-loads them, and you can pull one up by name when a task calls for it: - -{skills_list} - -The cardinal rules, command surface, and auto-research loop below are always in -effect; the skills expand the details (backend specifics, the k8s manifest, git -recipes, report layout) so you load them only when you need them. - -## Working alongside other agents - -Several chat sessions may drive this project at once, each in its own worktree -of the same clone. Git state is shared between you: - -- **See their work before starting yours.** Local and remote branches are - shared across worktrees — `git branch -a` lists every experiment branch - (even unpushed ones), `orx runs {id}` shows what is running, and - `orx exp desc <expId>` holds each node's findings. Orient from these so you - extend the tree instead of duplicating a sibling's experiment. -- **Keep your notes current as you go.** Other agents orient from - `orx exp desc` — write findings there when you learn them, not only at the - end of a line of work. -- **One branch, one owner.** Git refuses to check out a branch that another - worktree already has checked out. If `git checkout <branch>` fails that - way, another agent owns that experiment — leave it alone and work on your - own node. -- Your worktree starts **detached on the baseline tip**; check out your - experiment's branch before editing. - -## Cardinal rules - -Breaking any of these silently invalidates results — they are not style -preferences. - -1. **Never edit a baseline (root experiment) once it exists.** A root is the - control its variants are measured against — on a fresh project you create - it (first `orx create-experiment`, no `--parent`), and from then on it is - frozen. To try an idea, **branch a child** - (`orx create-experiment … --parent <expId>`) and edit the child's branch. -2. **The run command and the environment are a fixed contract — identical on - every node.** Children inherit it verbatim. If the project has no run - command, set the default once with `orx project edit {id} --run-command - '<cmd>'` (or pass `--run-command` when creating the first experiment) — - children inherit it from then on. Never vary behavior through env vars or - env-prefixed commands. -3. **Vary code, not knobs-in-the-command.** Encode hyperparameters in committed - code/config and branch a child per variant. Every node runs the *same* - command over *different code*, so results stay comparable. -4. **Grow the tree downward, not sideways.** Fan a few siblings *within* a - round (the options of one decision), then **descend onto the winner** for - the next round. A root with a long flat row of children is the failure mode. -5. **Launch all compute via `orx exp run` — never `hf jobs`, `modal`, `kubectl`, raw `ssh`, or a training command in your own shell.** Direct jobs are unsupervised and invisible to the dashboard. - -## Command surface (local mode) - -| Command | What it does | -|---|---| -| `orx projects` | List projects; local ones are tagged `(local)`. | -| `orx create-experiment {id} --title "<t>" [--description "<d>"] [--parent <expId> \| --baseline] [--run-command "<cmd>"]` | New node on its own `orx/<slug>` branch, pushed to GitHub — forked off the parent's tip, or off `{baseline}` for a root (the base branch itself is never an experiment node). Omit `--parent`: attaches under the oldest project root — or, on an empty project, becomes the baseline root itself. `--baseline` forces another root (multiple baselines are allowed). | -| `orx project view {id}` / `orx project edit {id} --run-command "<cmd>"` | Inspect the project / set its default run command. | -| `orx exp status <expId>` | Node's branch, command, and latest run. | -| `orx exp desc <expId> [--set "<text>" \| --stdin]` | Read/overwrite the node's notes. Record findings here. | -| `orx exp run <expId> --backend <hf\|modal> --flavor <flavor> [--timeout 4h] [--image <img>]` | Launch the node's run on managed-SKU compute (see "Compute backends"). | -| `orx exp run <expId> --backend k8s [--manifest <path>] [--timeout 4h]` | Launch on the user's cluster from the manifest committed on the branch (default `.orx/k8s.yaml`). No flavors or --image — the manifest declares the resources. | -| `orx exp run <expId> --backend ssh --host <alias>` | Launch as a detached process on the user's own box (an `~/.ssh/config` alias). | -| `orx exp run <expId> --backend slurm [--host <alias>] [--flavor h100:2] [--timeout 4h]` | Launch as a batch job on the user's Slurm cluster (login node from `--host` or the slurm settings default; `--flavor` is a GRES GPU request, omit for CPU-only). | -| `orx exp run <expId> --backend openresearch --flavor <gpu_id[:count]\|cpu5c\|cpu5g\|cpu5m[:vcpus]> [--org <id>] [--disk GB] [--provider P] [--timeout 4h]` | Launch on an **ephemeral OpenResearch box** billed to the user's org (needs `orx login`) — provisioned for this run and deleted when it ends. GPU ids from `orx compute`. | -| `orx exp run <expId> --backend local` | Launch as a detached, supervised process on **this machine** (see "Where runs execute"). No flags — the hardware is whatever this machine has. | -| `orx exp cancel <expId>` | Cancel the in-flight run. | -| `orx exp wait <expId> [--timeout <s>]` / `orx exp wait --project {id}` | Poll until a run reaches a terminal state (project form returns on the first completion). Exits **non-zero** after `--timeout` seconds (default 1800) with nothing changed — that means "still running", not an error. | -| `orx runs {id} [--experiment <expId>]` | Run table, newest first. Run ids come from here. | -| `orx logs <runId> [--head] [--bytes <n>] [--range <s>:<e>]` | Read a run's log (tail by default). | - -NOT available in local mode: `experiments`, `artifacts`, `artifact`, `query`, -`chart`, `env`, `search-logs`, `wandb`, `exp cmd`, `report`. Do not reach for -them — analysis happens through `orx logs`. - -`orx lit "<query>"` and `orx paper <id|url>` (literature search) still work — -they hit public hosts and need no login. - -## The auto-research loop - -Carry one goal across many runs: - -0. **Round 0 — the baseline** (empty project only): `orx create-experiment {id} - --title "Baseline"` (no `--parent`), set the run command, launch it once. - Its numbers are the reference every variant is judged against. -1. **Branch**: `orx create-experiment {id} --title "<idea>" --parent <parentId>` - — one child per distinct thing you try. -2. **Edit** in this worktree: `git fetch origin && git checkout <branch>`, - change the code, commit, and `git push`. The job clones from GitHub, so - **unpushed work never runs**. -{launch_step} -4. **Wait — hold your turn open**: call `orx exp wait <expId> --timeout 480` - (or `--project` when several are in flight) in a loop. Exit 0 → the run is - terminal, go analyze. Non-zero → nothing changed yet; immediately call it - again. Each call stays under your shell tool's own time limit. -5. **Analyze**: `orx logs <runId>` — read the metrics the run printed. -6. **Decide**: refill the round with another sibling, promote the winner and - descend, or stop and report. Write what you learned into `orx exp desc`. - -When a line of work concludes (or the user asks for a write-up), write a report -**directly into the files dir** (`{files}`) — no upload step; anything under it -appears in the dashboard's Files tab immediately, grouped by experiment. The -layout mirrors the tree (one folder per experiment slug); the `orx-reports` -skill has the folder structure and section guidance. - -When the user gives you a research task, see it through this loop — don't stop -after a single step or hand back a half-finished attempt. End your turn only -when the task is achieved, genuinely blocked on a decision only the user can -make, or the approach is exhausted. (For a plain question, just answer it.) - -## Staying online while runs execute - -Nothing re-invokes you when a run finishes, and there are no background -monitors — any process you background dies when your turn ends, so "I'll keep -watching the run" is not something you can do. While a run you launched is in -flight, the wait loop above IS your job: stay in it, and end your turn only -once you've read the result and acted on it. (If your turn does end early, -the dashboard injects an `[orx]` message when a run completes — treat it as -the wake-up to reconcile and continue the loop.) - -## Referencing files - -When you point the reader at a repo source file in chat, wrap it so they can -open it in the dashboard's file viewer: `<file path="relative/path.py" />`, or -with a line target `<file path="relative/path.py" lines="20-40" />`. Use -repo-relative paths (from the worktree root), not absolute paths. Reach for this -whenever you'd otherwise write a bare file path or a markdown link to a file — -the file you edited, the entrypoint you're describing, the config you changed. - -## Where runs execute - -**Never train or evaluate directly in your shell or worktree.** Your worktree -is the edit box: git, reading and writing code, and `orx` orchestration happen -here. The run itself — anything that trains, evaluates, or produces results — -always goes through `orx exp run`: a raw `python train.py` in your shell is -unsupervised, invisible to the dashboard, runs whatever happens to be in your -checkout instead of the branch tip, and blocks your turn. Lightweight -editor-side checks (`git`, `orx`, a quick `python -c "import x"`) are all that -belong in your shell. - -Running **on this machine** is fine when the user picks it — that's -`--backend local`, which still goes through the run contract (clones the -branch tip into its own run dir, supervised, visible in the dashboard). It -shares CPU/RAM/GPU with the dashboard and your editing, so prefer it for -small or CPU-scale runs and use a remote backend for anything heavy. - -## Compute backends - -{backends_intro} -Backends: `hf` and `modal` (managed SKUs, `--flavor`), `k8s` (a manifest you -commit on the branch), `ssh` and `slurm` (`--host`), `openresearch` (an -ephemeral org box, `--flavor`), and `local` (this machine, no flags). All share -one contract — the job clones the experiment branch's GitHub tip and runs the -fixed run command, and everything downstream (`orx exp wait` / `orx runs` / -`orx logs` / `orx exp cancel`) works identically. A detached `orx supervise` -mirrors status and logs; don't kill it. `--timeout` (default `4h`) applies to -`hf`/`modal`/`k8s`/`slurm`/`openresearch`; `--image` overrides the container on -`hf`/`modal`. - -**Load the specifics before launching on a backend you haven't used this -session:** the `orx-compute` skill has the per-backend flavors, flags, and -sizing discipline; the `orx-compute-k8s` skill has the full manifest contract -orx enforces at submit. Fetch them with `orx skill compute` / `orx skill -compute-k8s` if your harness hasn't surfaced them. - -## Sizing compute - -Decide GPU vs CPU first (CPU flavors are far cheaper for API-driven evals and -data prep), pick the smallest flavor that fits, and let a real OOM/too-slow -failure escalate you a tier. Per-flavor sizing detail lives in the `orx-compute` -skill. - -## Analyzing results - -Run logs are the only evidence channel in local mode. Make the run command -print everything you'll need to stdout — final metrics, an `EVAL.md`-style -summary, key config — and read it back with `orx logs <runId>` (use `--head` / -`--range` for long logs). If a run's output isn't in its log, it's lost. The -`orx-evidence` skill expands this. - -## Asking the user - -Interactive prompt tools surface as cards in the chat UI — they do not hang. -If your harness provides a question tool (e.g. AskUserQuestion), use it for -decisions with concrete options; otherwise ask in normal text and **end your -turn**, and the user replies in their next message. - -**Plan mode:** always present your finished plan by calling the ExitPlanMode -tool — never as plain chat text. The plan card is how the user approves the -plan and unlocks execution; a plan left in chat text strands the session in -plan mode. -"# - ) + let template = SYSTEM_PROMPT + .split_once("-->\n\n") + .map(|(_, rest)| rest) + .unwrap_or(SYSTEM_PROMPT); + template + .replace("{name}", name) + .replace("{id}", id) + .replace("{repo}", &repo) + .replace("{baseline}", baseline) + .replace("{paper_line}", &paper_line) + .replace("{compute_bullet}", &compute_bullet) + .replace("{files}", &files) + .replace("{skills_list}", &skills_list) + .replace("{launch_step}", launch_step) + .replace("{backends_intro}", &backends_intro) } /// Keep the files we drop into the checkout out of `git status` / accidental @@ -847,12 +642,29 @@ mod tests { #[test] fn playbook_has_no_unresolved_placeholders() { let md = playbook_md(&sample_project()); + // Every token the template may carry must be substituted — a typo'd or + // newly added token that playbook_md doesn't know about fails here. + for token in [ + "{name}", + "{id}", + "{repo}", + "{baseline}", + "{paper_line}", + "{compute_bullet}", + "{files}", + "{skills_list}", + "{launch_step}", + "{backends_intro}", + ] { + assert!(!md.contains(token), "unresolved placeholder {token}"); + } + // The template's leading HTML comment (repo-reader documentation) must + // be stripped — the prompt starts at the title. assert!( - !md.contains("{backends_intro}") - && !md.contains("{launch_step}") - && !md.contains("{files}"), - "playbook has an unresolved placeholder" + md.starts_with("# OpenResearch local agent"), + "template comment not stripped" ); + assert!(!md.contains("<!--"), "HTML comment leaked into the prompt"); // Sanity: the slimmed pointers to the modules survived. assert!(md.contains("orx-compute")); assert!(md.contains("orx-reports")); From bbe3cdd96e132a58275fdf05f63f1ca57ac7071e Mon Sep 17 00:00:00 2001 From: Daniel Kim <sox8502@gmail.com> Date: Fri, 17 Jul 2026 17:23:46 -0700 Subject: [PATCH 7/7] orx-compute skill: add missing slurm + openresearch backend sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The playbook trim removed the slurm/openresearch table rows, but orx-compute's body (extracted from the old SKILL.md) never had sections for them — the detail existed only in the playbook. Content moved from the pre-PR playbook rows in the same per-backend section style. Also restore the shell-tool time-limit rationale on the wait loop step in SYSTEM_PROMPT.md. --- SYSTEM_PROMPT.md | 3 +- agent-skills/orx-compute/SKILL.md | 51 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/SYSTEM_PROMPT.md b/SYSTEM_PROMPT.md index a85f892..4d1cc09 100644 --- a/SYSTEM_PROMPT.md +++ b/SYSTEM_PROMPT.md @@ -135,7 +135,8 @@ Carry one goal across many runs (full guidance: **`orx-experiment-tree`** skill) {launch_step} 4. **Wait — hold your turn open**: call `orx exp wait <expId> --timeout 480` (or `--project` when several are in flight) in a loop. Exit 0 → terminal, go - analyze; non-zero → immediately call it again. + analyze; non-zero → immediately call it again (each call stays under your + shell tool's own time limit). 5. **Analyze**: `orx logs <runId>`. Logs are the only evidence channel — make the run command print every metric you'll need (**`orx-evidence`** skill). 6. **Decide**: refill the round with another sibling, promote the winner and diff --git a/agent-skills/orx-compute/SKILL.md b/agent-skills/orx-compute/SKILL.md index a7640f7..a430942 100644 --- a/agent-skills/orx-compute/SKILL.md +++ b/agent-skills/orx-compute/SKILL.md @@ -182,6 +182,57 @@ Rules and notes: process group. Everything downstream (`orx exp wait` / `runs` / `logs`) is identical; a detached `orx supervise` polls it over ssh — don't kill it. +## Running on your Slurm cluster — `--backend slurm` + +**Same rule: use `--backend slurm` ONLY when the user explicitly asks for their +Slurm cluster** ("submit it to the cluster", "run it via sbatch") or it is the +configured default target. Local projects (`orx up`) only. It submits the +experiment as a batch job via `sbatch` on the login node, reached over ssh — the +host's environment as-is, no container. + +```sh +orx exp run <expId> --backend slurm --host login-node --flavor h100:2 --timeout 4h +orx exp run <expId> --backend slurm # CPU-only, settings default host +``` + +Rules and notes: +- **`--host` is the login node's `~/.ssh/config` alias**; omit it to use the + default from the slurm settings (`orx up` Settings → Compute → Slurm). +- **`--flavor` is a GRES GPU request** (`h100:2` = two H100s) — omit it for a + CPU-only job. There is no `--image`; the job runs in the cluster's own + environment (modules, conda, whatever the login profile provides). +- `--timeout` (default `4h`) applies — size it to cover the whole run; a job + killed at the timeout reads as a failed run. +- Same clone contract as every backend: the job clones the experiment branch's + GitHub tip and runs the fixed command — commit and push first. Everything + downstream (`orx exp wait` / `orx runs` / `orx logs` / `orx exp cancel`) is + identical; a detached `orx supervise` mirrors status and logs — don't kill it. + +## Running on an OpenResearch box — `--backend openresearch` + +**Same rule: use `--backend openresearch` ONLY when the user explicitly asks +for it** ("use an openresearch box", "bill it to the org") or it is the +configured default target. It provisions an **ephemeral OpenResearch machine +billed to the user's org** — created for this run and deleted when it ends — +with a fixed CUDA + PyTorch + uv image. Needs `orx login` and a registered SSH +key. + +```sh +orx exp run <expId> --backend openresearch --flavor h100_sxm:2 --timeout 4h +orx exp run <expId> --backend openresearch --flavor cpu5c:32 --org <orgId> +``` + +Rules and notes: +- **`--flavor` is a GPU id from `orx compute`** (`h100_sxm`, `h100_sxm:2` for a + count) **or a CPU flavor** (`cpu5c` / `cpu5g` / `cpu5m`, with `:vcpus` like + `cpu5c:32`). Run `orx compute` to see what's available. +- Optional: `--org <id>` (when you belong to several), `--disk <GB>`, and + `--provider <P>`. No `--image` — the platform's image is fixed. +- `--timeout` (default `4h`) applies — the box is deleted when the run ends + either way, so nothing persists on it; everything you need must be in the log. +- Same clone contract and downstream commands as every backend; a detached + `orx supervise` mirrors status and logs — don't kill it. + ## Running on this machine — `--backend local` **Same rule: use `--backend local` ONLY when the user explicitly asks to run